Secondary read pref with tag can end up selecting no nodes on retry

XMLWordPrintableJSON

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

      Example case:

      2 node replica set:
      primary tag:

      { dc: 'sf' }

      secondary tag:

      { dc: 'ny' }

      read pref setting:
      mode: secondary
      tags: [

      { dc: 'ny' }

      ]

      If the secondary was down and the went up again, the replica set connection object will attempt to select nodes again (since the first try gave us nothing due to the node being down and marked as bad). However, the iterator for the tag was already moved on the first attempt and the retry would end up not checking the nodes because it already depleted the tags on the first attempt.

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

              Created:
              Updated:
              Resolved: