Commit 22b272c
Alex Valiushko
Newly added followers do not participate in quorum until they catch up with the log
An opt-in ability of a cluster to ignore newly joined member until it catches
up with the log:
New = #{id => Id, ini_non_voter => ra:new_nvid()},
{ok, _, _} = ra:add_member(ServerRef, New),
ok = ra:start_server(default, ClusterName, New, add_machine(), [ServerRef]),
Voter status is stored in the cluster map of the server state and is part of
every $ra_cluster_update. Additionally, nodes store their own status at the top
level for ease of matching. Nodes also store their own satus in ra_state ETS
table (breaking change), and present in overview.
On every #append_entries_reply leader may choose to promote non-voter by
issuing new `$ra_join` with desired voter status. Currently, only one promotion
condition is implemented `{nonvoter, #{target := ra_index()}`. Non-voter will
be promoted when it reaches the leaders log index at the time of joining.1 parent 08bfcc4 commit 22b272c
File tree
11 files changed
+735
-66
lines changed- src
- test
11 files changed
+735
-66
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
455 | 456 | | |
456 | 457 | | |
457 | 458 | | |
458 | | - | |
| 459 | + | |
459 | 460 | | |
460 | 461 | | |
461 | 462 | | |
| |||
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
473 | | - | |
| 474 | + | |
474 | 475 | | |
475 | 476 | | |
476 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
477 | 480 | | |
478 | 481 | | |
479 | 482 | | |
480 | | - | |
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
484 | 486 | | |
485 | | - | |
| 487 | + | |
486 | 488 | | |
487 | 489 | | |
488 | 490 | | |
| |||
558 | 560 | | |
559 | 561 | | |
560 | 562 | | |
561 | | - | |
| 563 | + | |
562 | 564 | | |
563 | | - | |
| 565 | + | |
| 566 | + | |
564 | 567 | | |
565 | 568 | | |
566 | 569 | | |
| |||
571 | 574 | | |
572 | 575 | | |
573 | 576 | | |
574 | | - | |
| 577 | + | |
| 578 | + | |
575 | 579 | | |
576 | 580 | | |
577 | 581 | | |
| |||
580 | 584 | | |
581 | 585 | | |
582 | 586 | | |
583 | | - | |
584 | 587 | | |
585 | 588 | | |
586 | 589 | | |
| |||
716 | 719 | | |
717 | 720 | | |
718 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
719 | 729 | | |
720 | 730 | | |
721 | 731 | | |
| |||
1132 | 1142 | | |
1133 | 1143 | | |
1134 | 1144 | | |
1135 | | - | |
| 1145 | + | |
| 1146 | + | |
1136 | 1147 | | |
1137 | 1148 | | |
1138 | 1149 | | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1142 | 1155 | | |
1143 | 1156 | | |
1144 | 1157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
51 | 68 | | |
52 | 69 | | |
| 70 | + | |
| 71 | + | |
53 | 72 | | |
54 | 73 | | |
55 | 74 | | |
| |||
139 | 158 | | |
140 | 159 | | |
141 | 160 | | |
| 161 | + | |
142 | 162 | | |
143 | 163 | | |
144 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
179 | 183 | | |
180 | 184 | | |
| 185 | + | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
185 | | - | |
| 190 | + | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| 647 | + | |
647 | 648 | | |
648 | 649 | | |
649 | 650 | | |
| |||
0 commit comments