-
Notifications
You must be signed in to change notification settings - Fork 160
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
What operations can run at the same time ? #1130
Comments
👋 Thanks for opening this issue! Get help or engage by:
|
The operations involving writing, such as installing the state machine and applying a log, necessitate an exclusive reference to the state machine. This requirement is evident in the method signatures that use https://github.com/datafuselabs/openraft/blob/5851fd69b4b06e9b14378b02cba59ed83c7a573c/openraft/src/storage/v2.rs#L237-L238 However, read operations like building a snapshot only require a snapshot view of the state machine. This snapshot view effectively creates a consistent point-in-time representation of the state machine, allowing it to be accessed concurrently with write operations. This concurrent accessibility is crucial for efficiency, especially in high-throughput environments. Previously, in issue #1121, the snapshot building operation incorrectly used a mutex to block other write operations. The main issue was that the mutex wasn't held long enough, leading to potential race conditions. All state-machine-related operations have moved to a separate task(in 0.9* and main), ensuring that such operations do not block the main task, However, as of the latest published version (0.9*) and the main branch, operations related to the raft log are still executed within the |
Ty for the explation, I will be closing the issue |
What kind of doc do you ask for?
Describe the information you want
What operations can run simultanously ? I would specially like to know if
RaftStateMachine::apply
run at the same time asRaftStateMachine::install_snapshot
orRaftSnapshotBuilder::build_snapshot
.Looking at the issues I found this one, #1121, so it seems that
RaftStateMachine::install_snapshot
andRaftSnapshotBuilder::build_snapshot
can run at the same time.If they can run at the same time, there is any rule to which should be prioritized ? I would imagine
RaftStateMachine::install_snapshot
, since it usually means that the Learner/Follower is lagging behind, but it's just a guess.Also almost 2 years ago I oppened this issue, #507 (comment) and @drmingdrmer said:
Is this still true ?
Describe the status of the current doc
Is there any doc yet?
What other information should be added?
I'll open a pull request for it:)
The text was updated successfully, but these errors were encountered: