Only in zabbix-2.0.8/include: stamp-h1 diff -ruB zabbix-2.0.8/src/libs/zbxdbcache/dbcache.c zabbix-2.0.8-log/src/libs/zbxdbcache/dbcache.c --- zabbix-2.0.8/src/libs/zbxdbcache/dbcache.c 2013-08-21 10:59:21.000000000 -0300 +++ zabbix-2.0.8-log/src/libs/zbxdbcache/dbcache.c 2013-08-22 21:39:31.694026394 -0300 @@ -2165,7 +2165,7 @@ static ZBX_DC_HISTORY *history = NULL; int i, history_num, n, f; int syncs; - int total_num = 0; + int total_num = 0, flag_for1 = 0, flag_for2 = 0, flag_log = 0; int skipped_clock, max_delay; time_t now = 0; @@ -2188,6 +2188,13 @@ syncs = cache->history_num / ZBX_SYNC_MAX; max_delay = (int)time(NULL) - CONFIG_HISTSYNCER_FREQUENCY; + // Edit Unirede - Debug + if (cache->history_num > 10000) { + flag_log = 1; + zabbix_log(LOG_LEVEL_ERR, "In %s() history_first:%d history_num:%d syncs:%d max_delay:%d", + __function_name, cache->history_first, cache->history_num, syncs, max_delay); + } + do { LOCK_CACHE; @@ -2199,6 +2206,8 @@ { int num; + flag_for1++; + if (ZBX_HISTORY_SIZE <= f) f -= ZBX_HISTORY_SIZE; @@ -2223,14 +2232,18 @@ if (SUCCEED == uint64_array_exists(cache->itemids, cache->itemids_num, cache->history[f].itemid)) { - if (0 == skipped_clock) + if (0 == skipped_clock) { skipped_clock = cache->history[f].clock; + zabbix_log(LOG_LEVEL_ERR, "In uint64_array_exists() num:%d itemid:" ZBX_FS_UI64, num, cache->history[f].itemid); + } n -= num; f += num; continue; } - else if (1 < num && 0 == skipped_clock) + else if (1 < num && 0 == skipped_clock) { skipped_clock = cache->history[ZBX_HISTORY_SIZE == f + 1 ? 0 : f + 1].clock; + zabbix_log(LOG_LEVEL_ERR, "In else if() num:%d itemid:" ZBX_FS_UI64, num, cache->history[f].itemid); + } uint64_array_add(&cache->itemids, &cache->itemids_alloc, &cache->itemids_num, cache->history[f].itemid, 0); @@ -2289,6 +2302,7 @@ for (n = cache->history_num; 0 < n; n--) { + flag_for2++; if (0 == f) f = ZBX_HISTORY_SIZE; f--; @@ -2366,6 +2380,13 @@ } } while (--syncs > 0 || sync_type == ZBX_SYNC_FULL || (skipped_clock != 0 && skipped_clock < max_delay)); + + // Edit Unirede - Debug + if (flag_log) { + zabbix_log(LOG_LEVEL_ERR, "End %s() history_first:%d history_num:%d skipped_clock:%d syncs:%d max_delay:%d flag_for1:%d flag_for2:%d", + __function_name, cache->history_first, cache->history_num, skipped_clock, syncs, max_delay, flag_for1, flag_for2); + } + finish: if (ZBX_SYNC_FULL == sync_type) zabbix_log(LOG_LEVEL_WARNING, "syncing history data done"); diff -ruB zabbix-2.0.8/src/zabbix_server/dbsyncer/dbsyncer.c zabbix-2.0.8-log/src/zabbix_server/dbsyncer/dbsyncer.c --- zabbix-2.0.8/src/zabbix_server/dbsyncer/dbsyncer.c 2013-08-21 10:59:21.000000000 -0300 +++ zabbix-2.0.8-log/src/zabbix_server/dbsyncer/dbsyncer.c 2013-08-22 21:40:21.509752398 -0300 @@ -65,7 +65,7 @@ num = DCsync_history(ZBX_SYNC_PARTIAL); sec = zbx_time() - sec; - zabbix_log(LOG_LEVEL_DEBUG, "%s #%d spent " ZBX_FS_DBL " seconds while processing %d items", + zabbix_log(LOG_LEVEL_ERR, "%s #%d spent " ZBX_FS_DBL " seconds while processing %d items", get_process_type_string(process_type), process_num, sec, num); if (-1 == last_sleeptime)