-
Type:
Problem report
-
Resolution: Unresolved
-
Priority:
Trivial
-
Affects Version/s: 6.0.49
-
Component/s: Installation (I)
-
Sprint candidates
Primary keys migration with compression fails. The script looks for the compression policy by the old name "Compression%", but tsdb now calls it "Columnstore Policy". AsĀ a result, the new history tables end up without hypertables and compression.
Steps to reproduce:
- Enable tsdb:
echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb.sql | sudo -u zabbix psql zabbix
- Start zabbix server and run housekeeper: zabbix_server -R housekeeper_execute
- Stop zabbix server and run the migration as described in the documentation:
sudo -u zabbix psql zabbix < /usr/share/zabbix-sql-scripts/postgresql/history_pk_prepare.sql cat /usr/share/zabbix-sql-scripts/postgresql/tsdb_history_pk_upgrade_with_compression/history_pk.sql | sudo -u zabbix psql zabbix
Actual result:
ERROR: need to specify one of "compress_after" or "compress_created_before" CONTEXT: SQL statement "SELECT add_compression_policy('history', ( SELECT extract(epoch FROM (config::json->>'compress_after')::interval) FROM timescaledb_information.jobs WHERE application_name LIKE 'Compression%%' AND hypertable_schema='public' AND hypertable_name='history_old' )::integer )"
The new history table stays a regular table, not a hypertable, no compression policy, no data.
Expected result:
History is a hypertable with the migrated data and the same compression policy as history_old.
Suggested fix:
In database/postgresql/timescaledb/option-patches/with-compression/history_pk.sql:58 (same line in history_pk_uint.sql, history_pk_str.sql, history_pk_text.sql; line 62 in history_pk_log.sql), replace the job lookup condition with:
WHERE (application_name LIKE 'Columnstore Policy%%' OR application_name LIKE 'Compression%%') AND hypertable_schema='public'
- related to
-
ZBXNEXT-9770 Replace TimescaleDB functions deprecated starting from version 2.18.0
-
- Closed
-
-
ZBXNEXT-10866 Add TimescaleDB 2.31.x support
-
- IN QA
-