-
Problem report
-
Resolution: Fixed
-
Critical
-
5.0.14, 5.4.3, 6.0 (plan)
-
Sprint 79 (Aug 2021), Sprint 80 (Sep 2021)
-
2
Steps to reproduce:
- use LTS 5.0 with PgSQL/TSDB
- generate history/trends data
Result:
select count(*),tablename,field from housekeeper group by tablename, field order by 1 desc; count tablename field 5618227 trends_uint itemid 5618227 history_text itemid 5618227 history_uint itemid 5618227 trends itemid 5618227 history itemid 5618227 history_log itemid 5618227 history_str itemid 56 events lldruleid 56 events itemid 2 events triggerid
Expected:
Internal housekeeper backlog should be cleaned automatically for history/trends, even if TimescaleDB is used.
This is a problem because of high amount of data, pgsql vacuum handling and also highly affects streaming replication.
... static unsigned char poption_mode_regular = ZBX_HK_MODE_REGULAR; static unsigned char poption_global_disabled = ZBX_HK_OPTION_DISABLED; ... /* Housekeeper table mapping to housekeeping configuration values. */ /* This mapping is used to exclude disabled tables from housekeeping */ /* cleanup procedure. */ static zbx_hk_cleanup_table_t hk_cleanup_tables[] = { {"history", &cfg.hk.history_mode, &cfg.hk.history_global}, {"history_log", &cfg.hk.history_mode, &cfg.hk.history_global}, {"history_str", &cfg.hk.history_mode, &cfg.hk.history_global}, {"history_text", &cfg.hk.history_mode, &cfg.hk.history_global}, {"history_uint", &cfg.hk.history_mode, &cfg.hk.history_global}, {"trends", &cfg.hk.trends_mode, &cfg.hk.trends_global}, {"trends_uint", &cfg.hk.trends_mode, &cfg.hk.trends_global}, /* force events housekeeping mode on to perform problem cleanup when events housekeeping is disabled */ {"events", &poption_mode_regular, &poption_global_disabled}, {NULL} }; ... /* assemble list of tables included in the housekeeping procedure */ for (table = hk_cleanup_tables; NULL != table->name; table++) { if (ZBX_HK_MODE_REGULAR != *table->poption_mode) continue; table_name_esc = DBdyn_escape_string(table->name); zbx_chrcpy_alloc(&sql, &sql_alloc, &sql_offset, '\''); zbx_strcpy_alloc(&sql, &sql_alloc, &sql_offset, table_name_esc); zbx_strcpy_alloc(&sql, &sql_alloc, &sql_offset, "',"); zbx_free(table_name_esc); } ...