Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-12339

Items comparison always fail if housekeeper is enabled

XMLWordPrintable

    • Sprint 12, Sprint 13
    • 0.5

      The function dbsync_compare_item in src/libs/zbxdbcache/dbsync.c:1242 should compare an item stored in the zabbix database with the same item stored in configuration cache.

      The function contain this code that perform a comparison of the history flags:

      	if (ZBX_HK_OPTION_ENABLED == dbsync_env.cache->config->hk.history_global)
      	{
      		if (item->history != dbsync_env.cache->config->hk.history)
      			return FAIL;
      	}
      	else
      	{
      		if (FAIL == dbsync_compare_bool_time(dbrow[31], item->history))
      			return FAIL;
      	}
      

      if the first condition in the if-else chain is true (so, if item housekeeping settings are overridden by global one), The nested condition will always be false, due to the fact that in the actual trunk, the history field of the ZBX_DC_ITEM structure is an unsigned char (used for storing a flag) and the dbsync_env.cache->config->hk.history is an integer, containing the global setting, in seconds, for the housekeeper. The same thing apply for trends, too (for the value types that do have trends).

      As a consequence of this bug, during a synchronization, all the items will always be reloaded in the configuration cache if already loaded in the zabbix server.

            Unassigned Unassigned
            abs Andrea Biscuola (Inactive)
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: