From 552a1340a65b07a21cd599ce3da8dc1b5f9aa32c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 7 Jun 2023 20:17:23 +0000 Subject: [PATCH] [Segment Replication] Add lucene codec tests (#7903) * Resolve forbidden APIs Signed-off-by: Suraj Singh * Address review comments Signed-off-by: Suraj Singh * Remove older lucene test Signed-off-by: Suraj Singh * Remove older lucene test Signed-off-by: Suraj Singh --------- Signed-off-by: Suraj Singh (cherry picked from commit f25f61b67006e805de5c1bfb36686e6ec6e8b86b) Signed-off-by: github-actions[bot] --- .../indices/replication/SegmentReplicationIT.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java index 86845c8d9dc49..8a4dc3c929f13 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -51,7 +51,9 @@ import org.opensearch.index.SegmentReplicationPerGroupStats; import org.opensearch.index.SegmentReplicationPressureService; import org.opensearch.index.SegmentReplicationShardStats; +import org.opensearch.index.codec.CodecService; import org.opensearch.index.engine.Engine; +import org.opensearch.index.engine.EngineConfig; import org.opensearch.index.engine.NRTReplicationReaderManager; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.ShardId; @@ -189,7 +191,14 @@ public void testCancelPrimaryAllocation() throws Exception { public void testReplicationAfterPrimaryRefreshAndFlush() throws Exception { final String nodeA = internalCluster().startNode(); final String nodeB = internalCluster().startNode(); - createIndex(INDEX_NAME); + final Settings settings = Settings.builder() + .put(indexSettings()) + .put( + EngineConfig.INDEX_CODEC_SETTING.getKey(), + randomFrom(CodecService.DEFAULT_CODEC, CodecService.BEST_COMPRESSION_CODEC, CodecService.LUCENE_DEFAULT_CODEC) + ) + .build(); + createIndex(INDEX_NAME, settings); ensureGreen(INDEX_NAME); final int initialDocCount = scaledRandomIntBetween(0, 200);