Fixed a flaky test in issue 19042#20270
Conversation
…nt on the replica in realtime translog, then stop the primary.Index doc 3 via client so the refresh happens on the promoted primary you are querying with _only_local. Signed-off-by: Joe Liu <guoqing4@illinois.edu>
WalkthroughA test method Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20270 +/- ##
============================================
- Coverage 73.20% 73.15% -0.05%
+ Complexity 71745 71697 -48
============================================
Files 5795 5795
Lines 328304 328304
Branches 47283 47283
============================================
- Hits 240334 240178 -156
- Misses 68663 68833 +170
+ Partials 19307 19293 -14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Fixed a flaky test
org.opensearch.indices.replication.MergedSegmentWarmerIT.testPrimaryStopped_ReplicaPromotedwhich is caused by a logic mismatch in the test: the comment says “index another doc but don’t refresh”, but the code does refresh doc 2 with RefreshPolicy.IMMEDIATE. With segment replication, that can turn into a race where the refreshed segment containing doc 2 is not guaranteed to be present on the replica at the moment the primary is stopped, so when the replica is promoted you end up with only docs 1 and 3.Related Issues
Resolves #19042
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.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.