Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40166

Force BG clock now == Date_t::lastNow

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.10, 4.0.10
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.0
    • Sprint:
      Service Arch 2019-03-25
    • Linked BF Score:
      8

      Description

      Currently our fast clock is implemented by a background thread which wakes up every 10ms if callers continue to check it's time. If that background thread get's descheduled for a long time for some reason, this can cause the background threads time to drift substantially.

      If we:

      • force every read of date_t::now to update a new date_t::lastNow
      • change the background thread so that it's responsibility is to wake up and call Date_t::now() (if readers are still present)
      • change the background thread clock source now() to return date_t::lastNow

      We'll get a world in which we have the same target granularity + thread quiescence as before, but additionally ensure that even if the background thread can't be scheduled, that lastNow() will still be pushed loosely forward if there are callers of Date_t::now() elsewhere in the system. This should ensure a tighter bound on the spread between the precise and fast clock sources

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: