-
Notifications
You must be signed in to change notification settings - Fork 25.6k
allocation: clarify RestoreInProgressAllocationDecider failure message #132307
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
Changes from 3 commits
e419a24
2936779
a60a2a2
9920308
0a18d5a
9ec98a1
b2cf46c
b099f5d
0bc74d5
f277ecb
829304a
168d94b
be39016
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| import org.elasticsearch.cluster.routing.RecoverySource; | ||
| import org.elasticsearch.cluster.routing.RoutingNode; | ||
| import org.elasticsearch.cluster.routing.ShardRouting; | ||
| import org.elasticsearch.cluster.routing.UnassignedInfo; | ||
| import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; | ||
|
|
||
| /** | ||
|
|
@@ -49,14 +50,30 @@ public Decision canAllocate(final ShardRouting shardRouting, final RoutingAlloca | |
| return allocation.decision(Decision.YES, NAME, "shard is currently being restored"); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * POST: the RestoreInProgress.ShardRestoreStatus is either failed or succeeded. This section turns a | ||
| * turn a shard failure into a NO decision to allocate. See {@link AllocationService.applyFailedShards} | ||
| * for details on how it updates UnassignedInfo. | ||
| */ | ||
| UnassignedInfo unassignedInfo = shardRouting.unassignedInfo(); | ||
| if (unassignedInfo.failedAllocations() > 0) { | ||
|
Comment on lines
+60
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looking good, matches with what David said in the #100233 |
||
| return allocation.decision( | ||
| Decision.NO, | ||
| NAME, | ||
| "shard has failed to be restored from the snapshot [%s] - manually close or delete the index [%s] in order to retry " | ||
| + "to restore the snapshot again or use the reroute API to force the allocation of an empty primary shard. Check the " | ||
| + "logs for more information about the failure. Details: [%s]", | ||
| source.snapshot(), | ||
| shardRouting.getIndexName(), | ||
| unassignedInfo.details() | ||
| ); | ||
| } | ||
|
|
||
| return allocation.decision( | ||
| Decision.NO, | ||
| Decision.YES, | ||
schase-es marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| NAME, | ||
| "shard has failed to be restored from the snapshot [%s] - manually close or delete the index [%s] in order to retry " | ||
| + "to restore the snapshot again or use the reroute API to force the allocation of an empty primary shard. Details: [%s]", | ||
| source.snapshot(), | ||
| shardRouting.getIndexName(), | ||
| shardRouting.unassignedInfo().details() | ||
| "shard was prevented from being allocated on all nodes because of other allocation deciders" | ||
|
||
| ); | ||
| } | ||
|
|
||
|
|
||
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.
"turns a turn a shard..." typo in javadoc?