-
Incident report
-
Resolution: Won't fix
-
Trivial
-
None
-
2.0.4
In src/zabbix_server/housekeeper/housekeeper.c the following is defined on line 236:
min_clock = MIN(now - keep_history * SEC_PER_DAY, min_clock + 4 * CONFIG_HOUSEKEEPING_FREQUENCY * SEC_PER_HOUR);
This has a drawback: if you change an item from the default "keep history in days" of 60 to, say, 2, it will take a very long time for all the old data to be cleared. I suggest to change that to:
min_clock = MIN(now - keep_history * SEC_PER_DAY, min_clock + 32 * CONFIG_HOUSEKEEPING_FREQUENCY * SEC_PER_HOUR);
In the current code, if you have hourly housekeeping running, it'll only delete the "currently lowest clock value + 4 hours" worth of data. If changing the History-retention from 60 days to 2, this takes a very long time
Either the hard-coded value of 4 should be config parameter with sufficient warnings about the possibility of table- and transaction logs, or the default value should be increased slightly just to speed up the clearing of old history.