[ZBXNEXT-9569] Remove zabbix restrictions regarding timescaleDB compressed chunk modifications Created: 2024 Oct 22  Updated: 2025 May 30

Status: Confirmed
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F), Server (S)
Affects Version/s: 6.0.36rc1, 6.4.20rc1, 7.0.6rc1, 7.2.0alpha1
Fix Version/s: None

Type: Change Request Priority: Trivial
Reporter: Kirils Seve Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 3
Labels: TimescaleDB, compression, validation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2024-10-22-13-28-17-011.png     PNG File image-2024-10-22-13-28-26-859.png     PNG File image-2024-10-22-13-37-23-627.png     PNG File screenshot-1.png     PNG File screenshot-2.png     PNG File screenshot-3.png     PNG File screenshot-4.png     File zbx_report.yaml    

 Description   

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.


Generated at Sat Jun 07 11:28:24 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.