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

Introduce a CLUSTER JOINSHARD primitive that allows admins to move nodes between shards #10935

Open
PingXie opened this issue Jul 4, 2022 · 0 comments

Comments

@PingXie
Copy link
Contributor

PingXie commented Jul 4, 2022

How about a JOINSHARD primitive? I think it makes more sense to expose a high level construct around shards, as opposed to letting admins manipulate the shard-id directly. Specifically, I propose the below:

A node N can explicitly join a shard S as identified by its <shard-id> via CLUSTER JOINSHARD <shard-id>

  • If shard S is not empty, N will try locating its primary P and initiate replication, as long as it sees one live node in S
  • otherwise, if all nodes in S are permanently down, N should attempt a manual failover
  • otherwise, there is no node in S and this means that the cluster is not aware of this shard at all. I'd propose we fail the JOINSHARD request.

For completeness, the following two have been implemented in this PR:

  1. A new node N always starts out in its own shard with an auto-generated shard-id
  2. A node N implicitly joins an existing shard via CLUSTER REPLICATE <primary-node-id>

Originally posted by @PingXie in #10536 (comment)

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

1 participant