-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Allow CCR on nodes with legacy roles only #60093
Conversation
Pinging @elastic/es-distributed (:Distributed/CCR) |
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.
Does it work out if instead in the CCR primary allocation decider, we tactically make this assumption there about old nodes (node.node().getVersion()
)?
@elasticmachine run elasticsearch-ci/2 |
The concern I have with this approach is that it assumes the role is held, even for nodes that have |
@jasontedor Thank you for your feedback. I've pushed c75f661. Can you take another look? |
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.
I left a few comments.
clusterState, | ||
((Predicate<DiscoveryNode>) DiscoveryNode::isDataNode).and(DiscoveryNode::isRemoteClusterClient) | ||
node -> node.isDataNode() && (node.isRemoteClusterClient() || node.getVersion().before(DiscoveryNode.PLUGGABLE_ROLES_VERSION)) |
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.
Assigning to a node that is a data node but before version 7.3.0 could still fail (if the node doesn't have the remote cluster client role). I wonder if we should implement this as a last resort? So try to select the least loaded node that is a data node and is a remote cluster client. If that doesn't turn up any nodes, try to assign to a node that is a data node and is before the version that we formalized the remote cluster client role. Note that that is a different version than when we made roles pluggable.
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.
return allocation.decision(Decision.YES, NAME, | ||
"shard is a primary follower and node has the " + DiscoveryNodeRole.REMOTE_CLUSTER_CLIENT_ROLE.roleName() + " role"); | ||
} | ||
if (node.node().getVersion().before(DiscoveryNode.PLUGGABLE_ROLES_VERSION)) { |
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.
I wonder if this should be the version that we introduced the remote cluster client role in as opposed to the version that we made node roles pluggable.
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.
Good catch, fixed in 3a33f0a
This reverts commit fda3927.
@jasontedor Thanks for reviewing. Would you mind taking another look? |
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.
This looks good to me now. Thanks for the iterations @dnhatn.
Thanks Jason! |
CCR will stop functioning if the master node is on 7.8, but data nodes are before that version because the master node considers that all data nodes do not have the remote cluster client role. This commit allows CCR work on data nodes with legacy roles only.
Relates #54146
Relates #59375