Debian Codegraph @

testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid.yml

raw symbols SCIP
1 description: "Record max setVersion, even from primary without electionId"
2
3 uri: "mongodb://a/?replicaSet=rs"
4
5 phases: [
6
7 # Primary A has electionId and setVersion, 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: 1,
17 electionId: {"$oid": "000000000000000000000001"},
18 minWireVersion: 0,
19 maxWireVersion: 17
20 }]
21 ],
22
23 outcome: {
24 servers: {
25 "a:27017": {
26 type: "RSPrimary",
27 setName: "rs",
28 setVersion: 1,
29 electionId: {"$oid": "000000000000000000000001"}
30 },
31 "b:27017": {
32 type: "Unknown",
33 setName: ,
34 electionId:
35 }
36 },
37 topologyType: "ReplicaSetWithPrimary",
38 logicalSessionTimeoutMinutes: null,
39 setName: "rs",
40 maxSetVersion: 1,
41 maxElectionId: {"$oid": "000000000000000000000001"},
42 }
43 },
44
45 # Reconfig, B reports as primary, B is missing the electionId but reports setVersion
46 {
47 responses: [
48 ["b:27017", {
49 ok: 1,
50 helloOk: true,
51 isWritablePrimary: true,
52 hosts: ["a:27017", "b:27017"],
53 setName: "rs",
54 setVersion: 2,
55 minWireVersion: 0,
56 maxWireVersion: 17
57 }]
58 ],
59
60 outcome: {
61 servers: {
62 "a:27017": {
63 type: "RSPrimary",
64 setName: "rs",
65 setVersion: 1,
66 electionId: { "$oid": "000000000000000000000001" }
67 },
68 "b:27017": {
69 type: "Unknown",
70 setName: ,
71 electionId:
72 }
73 },
74 topologyType: "ReplicaSetWithPrimary",
75 logicalSessionTimeoutMinutes: null,
76 setName: "rs",
77 maxSetVersion: 1,
78 maxElectionId: {"$oid": "000000000000000000000001"},
79 }
80 },
81
82 # A reports as primary, A has been reelection (electionId greater than our recorded maxElectionId).
83 # A's setVersion is less than our maxSetVersion, but electionId takes precedence so B's primary claim is ignored
84 {
85 responses: [
86 ["a:27017", {
87 ok: 1,
88 helloOk: true,
89 isWritablePrimary: true,
90 hosts: ["a:27017", "b:27017"],
91 setName: "rs",
92 setVersion: 1,
93 electionId: {"$oid": "000000000000000000000002"},
94 minWireVersion: 0,
95 maxWireVersion: 17
96 }]
97 ],
98 outcome: {
99 servers: {
100 "a:27017": {
101 type: "RSPrimary",
102 setName: "rs",
103 setVersion: 1,
104 electionId: {"$oid": "000000000000000000000002"}
105 },
106 "b:27017":{
107 type: "Unknown",
108 setName: ,
109 electionId:
110 }
111 },
112 topologyType: "ReplicaSetWithPrimary",
113 logicalSessionTimeoutMinutes: null,
114 setName: "rs",
115 maxSetVersion: 1,
116 maxElectionId: {"$oid": "000000000000000000000002"},
117 }
118 }
119 ]