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

Don't join master nodes or accept join requests of old and too new nodes #11972

Merged
merged 1 commit into from Jul 2, 2015

Conversation

martijnvg
Copy link
Member

If the version of a node is lower than the minimum supported version or higher than the maximum hypothetical supported version, a node shouldn't be allowed to join and nodes should join that elected master node

Closes #11924

@martijnvg martijnvg added >enhancement v2.0.0-beta1 review :Distributed/Discovery-Plugins Anything related to our integration plugins with EC2, GCP and Azure labels Jul 1, 2015
@bleskes bleskes self-assigned this Jul 1, 2015
Settings nodeSettings = Settings.settingsBuilder()
.put("discovery.type", "zen") // <-- To override the local setting if set externally
.build();
String nodeName = internalCluster().startNode(nodeSettings, Version.V_1_6_0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder how long this would work ;)

@bleskes
Copy link
Contributor

bleskes commented Jul 2, 2015

Left some comments..

@martijnvg
Copy link
Member Author

@bleskes thanks for the feedback! I updated the PR. Instead of moving the version check to findMaster(), I moved it to ElectMasterService#electMaster(), so the check doesn't need to get duplicated multiple times.


if (!transportService.addressSupported(node.address().getClass())) {
// TODO, what should we do now? Maybe inform that node that its crap?
logger.warn("received a wrong address type from [{}], ignoring...", node);
} else {
// Sanity checks: likely we don't end up here, because serialization is likely to fail.
Copy link
Contributor

Choose a reason for hiding this comment

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

why is serailization likely to fail? it might, it might not...

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe my choice of wording here... I'll change it to: we may not end up here.....

@bleskes
Copy link
Contributor

bleskes commented Jul 2, 2015

Thx @martijnvg . I left some minor comments.

@martijnvg
Copy link
Member Author

@bleskes cool, I've updated the PR.

@martijnvg
Copy link
Member Author

@bleskes I change ElectMasterService instance to be managed by ZenDiscovery. I'm not happy about it, because it used by ZenPingService (which is injected by ZenDiscovery too). I made this work by making ZenPingService#sortByMasterLikelihood() static.

@martijnvg
Copy link
Member Author

@bleskes I reverted the previous commit and let ZenDiscovery get the current version from the local node.

@@ -886,12 +890,20 @@ static boolean shouldIgnoreOrRejectNewClusterState(ESLogger logger, ClusterState
}
}

private void handleJoinRequest(final DiscoveryNode node, final MembershipAction.JoinCallback callback) {
void handleJoinRequest(final DiscoveryNode node, final MembershipAction.JoinCallback callback) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this can go back to private now, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

true

Copy link
Member Author

Choose a reason for hiding this comment

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

oops... no, because it is used in a test (ZenDiscoveryTests#testHandleNodeJoin_incompatibleMinVersion)

@bleskes
Copy link
Contributor

bleskes commented Jul 2, 2015

LGTM. Left a couple of trivial comments. No need for another review.

…ew nodes.

If the version of a node is lower than the minimum supported version or higher than the maximum supported version, a node shouldn't be allowed to join and nodes should join that elected master node

Closes elastic#11924
@martijnvg martijnvg merged commit a4b99e6 into elastic:master Jul 2, 2015
@kevinkluge kevinkluge removed the review label Jul 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Discovery-Plugins Anything related to our integration plugins with EC2, GCP and Azure >enhancement v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants