Refactor ReplicaSetMonitor to avoid duplicate work

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.1.0
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Refactor ReplicaSetMonitor such that work would not be duplicated. In particular, only allow a single thread to modify _nodes so we don't keep on calling isMaster unnecessarily (especially when several connections calls getMaster roughly the same time and _master was marked as invalid). SERVER-5110 did a little patch to mitigate this, but a redesign is needed to make the code cleaner (logic will be simplified once the invariant that only 1 thread is responsible for modifying _nodes) and avoid duplicating work.

            Assignee:
            Unassigned
            Reporter:
            Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: