-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change: RaftStorage::get_log_state() returns last purge log id
- Change: `get_log_state()` returns the `last_purged_log_id` instead of the `first_log_id`. Because there are some cases in which log are empty: When a snapshot is install that covers all logs, or when `max_applied_log_to_keep` is 0. Returning `None` is not clear about if there are no logs at all or all logs are deleted. In such cases, raft still needs to maintain log continuity when repilcating. Thus the last log id that once existed is important. Previously this is done by checking the `last_applied_log_id`, which is dirty and buggy. Now an implementation of `RaftStorage` has to maintain the `last_purged_log_id` in its store. - Change: Remove `first_id_in_log()`, `last_log_id()`, `first_known_log_id()`, because concepts are changed. - Change: Split `delete_logs()` into two method for clarity: `delete_conflict_logs_since()` for deleting conflict logs when the replication receiving end find a conflict log. `purge_logs_upto()` for cleaning applied logs - Change: Rename `finalize_snapshot_installation()` to `install_snapshot()`. - Refactor: Remove `initial_replicate_to_state_machine()`, which does nothing more than a normal applying-logs. - Refactor: Remove `enum UpdateCurrentLeader`. It is just a wrapper of Option.
- Loading branch information
1 parent
5cfbd54
commit a52a930
Showing
16 changed files
with
403 additions
and
513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.