Jing Yang
|
d63a5f1dcd
Minor refactor: election_time returns an Instant.
|
5 vuotta sitten |
Jing Yang
|
eed4e569f4
Reset the step counter when append entries succeeded.
|
5 vuotta sitten |
Jing Yang
|
cb7e82a666
Fix a race condition when killing the election timer.
|
5 vuotta sitten |
Jing Yang
|
599f453c6e
Set leader_id when elected.
|
5 vuotta sitten |
Jing Yang
|
d7d18284fa
Add the figure-8, unreliable test, and a serious bug fix.
|
5 vuotta sitten |
Jing Yang
|
93d36abc85
Add persister to lib, and tests.
|
5 vuotta sitten |
Jing Yang
|
fa74454870
Implement persister.
|
5 vuotta sitten |
Jing Yang
|
62a468ee3b
Add the basic agreement tests, fixed bugs.
|
5 vuotta sitten |
Jing Yang
|
6c6afbcde0
Fix step size overflow.
|
5 vuotta sitten |
Jing Yang
|
144224d107
Fix shutdown procedure.
|
5 vuotta sitten |
Jing Yang
|
ac213f6d53
Reserve vec with certain size instead of capacity.
|
5 vuotta sitten |
Jing Yang
|
1f41b2dae0
Correct is_leader check in append_entries and heartbeat.
|
5 vuotta sitten |
Jing Yang
|
e7fa862b50
Fix the timer never fires bug.
|
5 vuotta sitten |
Jing Yang
|
94ce80a793
Allow debugging all structs.
|
5 vuotta sitten |
Jing Yang
|
d637710470
Check one leader fails at initial election test.
|
5 vuotta sitten |
Jing Yang
|
3975600a33
Initial election test skeleton.
|
5 vuotta sitten |
Jing Yang
|
163b55487d
Refactor: using drop instead of scope.
|
5 vuotta sitten |
Jing Yang
|
275d0bedda
More clippy changes.
|
5 vuotta sitten |
Jing Yang
|
22fc247173
Use WaitGroup instead of Barrier to implement shutdown.
|
5 vuotta sitten |
Jing Yang
|
8aee179c10
Add a stop barrier.
|
5 vuotta sitten |
Jing Yang
|
8fb61b2fd0
Implement start() and kill()
|
5 vuotta sitten |
Jing Yang
|
3c225e7891
Lots of clippy changes.
|
5 vuotta sitten |
Jing Yang
|
1ba58689f2
Cancel the election if timer was changed more than once.
|
5 vuotta sitten |
Jing Yang
|
25e1c30f5c
Remove timer once fired.
|
5 vuotta sitten |
Jing Yang
|
e10b6ce01f
More refactor and more comments.
|
5 vuotta sitten |
Jing Yang
|
75806c9ee0
Refactor the timer thread.
|
5 vuotta sitten |
Jing Yang
|
18a98f3c27
Implement a timer version number for consistency.
|
5 vuotta sitten |
Jing Yang
|
69653dc5c8
Implement an election timer.
|
5 vuotta sitten |
Jing Yang
|
297ef1a2cf
Implement the initialization logic.
|
5 vuotta sitten |
Jing Yang
|
cf6b4dd415
Fix a few unused warnings.
|
5 vuotta sitten |