-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix getting replication type in NodeVersionAllocationDecider #12811
base: main
Are you sure you want to change the base?
Fix getting replication type in NodeVersionAllocationDecider #12811
Conversation
❌ Gradle check result for d1b71d2: 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 5c30a74 Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/sql.git] |
Signed-off-by: ludongyu <heidongjidian@163.com>
Signed-off-by: ludongyu <heidongjidian@163.com>
47434ca
to
5c30a74
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12811 +/- ##
============================================
- Coverage 71.42% 71.36% -0.06%
- Complexity 59978 60202 +224
============================================
Files 4985 5011 +26
Lines 282275 283557 +1282
Branches 40946 41089 +143
============================================
+ Hits 201603 202373 +770
- Misses 63999 64407 +408
- Partials 16673 16777 +104 ☔ View full report in Codecov by Sentry. |
❕ Gradle check result for 5c30a74: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
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.
Thanks for fixing this
Thanks for submitting the PR. I have a couple of questions:
|
|
This PR is stalled because it has been open for 30 days with no activity. |
I don't have the permission to edit the labels of this PR. This PR is not related to Remote Store, so the label should be removed. I am not familiar with choosing the release target label, maybe label v2.13.1 can be added ? |
Removed the storage label. If you are targeting v2.15 release(next release), we can add the 2.15 label |
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.
I think we need to add some integration test cases to make sure this allocation decider works in a real cluster, we may add more test cases to ClusterAllocationExplainIT
or SegmentReplicationAllocationIT
.
By the way, changelog is needed for this change.
|
||
@Override | ||
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { | ||
if (shardRouting.primary()) { | ||
IndexMetadata indexMd = allocation.metadata().getIndexSafe(shardRouting.index()); | ||
final ReplicationType replicationType = IndexMetadata.INDEX_REPLICATION_TYPE_SETTING.get(indexMd.getSettings()); | ||
if (replicationType == ReplicationType.SEGMENT) { |
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.
Could you help to check why the existing unit tests don't cover this case? I see there're some test cases may cover that but they worked fine, like testRebalanceDoesNotAllocatePrimaryOnHigherVersionNodesSegrepEnabled
and testRebalanceDoesNotAllocatePrimaryAndReplicasOnDifferentVersionNodes
.
@@ -671,6 +668,98 @@ public void testRebalanceDoesNotAllocatePrimaryOnHigherVersionNodesSegrepEnabled | |||
); | |||
} | |||
|
|||
public void testCanAllocatePrimaryOnHigherVersionNodesDocRepEnabled() { |
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.
Since SETTING_REPLICATION_TYPE setting defaults to document replication, so could you check if this new test case is duplicated with the existing test cases?
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. |
@KunjueYu can you check @gaobinlong 's comments and help take the PR to closure |
Description
This PR fix incorrect way of getting replication type from node settings in org.opensearch.cluster.routing.allocation.decider.NodeVersionAllocationDecider. Instead, we should get the replication type from index meta data. Besides, I add a test which verifies that the primary shard can be allocated to a node with higher version when replication type is document.
Related Issues
Resolves #12744
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.