-
Notifications
You must be signed in to change notification settings - Fork 406
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
Why do we need to lock? #558
Comments
Lock is not required. |
If Lock is not required then why do you use
What does it explain? I have checked another implementation of the Raft (openraft), they also use |
As far as I understand each node has its own log storage. Suppose a leader has been elected, and nodes starts to communicate. I also know that nodes constantly read from their log storage and update their log storage (execute command, etc). So, don't we need to synchronise log storage updates? |
In Rust, you should utilize
That's not what raft-rs concerns. Raft-rs focus on the algorithm part, other side effects like sending messages, persisting logs and replaying logs are exposed to application via |
Thanks, got you. I think it'd be very helpful if you could put more explanation regarding what part of raft you implement and what part is up to client. :-) As far as I understand the algorithm, storing in logs and reading from logs ARE also a part of the raft algorithm. I don’t think it is optional and application specific. I have been exploring both rust implementations (especially docs and examples), at this point I have decided that implementing myself from scratch would be easier than trying to understand your implementations and “examples”. Sad but true. In fact this is the case with entire Rust ecosystem. 😢 |
Hi! I don't understand why we need to wrap the core storage inside
Arc<RwLock<>>
(in MemStorage example). I do understand whatArc
andRwLock
do, locking and exclusive write access, etc, (so no need explanation), but why do we need an exclusive access? Doesn't each node have its own log storage? Or do nodes may access their log storage asynchronously from a several threads simultaneously?The text was updated successfully, but these errors were encountered: