Commit 69ff59e
authored
NRG: Campaign early unless already candidate (#6511)
If an outdated server wants to become leader, other servers can
recognize they have a more up-to-date and start campaigning early to
speed up the leader election process.
However, if two servers would both become candidate at the same time due
to this, and one of the candidate's log is slightly more ahead it would
again start campaigning early. This can essentially short-circuit the
voting process, starting a new leader election/term while that wouldn't
be necessary to do. That ahead candidate could just reject the vote for
the other candidate, and wait for successful votes for itself to come
in.
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>2 files changed
Lines changed: 58 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4138 | 4138 | | |
4139 | 4139 | | |
4140 | 4140 | | |
4141 | | - | |
4142 | | - | |
4143 | | - | |
4144 | | - | |
4145 | | - | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
4146 | 4145 | | |
4147 | 4146 | | |
4148 | 4147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
529 | 583 | | |
530 | 584 | | |
531 | 585 | | |
| |||
0 commit comments