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

How do I use the ConfChangeType::AddLearnerNode in propose_conf_change? #488

Open
pidb opened this issue Sep 28, 2022 · 4 comments
Open

Comments

@pidb
Copy link

pidb commented Sep 28, 2022

Specifically, I want to add a node to the raft group first. But I first add a learner node, and then when the log of the learner node is up-to-date, I make it become the voter.

I see the ConfChangeType::AddLearnerNode in this library, but I'm so sorry because I'm not sure how to use it.

Or the library itself implement the steps I've described? As long as I use ConfChangeType::AddNode. 😂

@BusyJay
Copy link
Member

BusyJay commented Sep 28, 2022

You need to add the learner first by using ConfChangeType::AddLearnerNode, and then promote it to voter using ConfChangeType::AddNode. Adding a learner is similar with add a node.

@pidb
Copy link
Author

pidb commented Sep 28, 2022

You need to add the learner first by using ConfChangeType::AddLearnerNode, and then promote it to voter using ConfChangeType::AddNode. Adding a learner is similar with add a node.

Thanks for your reply. I wonder what is the time to promote voter? In other words, Do I need to maintain the log status of learner myself, and when it log up-to-date as the leader, create a ConfChangeType::AddNode to promote it as a voter?

@BusyJay
Copy link
Member

BusyJay commented Sep 29, 2022

Raft maintain the progress in leader, which can be query by status API. You may also want to check out #457.

@pidb
Copy link
Author

pidb commented Sep 29, 2022

Raft maintain the progress in leader, which can be query by status API. You may also want to check out #457.

Thanks for your reply. That was great!

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