-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Allow relocating shard between nodes in same host #11404
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: chenweiguo.vc <[email protected]>
Signed-off-by: chenweiguo.vc <[email protected]>
Signed-off-by: chenweiguo.vc <[email protected]>
❌ Gradle check result for 368ba61: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 0b55aaa: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Compatibility status:Checks if related components are compatible with change e0dc0ef Incompatible componentsIncompatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/cross-cluster-replication.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/alerting.git] |
❌ Gradle check result for e0dc0ef: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
@shwetathareja May I get some attention from you to CR this? |
@@ -94,6 +95,8 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing | |||
return decision; | |||
} | |||
if (node.node() != null) { | |||
DiscoveryNode sourceShardNode = allocation.nodes().get(shardRouting.currentNodeId()); |
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.
canAllocate method is triggered for unassigned shards and currentNodeId would be null for those cases. To shard relocating scenarios, you should override canMoveAway or canRebalance methods, thoughts?
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.
canAllocate
will always be triggered before allocate shard to a target node, including new shard allocation and shard relocation scenarios. As for canMoveAway
and canRebalance
, they determine whether a shard can be move away from the current node. The SameShardAllocationDecider only takes effect when the target node is determined.
This PR is stalled because it has been open for 30 days with no activity. |
This PR is stalled because it has been open for 30 days with no activity. |
Description
When
cluster.routing.allocation.same_shard.host
is set true, relocating shard between nodes in same host is not allowed. This PR allows this type of relocation.Related Issues
Resolves #11438
Check List
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.