From 581a873124422bcbbb3cb630ca971df22550593c Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 19 Sep 2017 17:51:07 -0400 Subject: [PATCH] Remove assertion from checkpoint tracker invariants This assertion is wrong because the global checkpoint on a promoted primary can be lagging the replicas until it catches up after through resyncs, ongoing indexing operations and removing the old primary from the in-sync set. --- .../elasticsearch/index/seqno/GlobalCheckpointTracker.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointTracker.java b/core/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointTracker.java index 8d00723a4b8..34c731edaaf 100644 --- a/core/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointTracker.java +++ b/core/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointTracker.java @@ -278,13 +278,6 @@ public class GlobalCheckpointTracker extends AbstractIndexShardComponent { + "for primary mode allocation ID [" + shardAllocationId + "] " + "more than in-sync local checkpoints [" + checkpoints + "]"; - // when in primary mode, the local knowledge of the global checkpoints on shard copies is bounded by the global checkpoint - assert !primaryMode - || getGlobalCheckpoint() >= inSyncCheckpointStates(checkpoints, CheckpointState::getGlobalCheckpoint, LongStream::max) - : "global checkpoint [" + getGlobalCheckpoint() + "] " - + "for primary mode allocation ID [" + shardAllocationId + "] " - + "less than in-sync global checkpoints [" + checkpoints + "]"; - // we have a routing table iff we have a replication group assert (routingTable == null) == (replicationGroup == null) : "routing table is " + routingTable + " but replication group is " + replicationGroup;