-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimization: Cache replicated entries for faster lookup for applying to state machine. #12
Comments
I am currently working on this |
@MarinPostma awesome! Keep me posted. I am definitely of the opinion that we should use an async task to handle this responsibility. It can be owned by the RaftCore instance variants as needed. Happy to chat about implementation and design any time! |
I'm now hacking on this as I am blocked until its done, so it should be done quite soon |
Done. About to push/open PR. Hopefully will have a release out very soon. No API changes, so this will be a bug fix release. |
With this change, we are also caching entries which come from the leader replication protocol. As entries come in, we append them to the log and then cache the entry. When it is safe to apply entries to the state machine, we will take them directly from the in-memory cache instead of going to disk. Moreover, and most importantly, we are not longer blocking the AppendEntries RPC handler with the logic of the state machine replication workflow. There is a small amount of async task juggling to ensure that we don't run into situations where we would have two writers attempting to write to the state machine at the same time. This is easily avoided in our algorithm. closes #12 closes #76
With this change, we are also caching entries which come from the leader replication protocol. As entries come in, we append them to the log and then cache the entry. When it is safe to apply entries to the state machine, we will take them directly from the in-memory cache instead of going to disk. Moreover, and most importantly, we are not longer blocking the AppendEntries RPC handler with the logic of the state machine replication workflow. There is a small amount of async task juggling to ensure that we don't run into situations where we would have two writers attempting to write to the state machine at the same time. This is easily avoided in our algorithm. closes #12 closes #76
todo
The text was updated successfully, but these errors were encountered: