diff --git a/core/src/main/java/org/elasticsearch/action/resync/TransportResyncReplicationAction.java b/core/src/main/java/org/elasticsearch/action/resync/TransportResyncReplicationAction.java index c723a175ad7..6b84522d23a 100644 --- a/core/src/main/java/org/elasticsearch/action/resync/TransportResyncReplicationAction.java +++ b/core/src/main/java/org/elasticsearch/action/resync/TransportResyncReplicationAction.java @@ -93,7 +93,7 @@ public class TransportResyncReplicationAction extends TransportWriteAction lcps.localCheckpoint) { logger.trace("updated local checkpoint of [{}] from [{}] to [{}]", allocationId, lcps.localCheckpoint, localCheckpoint); lcps.localCheckpoint = localCheckpoint; diff --git a/core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java b/core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java index f06ffc0d45f..2f7d2dd15ce 100644 --- a/core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java +++ b/core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java @@ -737,7 +737,7 @@ public class GlobalCheckpointTrackerTests extends ESTestCase { private static void randomLocalCheckpointUpdate(GlobalCheckpointTracker gcp) { String allocationId = randomFrom(gcp.localCheckpoints.keySet()); long currentLocalCheckpoint = gcp.localCheckpoints.get(allocationId).getLocalCheckpoint(); - gcp.updateLocalCheckpoint(allocationId, currentLocalCheckpoint + randomInt(5)); + gcp.updateLocalCheckpoint(allocationId, Math.max(SequenceNumbersService.NO_OPS_PERFORMED, currentLocalCheckpoint + randomInt(5))); } private static void randomMarkInSync(GlobalCheckpointTracker gcp) {