Skip to content
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

[server] Add cluster election #1225 #1230

Merged
merged 22 commits into from
Sep 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update cluster.rs
michaelvlach committed Sep 5, 2024
commit 4400c16cf9b321bde80670e14ae602369d92590f
3 changes: 1 addition & 2 deletions agdb_server/src/cluster.rs
Original file line number Diff line number Diff line change
@@ -254,9 +254,8 @@ async fn election(cluster: &Cluster) -> ServerResult<()> {

{
let mut data = cluster.data.write().await;
data.state = ClusterState::Candidate;
election_term = data.term + 1;
data.term = election_term;
data.state = ClusterState::Candidate;
data.voted = election_term;
}

Loading