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

Make dry-run elections write to lastVote like real elections do

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • Replication 2021-12-27, Replication 2022-01-24, Replication 2022-02-07, Repl 2022-02-21

      As a result, nodes blocked on Global locks can vote in dry runs but would block on actual elections.

      Here is an example:

      dry run:

      2020-09-18T09:55:22.110+1000 I COMMAND  [conn15] command admin.$cmd command: replSetRequestVotes { replSetRequestVotes: 1, setName: "replset", dryRun: true, term: 1, candidateIndex: 2, configVersion: 1, lastCommittedOp: { ts: Timestamp(1600386902, 1), t: 1 }, $clusterTime: { clusterTime: Timestamp(1600386902, 1), signature: { hash: BinData(0, 6DB77428788E3FCF244CC5F5AD4BCBE5DC14E2FB), keyId: 6873609104389046273 } }, $db: "admin" } numYields:0 reslen:204 locks:{} protocol:op_msg 0ms
      

      actual election:

      2020-09-18T09:55:22.130+1000 I COMMAND  [conn15] command local.replset.election command: replSetRequestVotes { replSetRequestVotes: 1, setName: "replset", dryRun: false, term: 2, candidateIndex: 2, configVersion: 1, lastCommittedOp: { ts: Timestamp(1600386902, 1), t: 1 }, $clusterTime: { clusterTime: Timestamp(1600386902, 1), signature: { hash: BinData(0, 6DB77428788E3FCF244CC5F5AD4BCBE5DC14E2FB), keyId: 6873609104389046273 } }, $db: "admin" } numYields:0 reslen:204 locks:{ Global: { acquireCount: { r: 2, w: 1 } }, Database: { acquireCount: { r: 1, w: 1 } }, Collection: { acquireCount: { r: 1, w: 1 } } } storage:{} protocol:op_msg 6ms
      

      Should we consider acquiring intent locks on dry runs?

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            amar.hamzeh@mongodb.com Amar Hamzeh
            Votes:
            0 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated: