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

Force BG clock now == Date_t::lastNow

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.10, 4.0.10
    • Internal Code
    • None
    • Fully Compatible
    • v4.0
    • Service Arch 2019-03-25
    • 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

              jason.carey@mongodb.com Jason Carey
              jason.carey@mongodb.com Jason Carey
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: