TEST: Adjust rollback condition when shard is empty
If a shard is empty, it won't rollback its engine on promotion. This commit adjusts the expectation in the rollback test. Relates #33473
This commit is contained in:
parent
96c49e5ed0
commit
d9bbb89b26
|
@ -963,7 +963,8 @@ public class IndexShardTests extends IndexShardTestCase {
|
|||
Set<String> docsBelowGlobalCheckpoint = getShardDocUIDs(indexShard).stream()
|
||||
.filter(id -> Long.parseLong(id) <= Math.max(globalCheckpointOnReplica, globalCheckpoint)).collect(Collectors.toSet());
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
final boolean shouldRollback = Math.max(globalCheckpoint, globalCheckpointOnReplica) < indexShard.seqNoStats().getMaxSeqNo();
|
||||
final boolean shouldRollback = Math.max(globalCheckpoint, globalCheckpointOnReplica) < indexShard.seqNoStats().getMaxSeqNo()
|
||||
&& indexShard.seqNoStats().getMaxSeqNo() != SequenceNumbers.NO_OPS_PERFORMED;
|
||||
final Engine beforeRollbackEngine = indexShard.getEngine();
|
||||
indexShard.acquireReplicaOperationPermit(
|
||||
indexShard.pendingPrimaryTerm + 1,
|
||||
|
|
Loading…
Reference in New Issue