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
Restore with wait_for_completion:true
should wait for succesfully restored shards to get started
#8545
Restore with wait_for_completion:true
should wait for succesfully restored shards to get started
#8545
Conversation
// Shard disappeared (index deleted) or became active | ||
if (shardRouting == null || shardRouting.active()) { | ||
iterator.remove(); | ||
logger.debug("[{}][{}] shard started - removing", request.snapshotId(), shardId); |
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.
shard started
is misleading if shardRouting == null
.
Left some minor comments. LGTM |
@@ -76,25 +75,26 @@ protected void masterOperation(final RestoreSnapshotRequest request, ClusterStat | |||
request.indices(), request.indicesOptions(), request.renamePattern(), request.renameReplacement(), | |||
request.settings(), request.masterNodeTimeout(), request.includeGlobalState(), request.partial(), request.includeAliases()); | |||
|
|||
restoreService.restoreSnapshot(restoreRequest, new RestoreSnapshotListener() { | |||
restoreService.restoreSnapshot(restoreRequest, new ActionListener<RestoreInfo>() { |
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.
unrelated but I think we should use DelegatingActionListener
here
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.
Hmm, I don't see how this is going to be useful delegated listener is not called every time and DelegatingActionListener
doesn't really provide a simple way to suppress calling onResponse
of the delegated listener when needed.
I left a couple of comments |
@imotov should this go into |
LGTM |
…or succesfully restored shards to get started This commit ensures that restore operation with wait_for_completion=true doesn't return until all successfully restored shards are started. Before it was returning as soon as restore operation was over, which cause some shards to be unavailable immediately after restore completion. Fixes elastic#8340
df0cc44
to
1aff863
Compare
wait_for_completion:true
should wait for succesfully restored shards to get started
This commit ensures that restore operation with wait_for_completion=true doesn't return until all successfully restored shards are started. Before it was returning as soon as restore operation was over, which cause some shards to be unavailable immediately after restore completion.
Fixes #8340