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

Message "query failed due to primary key constraint:" in history syncer process.

XMLWordPrintable

    • S2401-1, S2401-2, Prev.Sprint, S24-W10/11
    • 5

      In 6.0.23, the same issue as ZBX-22695 occurred where the last 6 digits of ns were 0.
      I checked the history_log and found that "OS time return" occurred at the same time.

      zbx_timespec function, but if ts->sec is in the past than last_ts.sec, the time is not corrected.

      #if defined(_WINDOWS) || defined(__MINGW32__)
      	if (last_ts.sec == ts->sec && (last_ts.ns == ts->ns ||
      			(last_ts.ns + corr >= ts->ns && 1000000 > (last_ts.ns + corr - ts->ns))))
      #else
      	if (last_ts.ns == ts->ns && last_ts.sec == ts->sec)
      #endif
      	{
      		ts->ns = last_ts.ns + (++corr);
      
      		while (ts->ns >= 1000000000)
      		{
      			ts->sec++;
      			ts->ns -= 1000000000;
      		}
      	}
      	else
      	{
      		last_ts.sec = ts->sec;
      		last_ts.ns = ts->ns;
      		corr = 0;
      	}
      

            mprihodko Mihails Prihodko
            kazuo.ito Kazuo Ito
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: