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

Cancel recovery if shard on the target node closes during recovery operation #6645

Merged

Conversation

martijnvg
Copy link
Member

On the target side if the shard closes while recovery is in progress (e.g. files being transferred), the recovery operation should be cancelled.

@bleskes
Copy link
Contributor

bleskes commented Jun 30, 2014

LGTM - I would change the title of the PR to indicate this is about closing the shard on the target node. I was thinking how we can test it. Maybe a test that issues a relocation command, then overrides it with an allocation filtering rule. This will at least make sure the code kicks in every once in a while

@martijnvg martijnvg changed the title Cancel recovery if shard closes during recovery operation Cancel recovery if shard on the target node closes during recovery operation Jun 30, 2014
@martijnvg
Copy link
Member Author

@bleskes I added a test that is likely to cancel an ongoing recovery.

@bleskes
Copy link
Contributor

bleskes commented Jun 30, 2014

@martijnvg thx. Left some comments on the commit (sorry, notice too late it's not the PR)


ClusterStateResponse stateResponse = client().admin().cluster().prepareState().get();
String blueNodeId = null;
for (DiscoveryNode discoveryNode : stateResponse.getState().nodes()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit picky: if we capture the node name from the start async we can do internalCluster().getInstance(DiscoveryNode.class, blueNodeName).id()

@martijnvg
Copy link
Member Author

@bleskes Good points, I applied the feedback.

@bleskes
Copy link
Contributor

bleskes commented Jul 1, 2014

LGTM!

martijnvg added a commit that referenced this pull request Jul 1, 2014
@martijnvg martijnvg merged commit 5668b1c into elastic:master Jul 1, 2014
@martijnvg martijnvg changed the title Cancel recovery if shard on the target node closes during recovery operation Recovery: Cancel recovery if shard on the target node closes during recovery operation Jul 2, 2014
@magnhaug
Copy link

magnhaug commented Jul 5, 2014

Does this solve issue #6430 ?

@clintongormley clintongormley changed the title Recovery: Cancel recovery if shard on the target node closes during recovery operation Resiliency: Cancel recovery if shard on the target node closes during recovery operation Jul 16, 2014
@martijnvg martijnvg deleted the improvements/recovery_cancel_if_closed branch May 18, 2015 23:31
@clintongormley clintongormley added the :Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. label Jun 7, 2015
@clintongormley clintongormley changed the title Resiliency: Cancel recovery if shard on the target node closes during recovery operation Cancel recovery if shard on the target node closes during recovery operation Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. >enhancement resiliency v1.3.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants