Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Add support for removing nodes from the metadata store cluster #2531

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tillrohrmann
Copy link
Contributor

Removing nodes from the metadata store cluster is implemented by introducing
a transitional MetadataServerState::Leaving which tells the leader of the
metadata store cluster to remove the node which is Leaving. Only after the
configuration change has been committed and applied, the state will be set
to Outsider. If a node missed the configuration change but sees its state
in the NodesConfiguration switching to Outsider, it will stop Raft.

This PR sets the default MetadataServerState to Member so that newly added nodes will automatically try to join the existing metadata store cluster. Moreover, it adds a restatectl meta nodes add --id <NODE-ID> and restatectl meta nodes remove --id <NODE-ID> command to add/remove nodes manually.

cc @pcholakov

This allows users to manually add nodes to the metadata cluster.
Removing nodes from the metadata store cluster is implemented by introducing
a transitional MetadataServerState::Leaving which tells the leader of the
metadata store cluster to remove the node which is Leaving. Only after the
configuration change has been committed and applied, the state will be set
to Outsider. If a node missed the configuration change but sees its state
in the NodesConfiguration switching to Outsider, it will stop Raft.
By setting the default of MetadataServerState to Member, newly added Restate nodes
will try to join the metadata store cluster automatically.
Comment on lines +624 to +626
// we use the NodesConfiguration as the authoritative signal for leaving the cluster
let should_leave = my_node_config.metadata_server_config.metadata_server_state
== MetadataServerState::Outsider;
Copy link
Contributor Author

@tillrohrmann tillrohrmann Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that this won't reliably work in the case where the user removed the node and then shortly after added it back. If the node missed the actual configuration change and then reaches this point, it looks at the MetadataServerStatus and thinks that everything is ok. The problem is that w/o sending a join request, the current leader won't add this node back to the configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One idea for solving this problem could be to also introduce a transitional state for joining a cluster (similar to Leaving). That way, adding a node won't immediately set the state to Member and would tell a node which missed the configuration change to step down and rejoin.

@AhmedSoliman
Copy link
Contributor

Since this is parked. I'll remove myself as a reviewer until we want to discuss this design again.

@AhmedSoliman AhmedSoliman removed their request for review February 4, 2025 11:43
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

Successfully merging this pull request may close these issues.

2 participants