Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

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

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
@DaveCTurner DaveCTurner added >bug :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v7.2.0 v7.0.1 labels Apr 10, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@DaveCTurner
Copy link
Contributor Author

I will forward-port the relevant part of this test to master in a followup.

Copy link
Contributor

@henningandersen henningandersen left a 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");
Copy link
Contributor

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?

Copy link
Contributor Author

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()
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done in 1dfd207.

@DaveCTurner DaveCTurner merged commit 10e5821 into elastic:7.x Apr 16, 2019
@DaveCTurner DaveCTurner deleted the 2019-04-10-validate-cluster-uuid-with-legacy-join-validation branch April 16, 2019 11:49
DaveCTurner added a commit that referenced this pull request Apr 16, 2019
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
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Apr 16, 2019
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
DaveCTurner added a commit that referenced this pull request Apr 16, 2019
This is a forward-port of parts of #41063 to `master`, adding a test to show
that join validation does indeed verify that the cluster UUIDs match.

Relates #37775
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v7.0.1 v7.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants