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

XMLWordPrintableJSON

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

      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
              Reporter:
              Randolph Tan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: