Skip to content

Commit fa40ac3

Browse files
committed
Revert "Fix checkpoint handling to prevent segment replication infinite loop (opensearch-project#18636)"
This reverts commit 46a0045.
1 parent 0761ebe commit fa40ac3

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

server/src/main/java/org/opensearch/indices/replication/SegmentReplicationTargetService.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050

5151
import java.io.IOException;
5252
import java.util.List;
53-
import java.util.Objects;
5453
import java.util.Optional;
5554
import java.util.concurrent.CountDownLatch;
5655
import java.util.concurrent.TimeUnit;
@@ -350,10 +349,7 @@ public void onReplicationDone(SegmentReplicationState state) {
350349

351350
// if we received a checkpoint during the copy event that is ahead of this
352351
// try and process it.
353-
ReplicationCheckpoint latestReceivedCheckpoint = replicator.getPrimaryCheckpoint(replicaShard.shardId());
354-
if (Objects.nonNull(latestReceivedCheckpoint) && latestReceivedCheckpoint.isAheadOf(receivedCheckpoint)) {
355-
processLatestReceivedCheckpoint(replicaShard, thread);
356-
}
352+
processLatestReceivedCheckpoint(replicaShard, thread);
357353
}
358354

359355
@Override

server/src/test/java/org/opensearch/indices/replication/SegmentReplicationTargetServiceTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,6 @@ public void testStartReplicationListenerSuccess() throws InterruptedException {
637637

638638
latch.await(2, TimeUnit.SECONDS);
639639
verify(spy, (atLeastOnce())).updateVisibleCheckpoint(eq(0L), eq(replicaShard));
640-
verify(spy, times(1)).processLatestReceivedCheckpoint(any(), any());
641640
}
642641

643642
public void testStartReplicationListenerFailure() throws InterruptedException {

0 commit comments

Comments
 (0)