Skip to content

Commit b690670

Browse files
committed
Remove global checkpoint constraint
A constraint on the global checkpoint was inadvertently committed from the inlining global checkpoint work. Namely, the constraint prevents the global checkpoint from advancing to no ops performed, a situation that can occur when shards are started but empty.
1 parent 3f54ae6 commit b690670

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointTracker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private synchronized void updateGlobalCheckpointOnPrimary() {
175175
globalCheckpoint);
176176
throw new IllegalStateException(message);
177177
}
178-
if (minLocalCheckpoint >= 0 && globalCheckpoint != minLocalCheckpoint) {
178+
if (globalCheckpoint != minLocalCheckpoint) {
179179
logger.trace("global checkpoint updated to [{}]", minLocalCheckpoint);
180180
globalCheckpoint = minLocalCheckpoint;
181181
}

core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@ public void testUpdateAllocationIdsFromMaster() throws Exception {
457457
* allocation ID to the in-sync set and removing it from pending, the local checkpoint update that freed the thread waiting for the
458458
* local checkpoint to advance could miss updating the global checkpoint in a race if the the waiting thread did not add the allocation
459459
* ID to the in-sync set and remove it from the pending set before the local checkpoint updating thread executed the global checkpoint
460-
* update. This test fails without an additional to {@link GlobalCheckpointTracker#updateGlobalCheckpointOnPrimary()} after removing
461-
* the allocation ID from the pending set in {@link GlobalCheckpointTracker#markAllocationIdAsInSync(String, long)} (even if a call is
462-
* added after notifying all waiters in {@link GlobalCheckpointTracker#updateLocalCheckpoint(String, long)}).
460+
* update. This test fails without an additional call to {@link GlobalCheckpointTracker#updateGlobalCheckpointOnPrimary()} after
461+
* removing the allocation ID from the pending set in {@link GlobalCheckpointTracker#markAllocationIdAsInSync(String, long)} (even if a
462+
* call is added after notifying all waiters in {@link GlobalCheckpointTracker#updateLocalCheckpoint(String, long)}).
463463
*
464464
* @throws InterruptedException if the main test thread was interrupted while waiting
465465
* @throws BrokenBarrierException if the barrier was broken while the main test thread was waiting

0 commit comments

Comments
 (0)