-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix flaky test SegmentReplicationTargetServiceTests.testStartReplicationListenerSuccess #17969
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
Conversation
…ionListenerSuccess Signed-off-by: guojialiang <[email protected]>
|
❕ Gradle check result for 33d99d6: 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17969 +/- ##
============================================
- Coverage 72.57% 72.49% -0.09%
+ Complexity 67066 67052 -14
============================================
Files 5470 5475 +5
Lines 309697 309925 +228
Branches 45045 45067 +22
============================================
- Hits 224776 224676 -100
- Misses 66602 66962 +360
+ Partials 18319 18287 -32 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: guojialiang <[email protected]>
|
❌ Gradle check result for 19a3440: 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 <[email protected]>
1302c08 to
9b38fbf
Compare
|
❌ Gradle check result for 3c14bc9: 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 <[email protected]>
3c14bc9 to
f0c47e7
Compare
|
❕ Gradle check result for f0c47e7: 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. |
|
Hi, @mch2 |
mch2
left a comment
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.
looks good thanks for fixing this @guojialiang92!
…ionListenerSuccess (opensearch-project#17969) * fix flaky test SegmentReplicationTargetServiceTests.testStartReplicationListenerSuccess Signed-off-by: guojialiang <[email protected]> * add UT Signed-off-by: guojialiang <[email protected]> * add comment Signed-off-by: guojialiang <[email protected]> * add tests Signed-off-by: guojialiang <[email protected]> --------- Signed-off-by: guojialiang <[email protected]> Signed-off-by: Tanishq Ranjan <[email protected]>
…ionListenerSuccess (opensearch-project#17969) * fix flaky test SegmentReplicationTargetServiceTests.testStartReplicationListenerSuccess Signed-off-by: guojialiang <[email protected]> * add UT Signed-off-by: guojialiang <[email protected]> * add comment Signed-off-by: guojialiang <[email protected]> * add tests Signed-off-by: guojialiang <[email protected]> --------- Signed-off-by: guojialiang <[email protected]> Signed-off-by: Harsh Kothari <[email protected]>
…ionListenerSuccess (opensearch-project#17969) * fix flaky test SegmentReplicationTargetServiceTests.testStartReplicationListenerSuccess Signed-off-by: guojialiang <[email protected]> * add UT Signed-off-by: guojialiang <[email protected]> * add comment Signed-off-by: guojialiang <[email protected]> * add tests Signed-off-by: guojialiang <[email protected]> --------- Signed-off-by: guojialiang <[email protected]> Signed-off-by: Harsh Kothari <[email protected]>
Description
This PR fixes the flaky test
org.opensearch.indices.replication.SegmentReplicationTargetServiceTests#testStartReplicationListenerSuccess.Reproduce method command reference gradle check.
This test cannot be reproduced stably, and there may be
1error every1000runs.The error message is as follows:
Related Issues
Resolves #[15829]
Solution
In process segment replication, obtain
NRTReplicationEnginethroughIndexShard#getReplicationEngineIf the
Enginehas been closed, return an exceptionAlreadyClosedExceptionAlthough
IndexShardState.STARTEDis checked before callingIndexShard#getReplicationEngine, shard close may be inserted between them, and atomicity cannot be guaranteed.We can improve method
IndexShard#getReplicationEngineby returningOptional.empty()whengetEngine()throws aAlreadyClosedException.The logic related to segment replication will not continue to execute after judging that the return value is empty (
IndexShard#finalizeReplication/IndexShard#isSegmentReplicationAllowed/SegmentReplicationTargetService#forceReplication), and there will be no side effects.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.