Здравствуйте.
При переходе на Zabbix 6.0 выполняю все в соответствии с инструкцией от разработчика.
В итоге получаю вот такое сообщение об ошибке:
zabbix=> select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history_text'), scheduled => true);
ERROR: job ID cannot be NULL
Используется Postgresql 13.6
zabbix=> \dx
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | 2.7.0 | public | Enables scalable inserts and complex queries for time-series data
(2 rows)
zabbix=> show timescaledb.license ;
timescaledb.license
---------------------
timescale
(1 row)
zabbix=>
Ниже последовательность моих действий:
psql -p5436 -d zabbix -U zabbix < history_pk_prepare_new.sql
zabbix=> \copy (select * from history_text_old) TO '/pgdump/tmp/history_text.csv' DELIMITER ',' CSV;
COPY 116389
zabbix=> CREATE TEMP TABLE temp_history_text (
itemid bigint NOT NULL,
clock integer DEFAULT '0' NOT NULL,
value text DEFAULT '' NOT NULL,
ns integer DEFAULT '0' NOT NULL
);
CREATE TABLE
zabbix=> \copy temp_history_text FROM '/pgdump/tmp/history_text.csv' DELIMITER ',' CSV;
COPY 116389
zabbix=> select create_hypertable('history_text', 'clock', chunk_time_interval => 86400, migrate_data => true);
create_hypertable
----------------------------
(10,public,history_text,t)
(1 row)
zabbix=> INSERT INTO history_text SELECT * FROM temp_history_text ON CONFLICT (itemid,clock,ns) DO NOTHING;
INSERT 0 116389
zabbix=> select set_integer_now_func('history_text', 'zbx_ts_unix_now', true);
set_integer_now_func
----------------------
(1 row)
zabbix=> alter table history_text set (timescaledb.compress,timescaledb.compress_segment by='itemid',timescaledb.compress_orderby='clock,ns ');
ALTER TABLE
zabbix=> select add_compression_policy('history_text', (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_text_old')::integer);
add_compression_policy
------------------------
(1 row)
zabbix=> select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history_text'), scheduled => true);
ERROR: job ID cannot be NULL
Просьба подсказать где искать проблему.
При переходе на Zabbix 6.0 выполняю все в соответствии с инструкцией от разработчика.
В итоге получаю вот такое сообщение об ошибке:
zabbix=> select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history_text'), scheduled => true);
ERROR: job ID cannot be NULL
Используется Postgresql 13.6
zabbix=> \dx
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | 2.7.0 | public | Enables scalable inserts and complex queries for time-series data
(2 rows)
zabbix=> show timescaledb.license ;
timescaledb.license
---------------------
timescale
(1 row)
zabbix=>
Ниже последовательность моих действий:
psql -p5436 -d zabbix -U zabbix < history_pk_prepare_new.sql
zabbix=> \copy (select * from history_text_old) TO '/pgdump/tmp/history_text.csv' DELIMITER ',' CSV;
COPY 116389
zabbix=> CREATE TEMP TABLE temp_history_text (
itemid bigint NOT NULL,
clock integer DEFAULT '0' NOT NULL,
value text DEFAULT '' NOT NULL,
ns integer DEFAULT '0' NOT NULL
);
CREATE TABLE
zabbix=> \copy temp_history_text FROM '/pgdump/tmp/history_text.csv' DELIMITER ',' CSV;
COPY 116389
zabbix=> select create_hypertable('history_text', 'clock', chunk_time_interval => 86400, migrate_data => true);
create_hypertable
----------------------------
(10,public,history_text,t)
(1 row)
zabbix=> INSERT INTO history_text SELECT * FROM temp_history_text ON CONFLICT (itemid,clock,ns) DO NOTHING;
INSERT 0 116389
zabbix=> select set_integer_now_func('history_text', 'zbx_ts_unix_now', true);
set_integer_now_func
----------------------
(1 row)
zabbix=> alter table history_text set (timescaledb.compress,timescaledb.compress_segment by='itemid',timescaledb.compress_orderby='clock,ns ');
ALTER TABLE
zabbix=> select add_compression_policy('history_text', (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_text_old')::integer);
add_compression_policy
------------------------
(1 row)
zabbix=> select alter_job((select job_id from timescaledb_information.jobs where hypertable_schema='public' and hypertable_name='history_text'), scheduled => true);
ERROR: job ID cannot be NULL
Просьба подсказать где искать проблему.
(при этом ничего не сломалось и timescaledb работает штатно)
Comment