File tree Expand file tree Collapse file tree 1 file changed +163
-0
lines changed Expand file tree Collapse file tree 1 file changed +163
-0
lines changed Original file line number Diff line number Diff line change 1+ description : " Primary reports a new member"
2+
3+ uri : " mongodb://a/?replicaSet=rs"
4+
5+ phases : [
6+
7+ # At first, a is a secondary.
8+ {
9+ responses : [
10+
11+ ["a:27017", {
12+
13+ ok : 1,
14+ ismaster : false,
15+ secondary : true,
16+ setName : " rs" ,
17+ hosts : ["a:27017", "b:27017"]
18+ }]
19+ ],
20+
21+ outcome : {
22+
23+ servers : {
24+
25+ " a:27017 " : {
26+
27+ type : " RSSecondary" ,
28+ setName : " rs"
29+ },
30+
31+ " b:27017 " : {
32+
33+ type : " Unknown" ,
34+ setName :
35+ }
36+ },
37+
38+ topologyType : " ReplicaSetNoPrimary" ,
39+ setName : " rs"
40+ }
41+ },
42+
43+ # b is the primary.
44+ {
45+ responses : [
46+
47+ ["b:27017", {
48+
49+ ok : 1,
50+ ismaster : true,
51+ setName : " rs" ,
52+ hosts : ["a:27017", "b:27017"]
53+ }]
54+ ],
55+
56+ outcome : {
57+
58+ servers : {
59+
60+ " a:27017 " : {
61+
62+ type : " RSSecondary" ,
63+ setName : " rs"
64+ },
65+
66+ " b:27017 " : {
67+
68+ type : " RSPrimary" ,
69+ setName : " rs"
70+ }
71+ },
72+
73+ topologyType : " ReplicaSetWithPrimary" ,
74+ setName : " rs"
75+ }
76+ },
77+
78+ # Admin adds a secondary member c.
79+ {
80+ responses : [
81+
82+ ["b:27017", {
83+
84+ ok : 1,
85+ ismaster : true,
86+ setName : " rs" ,
87+ hosts : ["a:27017", "b:27017", "c:27017"]
88+ }]
89+ ],
90+
91+ outcome : {
92+
93+ # c is new.
94+ servers : {
95+
96+ " a:27017 " : {
97+
98+ type : " RSSecondary" ,
99+ setName : " rs"
100+ },
101+
102+ " b:27017 " : {
103+
104+ type : " RSPrimary" ,
105+ setName : " rs"
106+ },
107+
108+ " c:27017 " : {
109+
110+ type : " Unknown" ,
111+ setName :
112+ }
113+ },
114+
115+ topologyType : " ReplicaSetWithPrimary" ,
116+ setName : " rs"
117+ }
118+ },
119+
120+ # c becomes secondary.
121+ {
122+ responses : [
123+
124+ ["c:27017", {
125+
126+ ok : 1,
127+ ismaster : false,
128+ secondary : true,
129+ setName : " rs" ,
130+ primary : " b:27017" ,
131+ hosts : ["a:27017", "b:27017", "c:27017"]
132+ }]
133+ ],
134+
135+ outcome : {
136+
137+ # c is a secondary.
138+ servers : {
139+
140+ " a:27017 " : {
141+
142+ type : " RSSecondary" ,
143+ setName : " rs"
144+ },
145+
146+ " b:27017 " : {
147+
148+ type : " RSPrimary" ,
149+ setName : " rs"
150+ },
151+
152+ " c:27017 " : {
153+
154+ type : " RSSecondary" ,
155+ setName : " rs"
156+ }
157+ },
158+
159+ topologyType : " ReplicaSetWithPrimary" ,
160+ setName : " rs"
161+ }
162+ }
163+ ]
You can’t perform that action at this time.
0 commit comments