@@ -1196,6 +1196,36 @@ public void testAcquireReplicaPermitAdvanceMaxSeqNoOfUpdates() throws Exception
1196
1196
closeShards (replica );
1197
1197
}
1198
1198
1199
+
1200
+ public void testGetChangesSnapshotThrowsAssertForSegRep () throws IOException {
1201
+ final ShardId shardId = new ShardId ("index" , "_na_" , 0 );
1202
+ final ShardRouting shardRouting = TestShardRouting .newShardRouting (
1203
+ shardId ,
1204
+ randomAlphaOfLength (8 ),
1205
+ true ,
1206
+ ShardRoutingState .INITIALIZING ,
1207
+ RecoverySource .EmptyStoreRecoverySource .INSTANCE
1208
+ );
1209
+ final Settings settings = Settings .builder ()
1210
+ .put (IndexMetadata .SETTING_VERSION_CREATED , Version .CURRENT )
1211
+ .put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 2 )
1212
+ .put (IndexMetadata .SETTING_NUMBER_OF_SHARDS , 1 )
1213
+ .build ();
1214
+ final IndexMetadata .Builder indexMetadata = IndexMetadata .builder (shardRouting .getIndexName ()).settings (settings ).primaryTerm (0 , 1 );
1215
+ final AtomicBoolean synced = new AtomicBoolean ();
1216
+ final IndexShard primaryShard = newShard (
1217
+ shardRouting ,
1218
+ indexMetadata .build (),
1219
+ null ,
1220
+ new InternalEngineFactory (),
1221
+ () -> synced .set (true ),
1222
+ RetentionLeaseSyncer .EMPTY ,
1223
+ null
1224
+ );
1225
+
1226
+ expectThrows (AssertionError .class , () -> primaryShard .getHistoryOperationsFromTranslog (0 , 1 ));
1227
+ }
1228
+
1199
1229
public void testGlobalCheckpointSync () throws IOException {
1200
1230
// create the primary shard with a callback that sets a boolean when the global checkpoint sync is invoked
1201
1231
final ShardId shardId = new ShardId ("index" , "_na_" , 0 );
0 commit comments