#50299 Ticket 50265: the warning about skew time could last forever
Closed 3 years ago by spichugi. Opened 5 years ago by lkrispen.
lkrispen/389-ds-base t50265  into  master

file modified
+7 -15
@@ -191,22 +191,14 @@ 

              slapi_rwlock_unlock(gen->lock);

              return rc;

          }

-     } else if (delta < -300) {

-         /*

-          * The maxseqnum could support up to 65535 CSNs per second.

-          * That means that we could avoid duplicated CSN's for

-          * delta up to 300 secs if update rate is 200/sec (usually

-          * the max rate is below 20/sec).

-          * Beyond 300 secs, we advance gen->state.sampled_time by

-          * one sec to recycle seqnum.

-          */

-         slapi_log_err(SLAPI_LOG_WARNING, "csngen_new_csn", "Too much time skew (%d secs). Current seqnum=%0x\n", delta, gen->state.seq_num);

-         rc = _csngen_adjust_local_time(gen, gen->state.sampled_time + 1);

-         if (rc != CSN_SUCCESS) {

-             slapi_rwlock_unlock(gen->lock);

-             return rc;

-         }

      }

+     /* if (delta < 0) this means the local system time was set back

+      * the new csn will be generated based on sampled time, which is

+      * ahead of system time and previously generated csns.

+      * the time stamp of the csn will not change until system time

+      * catches up or is corrected by remote csns.

+      * But we need to ensure that the seq_num does not overflow.

+      */

  

      if (gen->state.seq_num == CSN_MAX_SEQNUM) {

          slapi_log_err(SLAPI_LOG_INFO, "csngen_new_csn", "Sequence rollover; "

Bug: if the local system time is set back more than 300 seconds
a worning about too much time skew is logged and the sampled
time is updated. This adjustment is done at every write operation
and can increase the time skew and be logged infinitely

Fix: the intention of the adjustment was to avoid a roll over of seq_num
if the sampled time is not increased for more than 65k oberations.
But this is already handled with an explicite check for seq_num
rollover. The extra adjustment for negative time skew can be removed.

Reviewed by: ?

Nice debug and fix. Ack

rebased onto 0a4ee32

5 years ago

Pull-Request has been merged by lkrispen

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3358

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata