-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Validate cluster UUID when joining Zen1 cluster #41063
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
Validate cluster UUID when joining Zen1 cluster #41063
Conversation
Today we fail to join a Zen2 cluster if the cluster UUID does not match our own, but we do not perform the same validation when joining a Zen1 cluster. This means that a Zen2 node will pass join validation and be added to a Zen1 cluster but will reject all cluster states from the master. Relates elastic#37775
Pinging @elastic/es-distributed |
I will forward-port the relevant part of this test to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks @DaveCTurner , I added two optional comments to consider.
localState.metaData().clusterUUID().equals(request.getState().metaData().clusterUUID()) == false) { | ||
throw new CoordinationStateRejectedException("join validation on cluster state" + | ||
" with a different cluster uuid " + request.getState().metaData().clusterUUID() + | ||
" than local cluster uuid " + localState.metaData().clusterUUID() + ", rejecting"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add a zen1 marker to the message to aid in debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I added mixed-version cluster
to the Zen1 case.
transportService.acceptIncomingRequests(); | ||
|
||
{ | ||
final ClusterState otherClusterState = ClusterState.builder(ClusterName.DEFAULT).metaData(MetaData.builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two blocks for zen1 and zen2 are identical except for the action name, I would prefer to extract the method to make this clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done in 1dfd207.
Today we fail to join a Zen2 cluster if the cluster UUID does not match our own, but we do not perform the same validation when joining a Zen1 cluster. This means that a Zen2 node will pass join validation and be added to a Zen1 cluster but will reject all cluster states from the master. Relates #37775
This is a forward-port of parts of elastic#41063 to `master`, adding a test to show that join validation does indeed verify that the cluster UUIDs match. Relates elastic#37775
This is a forward-port of parts of elastic#41063 to `master`, adding a test to show that join validation does indeed verify that the cluster UUIDs match. Relates elastic#37775
Today we fail to join a Zen2 cluster if the cluster UUID does not match our
own, but we do not perform the same validation when joining a Zen1 cluster.
This means that a Zen2 node will pass join validation and be added to a Zen1
cluster but will reject all cluster states from the master.
Relates #37775