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

Helpers::removeRange always waits for 2 secondaries if secondaryThrottle is true

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.2
    • Component/s: None
    • None
    • ALL

      Relevant piece of code:

                  if ( secondaryThrottle && numDeleted > 0 ) {
                      if ( ! waitForReplication( c.getLastOp(), 2, 60 /* seconds to wait */ ) ) {
                          warning() << "replication to secondaries for removeRange at least 60 seconds behind" << endl;
                      }
                      millisWaitingForReplication += secondaryThrottleTime.millis();
                  }
      

      Note that 2 (num of secondaries to wait) is always passed to waitForReplication. This can cause the delete to needlessly wait for 60 seconds if there are less than 2 secondaries (and worse, if the node is not a member of a replica set at all!)

            Assignee:
            Unassigned Unassigned
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: