|
54 | 54 | import org.elasticsearch.index.Index; |
55 | 55 | import org.elasticsearch.index.IndexNotFoundException; |
56 | 56 | import org.elasticsearch.index.IndexService; |
| 57 | +import org.elasticsearch.index.seqno.SequenceNumbers; |
57 | 58 | import org.elasticsearch.index.shard.IndexShard; |
58 | 59 | import org.elasticsearch.index.shard.IndexShardClosedException; |
59 | 60 | import org.elasticsearch.index.shard.IndexShardState; |
@@ -931,6 +932,8 @@ public void testSeqNoIsSetOnPrimary() { |
931 | 932 | when(shard.getPendingPrimaryTerm()).thenReturn(primaryTerm); |
932 | 933 | when(shard.routingEntry()).thenReturn(routingEntry); |
933 | 934 | when(shard.isRelocatedPrimary()).thenReturn(false); |
| 935 | + when(shard.getLocalCheckpointSupplier()).thenReturn(() -> SequenceNumbers.UNASSIGNED_SEQ_NO); |
| 936 | + when(shard.getLastSyncedGlobalCheckpointSupplier()).thenReturn(() -> SequenceNumbers.UNASSIGNED_SEQ_NO); |
934 | 937 | IndexShardRoutingTable shardRoutingTable = clusterService.state().routingTable().shardRoutingTable(shardId); |
935 | 938 | Set<String> inSyncIds = randomBoolean() |
936 | 939 | ? singleton(routingEntry.allocationId().getId()) |
@@ -1631,7 +1634,8 @@ private IndexShard mockIndexShard(ShardId shardId, ClusterService clusterService |
1631 | 1634 | when(indexShard.getPendingPrimaryTerm()).thenAnswer( |
1632 | 1635 | i -> clusterService.state().metadata().getProject().getIndexSafe(shardId.getIndex()).primaryTerm(shardId.id()) |
1633 | 1636 | ); |
1634 | | - |
| 1637 | + when(indexShard.getLocalCheckpointSupplier()).thenReturn(() -> SequenceNumbers.UNASSIGNED_SEQ_NO); |
| 1638 | + when(indexShard.getLastSyncedGlobalCheckpointSupplier()).thenReturn(() -> SequenceNumbers.UNASSIGNED_SEQ_NO); |
1635 | 1639 | ReplicationGroup replicationGroup = mock(ReplicationGroup.class); |
1636 | 1640 | when(indexShard.getReplicationGroup()).thenReturn(replicationGroup); |
1637 | 1641 | return indexShard; |
|
0 commit comments