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

Implement rate limiter check for advancing logical clocks

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.5.5
    • 3.5.1
    • Sharding
    • None
    • Fully Compatible
    • Sharding 2017-03-27

    Description

      Also include maxAcceptableLogicalClockDrift parameter

      // In secs for hybrid LogicalClock.
      MONGO_EXPORT_STARTUP_SERVER_PARAMETER(maxAcceptableLogicalClockDrift, uint64_t,  365 * 24 * 60 * 60);
       
      class LogicalClock {
      public:
          ...
          // Assuming _myTime is mutex protected (as opposed to atomics)
          // Needs to be called in all cases where clock is being set, except for signAndAdvanceClusterTime
          Status passesRateLimiter_inlock(LogicalTime newTime) {
              auto now = secsNow();
              if (diff(newTime.getSecs() - now) > maxAcceptableLogicalClockDrift) {
                  return ErrorCodes::ClusterTimeFailsRateLimiter;
              }
       
              return Status::OK()
          }
          ...
      };
      

      Attachments

        Activity

          People

            jack.mulrow@mongodb.com Jack Mulrow
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: