Allow entries to apply during snapshot#86
Merged
willemt merged 1 commit intowillemt:masterfrom Aug 15, 2018
Merged
Conversation
Owner
|
That makes a lot of sense. For example, you could isolate a key value store FSM when it's being snapshotted by iterating over the keys and being aware of log entries setting values. However, I like that the default behaviour is so strict. It makes it easier to not break things. Therefore I think a good way to allow this is by adding flags to #define RAFT_SNAPSHOT_NONBLOCKING_APPLY 1
int raft_begin_snapshot(raft_server_t *me_, int flags); |
If specified when calling raft_begin_snapshot(), the library will not postpone applying entries during snapshots. This requires the FSM to provide full isolation between the snapshot and active state.
Owner
|
Good optimisation for FSMs that can use this |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently
raft_apply_entry()andraft_apply_all()will avoid applying entries if a snapshot is in progress. Assuming the FSM is able to provide the proper isolation, I don't see any real reason to prevent this in the library but @willemt perhaps you do?This requires care in maintaining the different indexes, but we anyway must assume the commit index can advance during snapshots (see #84 for example).