Skip to content

Conversation

@guojialiang92
Copy link
Contributor

Description

This PR reproduced the issue (#[13429]) in Test SegmentReplicationAllocationIT#testSingleIndexShardAllocation. Without this fix, the test will fail consistently.

This issue was raised a year ago but has never been fixed. We also encountered the same issue in the segment replication scenario with primary shard balance enabled, and have fixed it.

Related Issues

Resolves #[13429]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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: guojialiang <guojialiang.2012@bytedance.com>
@guojialiang92 guojialiang92 requested a review from a team as a code owner August 11, 2025 17:04
@github-actions
Copy link
Contributor

✅ Gradle check result for f57aadd: SUCCESS

@codecov
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.06%. Comparing base (006a53f) to head (af9a7d6).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19012      +/-   ##
============================================
+ Coverage     73.05%   73.06%   +0.01%     
- Complexity    70627    70639      +12     
============================================
  Files          5723     5723              
  Lines        323489   323493       +4     
  Branches      46851    46851              
============================================
+ Hits         236311   236368      +57     
+ Misses        68174    68057     -117     
- Partials      19004    19068      +64     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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 stalled Issues that have stalled and removed stalled Issues that have stalled labels Sep 11, 2025
@github-actions
Copy link
Contributor

❌ Gradle check result for 17a9dd3: 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?

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
@github-actions
Copy link
Contributor

❕ Gradle check result for 72ab29b: 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.

Copy link
Contributor

@kkewwei kkewwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, there are no major issues. There's a minor point to consider: should we add unit tests in BalancedShardsAllocatorTests, or would it be more appropriate to add them in LocalShardsBalancerTests?

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

✅ Gradle check result for af9a7d6: SUCCESS

@kkewwei kkewwei merged commit 5034d5d into opensearch-project:main Oct 10, 2025
33 checks passed
rgsriram pushed a commit to rgsriram/OpenSearch that referenced this pull request Oct 11, 2025
…incorrectly reset (opensearch-project#19012)

* fix primary balance strategy unset

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

* Add change log

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

* refactor

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

* refactor

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

* refactor

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

---------

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Oct 15, 2025
…incorrectly reset (opensearch-project#19012)

* fix primary balance strategy unset

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

* Add change log

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

* refactor

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

* refactor

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

* refactor

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>

---------

Signed-off-by: guojialiang <guojialiang.2012@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants