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
Cancel recovery if shard on the target node closes during recovery operation #6645
Conversation
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 |
@bleskes I added a test that is likely to cancel an ongoing recovery. |
@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()) { |
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.
Nit picky: if we capture the node name from the start async we can do internalCluster().getInstance(DiscoveryNode.class, blueNodeName).id()
@bleskes Good points, I applied the feedback. |
LGTM! |
…e recovery operations. Closes elastic#6645
…e recovery operations. Closes #6645
Does this solve issue #6430 ? |
On the target side if the shard closes while recovery is in progress (e.g. files being transferred), the recovery operation should be cancelled.