joint_commit.txt 9.0 KB

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