Implement rate limiter check for advancing logical clocks

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • 3.5.5
    • Affects Version/s: 3.5.1
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding 2017-03-27
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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()
          }
          ...
      };
      

            Assignee:
            Jack Mulrow
            Reporter:
            Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: