...

Text file src/go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid.yml

Documentation: go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/rs

     1description: "setVersion that is less than maxSetVersion is ignored if there is no electionId"
     2
     3uri: "mongodb://a/?replicaSet=rs"
     4
     5phases: [
     6
     7    # Primary A is discovered and tells us about B.
     8    {
     9        responses: [
    10            ["a:27017", {
    11                ok: 1,
    12                helloOk: true,
    13                isWritablePrimary: true,
    14                hosts: ["a:27017", "b:27017"],
    15                setName: "rs",
    16                setVersion: 2,
    17                minWireVersion: 0,
    18                maxWireVersion: 17
    19            }]
    20        ],
    21
    22        outcome: {
    23            servers: {
    24                "a:27017": {
    25                    type: "RSPrimary",
    26                    setName: "rs",
    27                    setVersion: 2 ,
    28                    electionId:
    29                },
    30                "b:27017": {
    31                    type: "Unknown",
    32                    setName: ,
    33                    electionId:
    34                }
    35            },
    36            topologyType: "ReplicaSetWithPrimary",
    37            logicalSessionTimeoutMinutes: null,
    38            setName: "rs",
    39            maxSetVersion: 2,
    40        }
    41    },
    42
    43    # B is elected, its setVersion is older so it is stale
    44    {
    45        responses: [
    46            ["b:27017", {
    47                ok: 1,
    48                helloOk: true,
    49                isWritablePrimary: true,
    50                hosts: ["a:27017", "b:27017"],
    51                setName: "rs",
    52                setVersion: 1,
    53                minWireVersion: 0,
    54                maxWireVersion: 17
    55            }]
    56        ],
    57
    58        outcome: {
    59            servers: {
    60                "a:27017": {
    61                    type: "RSPrimary",
    62                    setName: "rs",
    63                    setVersion: 2 ,
    64                    electionId:
    65                },
    66                "b:27017": {
    67                    type: "Unknown",
    68                    setName: ,
    69                    electionId:
    70                }
    71            },
    72            topologyType: "ReplicaSetWithPrimary",
    73            logicalSessionTimeoutMinutes: null,
    74            setName: "rs",
    75            maxSetVersion: 2,
    76        }
    77    }
    78]

View as plain text