Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-9569

Remove zabbix restrictions regarding timescaleDB compressed chunk modifications

XMLWordPrintable

      Would be nice to remove zabbix restrictions regarding compressed chunk modifications. According to the timescaleDB documentation, in TimescaleDB 2.11 and later we can update and delete compressed data, so there is no need to keep old logic suitable to >2.11 timscaleDB versions.

      Precondition:

      Note: also reproducible on TimescaleDB 17.0 / Postgresql 17

      Steps to reproduce:

      • Disable or delete Zabbix server host
      • create input file with data where unix timestamps (do not forget to replace timestamps for valid test) are 1, 10, 15. 20, 35 days ago e.g.
      test trap 1729569479 1
      test trap 1728705479 10
      test trap 1728273479 15
      test trap 1727841479 20
      test trap 1726545479 35
      
      • send data via zabbix sender command
        ./bin/zabbix_sender -vv -z "localhost" -T -i input
        
      • execute housekeeper
        ./sbin/zabbix_server -R housekeeper_execute
        
      • Observe that there are enrties in history_uint and trends_uint tables e.g.
      • Stop the server
      • Add timescaleDB extension
        echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql "YOUR_DB_NAME"
        
      • Go to zabbix/database/postgresql/timescaledb folder (for 7.0) and run script e.g.
        psql -U zabbix "YOUR_DB_NAME" < schema.sql
        
      • Run zabbix server
      • Go to Administration->General->Housekeeping, uncheck Override item history period/Override item trend period/Enable compression and save configuration
      • Reload config cache and execute housekeeper
      • Observe that DB contains timescaledb chunks and compressed tables
      • Go to Data collection->Hosts::Items and try to "clear history and trends" for the item where history/trends data is collected and compressed by timescaledb

      Result: Frontend shows success message but Details contains info "Some of the history for this item may be compressed, deletion is not available.". History and trends data are not deleted, chunks and compressed data stay unchanged.

      Note: history.clear API call output->

      Expected: According to the timescaleDB documentation, in TimescaleDB 2.11 and later we can update and delete compressed data. Our minimal supported version for timescaleDB is 2.13.0, so in this case I expect that manual history/trends clear should work without any restrictions.

        1. image-2024-10-22-13-28-17-011.png
          image-2024-10-22-13-28-17-011.png
          21 kB
        2. image-2024-10-22-13-28-26-859.png
          image-2024-10-22-13-28-26-859.png
          23 kB
        3. image-2024-10-22-13-37-23-627.png
          image-2024-10-22-13-37-23-627.png
          30 kB
        4. screenshot-1.png
          screenshot-1.png
          34 kB
        5. screenshot-2.png
          screenshot-2.png
          71 kB
        6. screenshot-3.png
          screenshot-3.png
          12 kB
        7. screenshot-4.png
          screenshot-4.png
          26 kB
        8. zbx_report.yaml
          0.3 kB

            zabbix.dev Zabbix Development Team
            kseve Kirils Seve
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: