Skip to content

Commit 93e751f

Browse files
committed
Fix test
1 parent ab8eeb3 commit 93e751f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
import org.elasticsearch.index.mapper.ParsedDocument;
8181
import org.elasticsearch.index.mapper.SeqNoFieldMapper;
8282
import org.elasticsearch.index.mapper.SourceToParse;
83+
import org.elasticsearch.index.seqno.SequenceNumbers;
8384
import org.elasticsearch.index.seqno.SequenceNumbersService;
8485
import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus;
8586
import org.elasticsearch.index.store.Store;
@@ -738,6 +739,11 @@ public void onFailure(Exception e) {
738739

739740
public void testConcurrentTermIncreaseOnReplicaShard() throws BrokenBarrierException, InterruptedException, IOException {
740741
final IndexShard indexShard = newStartedShard(false);
742+
/*
743+
* When a shard recovers from a primary, it will advance its global checkpoint. We simulate that here; since we are not performing
744+
* any operations, we initialize to no operations performed as the local checkpoint on this shard carries the same value.
745+
*/
746+
indexShard.updateGlobalCheckpointOnReplica(SequenceNumbersService.NO_OPS_PERFORMED);
741747

742748
final CyclicBarrier barrier = new CyclicBarrier(3);
743749
final CountDownLatch latch = new CountDownLatch(2);

0 commit comments

Comments
 (0)