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

[Remote Segments] Retry segment uploads to remote store on failure #7400

Merged
merged 10 commits into from
May 9, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ public void testRefreshSuccessOnFirstAttempt() throws Exception {
// We spy on IndexShard.getReplicationTracker() to validate that we have tried running remote time as per the expectation.
CountDownLatch refreshCountLatch = new CountDownLatch(succeedOnAttempt);
// We spy on IndexShard.getEngine() to validate that we have successfully hit the terminal code for ascertaining successful upload.
CountDownLatch successLatch = new CountDownLatch(2);
// Value has been set as 3 as during a successful upload IndexShard.getEngine() is hit thrice and with mockito we are counting down
CountDownLatch successLatch = new CountDownLatch(3);
ashking94 marked this conversation as resolved.
Show resolved Hide resolved
mockIndexShardWithRetryAndScheduleRefresh(succeedOnAttempt, refreshCountLatch, successLatch);
assertBusy(() -> assertEquals(0, refreshCountLatch.getCount()));
assertBusy(() -> assertEquals(0, successLatch.getCount()));
Expand Down Expand Up @@ -302,7 +303,6 @@ private void mockIndexShardWithRetryAndScheduleRefresh(
return indexShard.getSegmentInfosSnapshot();
}).when(shard).getSegmentInfosSnapshot();

when(shard.getEngine()).thenReturn(indexShard.getEngine());
doAnswer(invocation -> {
successLatch.countDown();
return indexShard.getEngine();
Expand Down