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: make node join safe. #837

Open
disksing opened this issue Nov 7, 2017 · 1 comment
Open

server: make node join safe. #837

disksing opened this issue Nov 7, 2017 · 1 comment
Labels
status/TODO The issue will be done in the future.

Comments

@disksing
Copy link
Contributor

disksing commented Nov 7, 2017

Now the node join process is:

  1. verify data dir is empty.
  2. verify self does not exists in member list.
  3. add self to member list by calling addMember.
  4. run server.

There is a potential risk if something goes wrong between step 3 and 4, then the new node is in member list, while data dir is still empty, so it will not be able to join. What's worse, if there is only 1 node before the join, the pd cluster will stop serving due to lack of online nodes.

@disksing disksing added the status/TODO The issue will be done in the future. label Nov 7, 2017
@siddontang
Copy link
Contributor

maybe the only way is to use two-phase when joining the cluster.

  1. touch a file
  2. add member
  3. remove the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/TODO The issue will be done in the future.
Projects
None yet
Development

No branches or pull requests

2 participants