-
Notifications
You must be signed in to change notification settings - Fork 113
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
Fixes shrink action shard allocation checks #335
Conversation
Signed-off-by: Clay Downs <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #335 +/- ##
============================================
- Coverage 75.53% 75.28% -0.25%
+ Complexity 2134 2111 -23
============================================
Files 260 260
Lines 12332 12341 +9
Branches 1937 1942 +5
============================================
- Hits 9315 9291 -24
- Misses 1963 1989 +26
- Partials 1054 1061 +7
Continue to review full report at Codecov.
|
Test and build workflow CI failure was due to unrelated flaky test |
var numShardsInSync = 0 | ||
for (shard: ShardStats in response.shards) { | ||
val routingInfo = shard.shardRouting | ||
val nodeIdShardIsOn = routingInfo.currentNodeId() | ||
val nodeNameShardIsOn = context.clusterService.state().nodes()[nodeIdShardIsOn].name | ||
if (nodeNameShardIsOn.equals(nodeToMoveOnto) && routingInfo.started()) { | ||
shardIdOnNode[shard.shardRouting.id] = true | ||
} |
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.
Put a note here, we want to extract below if (routingInfo.primary())
block into a function checkReplicaInSync
for readability.
Signed-off-by: Clay Downs <[email protected]>
Signed-off-by: Clay Downs [email protected]
Issue #, if available:
NA
Description of changes:
There were a few issues with Shrink shard allocation which would cause failures when shrinking indices with replicas:
explanation=a copy of this shard is already allocated to this node
. To fix this, this PR only creates an allocation dry run request for one random shard copy for each shard.explanation=a copy of this shard is already allocated to this node
. To fix this, this PR checks if any copy of the shard is present on the target node to initiate a request.CheckList:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.