Debian Codegraph @

raft/quorum/testdata/joint_commit.txt

raw
1 # No difference between a simple majority quorum and a simple majority quorum
2 # joint with an empty majority quorum. (This is asserted for all datadriven tests
3 # by the framework, so we don't dwell on it more).
4 #
5 # Note that by specifying cfgj explicitly we tell the test harness to treat the
6 # input as a joint quorum and not a majority quorum. If we didn't specify
7 # cfgj=zero the test would pass just the same, but it wouldn't be exercising the
8 # joint quorum path.
9 committed cfg=(1,2,3) cfgj=zero idx=(100,101,99)
10 ----
11 idx
12 x> 100 (id=1)
13 xx> 101 (id=2)
14 > 99 (id=3)
15 100
16
17 # Joint nonoverlapping singleton quorums.
18
19 committed cfg=(1) cfgj=(2) idx=(_,_)
20 ----
21 idx
22 ? 0 (id=1)
23 ? 0 (id=2)
24 0
25
26 # Voter 1 has 100 committed, 2 nothing. This means we definitely won't commit
27 # past 100.
28 committed cfg=(1) cfgj=(2) idx=(100,_)
29 ----
30 idx
31 x> 100 (id=1)
32 ? 0 (id=2)
33 0
34
35 # Committed index collapses once both majorities do, to the lower index.
36 committed cfg=(1) cfgj=(2) idx=(13, 100)
37 ----
38 idx
39 > 13 (id=1)
40 x> 100 (id=2)
41 13
42
43 # Joint overlapping (i.e. identical) singleton quorum.
44
45 committed cfg=(1) cfgj=(1) idx=(_)
46 ----
47 idx
48 ? 0 (id=1)
49 0
50
51 committed cfg=(1) cfgj=(1) idx=(100)
52 ----
53 idx
54 > 100 (id=1)
55 100
56
57
58
59 # Two-node config joint with non-overlapping single node config
60 committed cfg=(1,3) cfgj=(2) idx=(_,_,_)
61 ----
62 idx
63 ? 0 (id=1)
64 ? 0 (id=2)
65 ? 0 (id=3)
66 0
67
68 committed cfg=(1,3) cfgj=(2) idx=(100,_,_)
69 ----
70 idx
71 xx> 100 (id=1)
72 ? 0 (id=2)
73 ? 0 (id=3)
74 0
75
76 # 1 has 100 committed, 2 has 50 (collapsing half of the joint quorum to 50).
77 committed cfg=(1,3) cfgj=(2) idx=(100,_,50)
78 ----
79 idx
80 xx> 100 (id=1)
81 x> 50 (id=2)
82 ? 0 (id=3)
83 0
84
85 # 2 reports 45, collapsing the other half (to 45).
86 committed cfg=(1,3) cfgj=(2) idx=(100,45,50)
87 ----
88 idx
89 xx> 100 (id=1)
90 x> 50 (id=2)
91 > 45 (id=3)
92 45
93
94 # Two-node config with overlapping single-node config.
95
96 committed cfg=(1,2) cfgj=(2) idx=(_,_)
97 ----
98 idx
99 ? 0 (id=1)
100 ? 0 (id=2)
101 0
102
103 # 1 reports 100.
104 committed cfg=(1,2) cfgj=(2) idx=(100,_)
105 ----
106 idx
107 x> 100 (id=1)
108 ? 0 (id=2)
109 0
110
111 # 2 reports 100.
112 committed cfg=(1,2) cfgj=(2) idx=(_,100)
113 ----
114 idx
115 ? 0 (id=1)
116 x> 100 (id=2)
117 0
118
119 committed cfg=(1,2) cfgj=(2) idx=(50,100)
120 ----
121 idx
122 > 50 (id=1)
123 x> 100 (id=2)
124 50
125
126 committed cfg=(1,2) cfgj=(2) idx=(100,50)
127 ----
128 idx
129 x> 100 (id=1)
130 > 50 (id=2)
131 50
132
133
134
135 # Joint non-overlapping two-node configs.
136
137 committed cfg=(1,2) cfgj=(3,4) idx=(50,_,_,_)
138 ----
139 idx
140 xxx> 50 (id=1)
141 ? 0 (id=2)
142 ? 0 (id=3)
143 ? 0 (id=4)
144 0
145
146 committed cfg=(1,2) cfgj=(3,4) idx=(50,_,49,_)
147 ----
148 idx
149 xxx> 50 (id=1)
150 ? 0 (id=2)
151 xx> 49 (id=3)
152 ? 0 (id=4)
153 0
154
155 committed cfg=(1,2) cfgj=(3,4) idx=(50,48,49,_)
156 ----
157 idx
158 xxx> 50 (id=1)
159 x> 48 (id=2)
160 xx> 49 (id=3)
161 ? 0 (id=4)
162 0
163
164 committed cfg=(1,2) cfgj=(3,4) idx=(50,48,49,47)
165 ----
166 idx
167 xxx> 50 (id=1)
168 x> 48 (id=2)
169 xx> 49 (id=3)
170 > 47 (id=4)
171 47
172
173 # Joint overlapping two-node configs.
174 committed cfg=(1,2) cfgj=(2,3) idx=(_,_,_)
175 ----
176 idx
177 ? 0 (id=1)
178 ? 0 (id=2)
179 ? 0 (id=3)
180 0
181
182 committed cfg=(1,2) cfgj=(2,3) idx=(100,_,_)
183 ----
184 idx
185 xx> 100 (id=1)
186 ? 0 (id=2)
187 ? 0 (id=3)
188 0
189
190 committed cfg=(1,2) cfgj=(2,3) idx=(_,100,_)
191 ----
192 idx
193 ? 0 (id=1)
194 xx> 100 (id=2)
195 ? 0 (id=3)
196 0
197
198 committed cfg=(1,2) cfgj=(2,3) idx=(_,100,99)
199 ----
200 idx
201 ? 0 (id=1)
202 xx> 100 (id=2)
203 x> 99 (id=3)
204 0
205
206 committed cfg=(1,2) cfgj=(2,3) idx=(101,100,99)
207 ----
208 idx
209 xx> 101 (id=1)
210 x> 100 (id=2)
211 > 99 (id=3)
212 99
213
214 # Joint identical two-node configs.
215 committed cfg=(1,2) cfgj=(1,2) idx=(_,_)
216 ----
217 idx
218 ? 0 (id=1)
219 ? 0 (id=2)
220 0
221
222 committed cfg=(1,2) cfgj=(1,2) idx=(_,40)
223 ----
224 idx
225 ? 0 (id=1)
226 x> 40 (id=2)
227 0
228
229 committed cfg=(1,2) cfgj=(1,2) idx=(41,40)
230 ----
231 idx
232 x> 41 (id=1)
233 > 40 (id=2)
234 40
235
236
237
238 # Joint disjoint three-node configs.
239
240 committed cfg=(1,2,3) cfgj=(4,5,6) idx=(_,_,_,_,_,_)
241 ----
242 idx
243 ? 0 (id=1)
244 ? 0 (id=2)
245 ? 0 (id=3)
246 ? 0 (id=4)
247 ? 0 (id=5)
248 ? 0 (id=6)
249 0
250
251 committed cfg=(1,2,3) cfgj=(4,5,6) idx=(100,_,_,_,_,_)
252 ----
253 idx
254 xxxxx> 100 (id=1)
255 ? 0 (id=2)
256 ? 0 (id=3)
257 ? 0 (id=4)
258 ? 0 (id=5)
259 ? 0 (id=6)
260 0
261
262 committed cfg=(1,2,3) cfgj=(4,5,6) idx=(100,_,_,90,_,_)
263 ----
264 idx
265 xxxxx> 100 (id=1)
266 ? 0 (id=2)
267 ? 0 (id=3)
268 xxxx> 90 (id=4)
269 ? 0 (id=5)
270 ? 0 (id=6)
271 0
272
273 committed cfg=(1,2,3) cfgj=(4,5,6) idx=(100,99,_,_,_,_)
274 ----
275 idx
276 xxxxx> 100 (id=1)
277 xxxx> 99 (id=2)
278 ? 0 (id=3)
279 ? 0 (id=4)
280 ? 0 (id=5)
281 ? 0 (id=6)
282 0
283
284 # First quorum <= 99, second one <= 97. Both quorums guarantee that 90 is
285 # committed.
286 committed cfg=(1,2,3) cfgj=(4,5,6) idx=(_,99,90,97,95,_)
287 ----
288 idx
289 ? 0 (id=1)
290 xxxxx> 99 (id=2)
291 xx> 90 (id=3)
292 xxxx> 97 (id=4)
293 xxx> 95 (id=5)
294 ? 0 (id=6)
295 90
296
297 # First quorum collapsed to 92. Second one already had at least 95 committed,
298 # so the result also collapses.
299 committed cfg=(1,2,3) cfgj=(4,5,6) idx=(92,99,90,97,95,_)
300 ----
301 idx
302 xx> 92 (id=1)
303 xxxxx> 99 (id=2)
304 x> 90 (id=3)
305 xxxx> 97 (id=4)
306 xxx> 95 (id=5)
307 ? 0 (id=6)
308 92
309
310 # Second quorum collapses, but nothing changes in the output.
311 committed cfg=(1,2,3) cfgj=(4,5,6) idx=(92,99,90,97,95,77)
312 ----
313 idx
314 xx> 92 (id=1)
315 xxxxx> 99 (id=2)
316 x> 90 (id=3)
317 xxxx> 97 (id=4)
318 xxx> 95 (id=5)
319 > 77 (id=6)
320 92
321
322
323 # Joint overlapping three-node configs.
324
325 committed cfg=(1,2,3) cfgj=(1,4,5) idx=(_,_,_,_,_)
326 ----
327 idx
328 ? 0 (id=1)
329 ? 0 (id=2)
330 ? 0 (id=3)
331 ? 0 (id=4)
332 ? 0 (id=5)
333 0
334
335 committed cfg=(1,2,3) cfgj=(1,4,5) idx=(100,_,_,_,_)
336 ----
337 idx
338 xxxx> 100 (id=1)
339 ? 0 (id=2)
340 ? 0 (id=3)
341 ? 0 (id=4)
342 ? 0 (id=5)
343 0
344
345 committed cfg=(1,2,3) cfgj=(1,4,5) idx=(100,101,_,_,_)
346 ----
347 idx
348 xxx> 100 (id=1)
349 xxxx> 101 (id=2)
350 ? 0 (id=3)
351 ? 0 (id=4)
352 ? 0 (id=5)
353 0
354
355 committed cfg=(1,2,3) cfgj=(1,4,5) idx=(100,101,100,_,_)
356 ----
357 idx
358 xx> 100 (id=1)
359 xxxx> 101 (id=2)
360 > 100 (id=3)
361 ? 0 (id=4)
362 ? 0 (id=5)
363 0
364
365 # Second quorum could commit either 98 or 99, but first quorum is open.
366 committed cfg=(1,2,3) cfgj=(1,4,5) idx=(_,100,_,99,98)
367 ----
368 idx
369 ? 0 (id=1)
370 xxxx> 100 (id=2)
371 ? 0 (id=3)
372 xxx> 99 (id=4)
373 xx> 98 (id=5)
374 0
375
376 # Additionally, first quorum can commit either 100 or 99
377 committed cfg=(1,2,3) cfgj=(1,4,5) idx=(_,100,99,99,98)
378 ----
379 idx
380 ? 0 (id=1)
381 xxxx> 100 (id=2)
382 xx> 99 (id=3)
383 > 99 (id=4)
384 x> 98 (id=5)
385 98
386
387 committed cfg=(1,2,3) cfgj=(1,4,5) idx=(1,100,99,99,98)
388 ----
389 idx
390 > 1 (id=1)
391 xxxx> 100 (id=2)
392 xx> 99 (id=3)
393 > 99 (id=4)
394 x> 98 (id=5)
395 98
396
397 committed cfg=(1,2,3) cfgj=(1,4,5) idx=(100,100,99,99,98)
398 ----
399 idx
400 xxx> 100 (id=1)
401 > 100 (id=2)
402 x> 99 (id=3)
403 > 99 (id=4)
404 > 98 (id=5)
405 99
406
407
408 # More overlap.
409
410 committed cfg=(1,2,3) cfgj=(2,3,4) idx=(_,_,_,_)
411 ----
412 idx
413 ? 0 (id=1)
414 ? 0 (id=2)
415 ? 0 (id=3)
416 ? 0 (id=4)
417 0
418
419 committed cfg=(1,2,3) cfgj=(2,3,4) idx=(_,100,99,_)
420 ----
421 idx
422 ? 0 (id=1)
423 xxx> 100 (id=2)
424 xx> 99 (id=3)
425 ? 0 (id=4)
426 99
427
428 committed cfg=(1,2,3) cfgj=(2,3,4) idx=(98,100,99,_)
429 ----
430 idx
431 x> 98 (id=1)
432 xxx> 100 (id=2)
433 xx> 99 (id=3)
434 ? 0 (id=4)
435 99
436
437 committed cfg=(1,2,3) cfgj=(2,3,4) idx=(100,100,99,_)
438 ----
439 idx
440 xx> 100 (id=1)
441 > 100 (id=2)
442 x> 99 (id=3)
443 ? 0 (id=4)
444 99
445
446 committed cfg=(1,2,3) cfgj=(2,3,4) idx=(100,100,99,98)
447 ----
448 idx
449 xx> 100 (id=1)
450 > 100 (id=2)
451 x> 99 (id=3)
452 > 98 (id=4)
453 99
454
455 committed cfg=(1,2,3) cfgj=(2,3,4) idx=(100,_,_,101)
456 ----
457 idx
458 xx> 100 (id=1)
459 ? 0 (id=2)
460 ? 0 (id=3)
461 xxx> 101 (id=4)
462 0
463
464 committed cfg=(1,2,3) cfgj=(2,3,4) idx=(100,99,_,101)
465 ----
466 idx
467 xx> 100 (id=1)
468 x> 99 (id=2)
469 ? 0 (id=3)
470 xxx> 101 (id=4)
471 99
472
473 # Identical. This is also exercised in the test harness, so it's listed here
474 # only briefly.
475 committed cfg=(1,2,3) cfgj=(1,2,3) idx=(50,45,_)
476 ----
477 idx
478 xx> 50 (id=1)
479 x> 45 (id=2)
480 ? 0 (id=3)
481 45