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

an issue from async-raft #911

Closed
pfwang80s opened this issue Oct 17, 2023 · 4 comments
Closed

an issue from async-raft #911

pfwang80s opened this issue Oct 17, 2023 · 4 comments

Comments

@pfwang80s
Copy link
Contributor

how to repro:

  1. start a single node 0 cluster
  2. add non-vote node 1 to the cluster
  3. add non-vote node 2 to the cluster
  4. change membership {0, 1, 2}, now all these 3 nodes are in one cluster
  5. kill node 0, the leader
  6. a lot of "ERROR async_raft::replication: error sending AppendEntries RPC to target" errors are issued on node 1 or 2.
  7. connect to the new leader, change membership to {1, 2} to evict node 0, but 6 still continues

it seems there is a ReplicationStream to node 0 after step 7, it runs forever as RaftNetwork.append_entries to node 0 returns an network error, but target_state of it is not updated, check async-raft/src/replication/mod.rs:223.

Does openraft have the same problem?

thanks.

@github-actions
Copy link

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

@drmingdrmer
Copy link
Member

Yes Openraft has fixed this issue.

Every time replication changes, such as leader establish or quit, or membership change, the replication stream will be completely shutdown and restart again. All replication update is dealt with here:

Command::RebuildReplicationStreams { targets } => {
self.remove_all_replication().await;
for (target, matching) in targets.iter() {
let handle = self.spawn_replication_stream(*target, *matching).await;
if let Some(l) = &mut self.leader_data {
l.replications.insert(*target, handle);
} else {
unreachable!("it has to be a leader!!!");
}
}
}

@pfwang80s
Copy link
Contributor Author

I do love OpenRaft now, thank you very much~

@pfwang80s
Copy link
Contributor Author

issue closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants