-
Change Request
-
Resolution: Unresolved
-
Trivial
-
None
-
6.0.36rc1, 6.4.20rc1, 7.0.6rc1, 7.2.0alpha1
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:
- TimescaleDB >=2.11, PostgreSQL that is suitable for your timescaleDB https://docs.timescale.com/self-hosted/latest/upgrades/upgrade-pg/ In my case I used TimescaleDB 2.16.1 / Postgresql 15.8
- Import the host with trapper item via import file zbx_report.yaml
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.