Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ViggoC
Copy link
Contributor

@ViggoC ViggoC commented Nov 30, 2023

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

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

Signed-off-by: chenweiguo.vc <[email protected]>
Signed-off-by: chenweiguo.vc <[email protected]>
Copy link
Contributor

❌ 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?

Copy link
Contributor

❌ 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?

Copy link
Contributor

github-actions bot commented Nov 30, 2023

Compatibility status:

Checks if related components are compatible with change e0dc0ef

Incompatible components

Incompatible 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 components

Compatible components

Compatible 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]

Copy link
Contributor

❌ 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?

@github-actions github-actions bot added the enhancement Enhancement or improvement to existing feature or request label Dec 4, 2023
@ViggoC
Copy link
Contributor Author

ViggoC commented Dec 13, 2023

@shwetathareja May I get some attention from you to CR this?

@ViggoC ViggoC changed the title Support relocating shard between nodes in same host Allow relocating shard between nodes in same host Dec 26, 2023
@@ -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());
Copy link
Member

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?

Copy link
Contributor Author

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.

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Jan 27, 2024
@shwetathareja shwetathareja removed the stalled Issues that have stalled label Feb 6, 2024
@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cluster Manager enhancement Enhancement or improvement to existing feature or request stalled Issues that have stalled
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Allow relocating shard between nodes in same host
2 participants