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

Improve cluster update settings api #6244

Conversation

martijnvg
Copy link
Member

  • If the minimum master nodes has been breached the reroute shouldn't be executed
  • Cluster update settings call should also return in case of failures during the reroute.

@@ -116,6 +116,11 @@ public void onAckTimeout() {
}

private void reroute(final boolean updateSettingsAcked) {
if (!clusterService.state().nodes().localNodeMaster()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add a comment about min master nodes causing current node not to be master...

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the PR with a commit

@bleskes
Copy link
Contributor

bleskes commented May 20, 2014

LGTM. Left one comment. I also think we can improve a bit the description of the PR (cluster update settings may not return on reroute failure etc.)

@@ -150,6 +155,7 @@ public TimeValue timeout() {
public void onFailure(String source, Throwable t) {
//if the reroute fails we only log
logger.debug("failed to perform [{}]", t, source);
listener.onFailure(t);
Copy link
Member

Choose a reason for hiding this comment

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

good catch! not 100% sure we should fail the whole request though, as the actual cluster update settings went well, although the following cluster reroute failed. The settings have effectively been applied...maybe we should return them doing something like this:

listener.onResponse(new ClusterUpdateSettingsResponse(transientUpdates.build(), persistentUpdates.build()));

But then we would not return any error and only log it...

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should inform the caller that there was an error, if it fails here something doesn't add up. We can wrap it in another description that has a message indicating that only the reroute after update cluster settings update failed.

Copy link
Member

Choose a reason for hiding this comment

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

I agree we should return the error as something wrong happened. But this way we miss returning the settings that have been changed. The cluster update settings call had an effect although we return an error, which is misleading. The problem is we cant return both an error and the settings that have changed...

@javanna
Copy link
Member

javanna commented May 20, 2014

Left one comment as well, agreed on improving the description of the PR. BTW I think the call would return in case of failure, but only after the ack timeout (with acknowledged flag set to false).

…ecuted and if that isn't the case skip reroute

Invoke listener when reroute fails.
@martijnvg martijnvg closed this in 9494bbd May 20, 2014
martijnvg added a commit that referenced this pull request May 20, 2014
…ecuted and if that isn't the case skip reroute

Invoke listener when reroute fails.

Closes #6244
@s1monw s1monw removed the review label Jun 18, 2014
@clintongormley clintongormley changed the title Improve cluster update settings api Admin: Improve cluster update settings api Jul 16, 2014
@martijnvg martijnvg deleted the improvements/update_cluster_settings branch May 18, 2015 23:31
@clintongormley clintongormley changed the title Admin: Improve cluster update settings api Improve cluster update settings api Jun 7, 2015
@clintongormley clintongormley added :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. and removed :Cluster labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. >enhancement v1.3.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants