Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-20819

Move getHLCCas directly to use std::chrono and static_assert that clock !steady

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 4.6.0
    • 4.6.0
    • couchbase-bucket

    Description

      LWW requires a HLC timestamp and the real-time part of the stamp to be high-resolution and to follow system time and any NTP changes to system time.

      We can now use std::chrono directly from ep-engine and no longer need to rely on the gethrtime abstraction which can compile to different things (cxxtime.cc vs gethrtime.cc).

      If we use std::chrono directly we can also clearly use static_assert which can check the is_steady bool for false (we must not have a steady_clock for LWWs use of the HLC cas).

      Note the current code on centos6 and centos7 appears to be safe, in that running a test against our gethrtime function it follows system-time on both platforms. A full audit of all Linux platforms is slow and this MB covers a sensible change which will help us.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-20819
          # Subject Branch Project Status CR V

          Activity

            People

              jwalker Jim Walker
              jwalker Jim Walker
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty