Handle stale primary member data case in sync source selection

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Replication
    • Fully Compatible
    • ALL
    • v9.0, v8.3, v8.0, v7.0
    • Repl 2026-08-17
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In SERVER-96495, we added logic to prefer syncing from the primary if we are choosing between the primary and another node in a datacenter.

      The check is done using member data of each node. However, this data may be stale, since we mark a node as primary if they self report primary. Then, we use _currentPrimaryIndex as our final index. We may be running this code as part of primary catchup, which then causes us to set our sync source index to ourself.

      This later triggers an invariant here when we re-evaluate sync sources.

            Assignee:
            Xuerui Fa
            Reporter:
            Xuerui Fa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: