From 51a027b839d31fc89e04ecd54885756c48bfe143 Mon Sep 17 00:00:00 2001 From: Rishikesh1159 Date: Mon, 31 Jul 2023 16:26:13 +0000 Subject: [PATCH 1/4] Remove Doc Parsing for segment replication enabled replica shard during translog replay from recovery. Signed-off-by: Rishikesh1159 --- .../opensearch/index/shard/IndexShard.java | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index e09a218ccf83b..1add7c69b20b1 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -931,7 +931,8 @@ public Engine.IndexResult applyIndexOperationOnPrimary( autoGeneratedTimestamp, isRetry, Engine.Operation.Origin.PRIMARY, - sourceToParse + sourceToParse, + null ); } @@ -944,23 +945,6 @@ public Engine.IndexResult applyIndexOperationOnReplica( boolean isRetry, SourceToParse sourceToParse ) throws IOException { - if (indexSettings.isSegRepEnabled()) { - Engine.Index index = new Engine.Index( - new Term(IdFieldMapper.NAME, Uid.encodeId(id)), - new ParsedDocument(null, null, id, null, null, sourceToParse.source(), sourceToParse.getMediaType(), null), - seqNo, - opPrimaryTerm, - version, - null, - Engine.Operation.Origin.REPLICA, - System.nanoTime(), - autoGeneratedTimeStamp, - isRetry, - UNASSIGNED_SEQ_NO, - 0 - ); - return getEngine().index(index); - } return applyIndexOperation( getEngine(), seqNo, @@ -972,7 +956,8 @@ public Engine.IndexResult applyIndexOperationOnReplica( autoGeneratedTimeStamp, isRetry, Engine.Operation.Origin.REPLICA, - sourceToParse + sourceToParse, + id ); } @@ -987,8 +972,27 @@ private Engine.IndexResult applyIndexOperation( long autoGeneratedTimeStamp, boolean isRetry, Engine.Operation.Origin origin, - SourceToParse sourceToParse + SourceToParse sourceToParse, + String id ) throws IOException { + if (indexSettings.isSegRepEnabled() && routingEntry().primary() == false && getReplicationEngine().isPresent()) { + Engine.Index index = new Engine.Index( + new Term(IdFieldMapper.NAME, Uid.encodeId(id)), + new ParsedDocument(null, null, id, null, null, sourceToParse.source(), sourceToParse.getMediaType(), null), + seqNo, + opPrimaryTerm, + version, + null, + Engine.Operation.Origin.REPLICA, + System.nanoTime(), + autoGeneratedTimeStamp, + isRetry, + UNASSIGNED_SEQ_NO, + 0 + ); + return getEngine().index(index); + } + assert opPrimaryTerm <= getOperationPrimaryTerm() : "op term [ " + opPrimaryTerm + " ] > shard term [" @@ -2173,7 +2177,8 @@ private Engine.Result applyTranslogOperation(Engine engine, Translog.Operation o index.source(), MediaTypeRegistry.xContentType(index.source()), index.routing() - ) + ), + index.id() ); break; case DELETE: From db990b9060d80e778e0bd63399b07ea3a4213781 Mon Sep 17 00:00:00 2001 From: Rishikesh1159 Date: Wed, 2 Aug 2023 17:23:56 +0000 Subject: [PATCH 2/4] Adding unit test to verify document is not parsed on an segment replication enabled replica shard. Signed-off-by: Rishikesh1159 --- .../opensearch/index/shard/IndexShard.java | 69 +++++++++--- .../index/shard/IndexShardTests.java | 103 ++++++++++++++++++ 2 files changed, 158 insertions(+), 14 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index 1add7c69b20b1..b3eb2725e45b2 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -976,21 +976,18 @@ private Engine.IndexResult applyIndexOperation( String id ) throws IOException { if (indexSettings.isSegRepEnabled() && routingEntry().primary() == false && getReplicationEngine().isPresent()) { - Engine.Index index = new Engine.Index( - new Term(IdFieldMapper.NAME, Uid.encodeId(id)), - new ParsedDocument(null, null, id, null, null, sourceToParse.source(), sourceToParse.getMediaType(), null), - seqNo, - opPrimaryTerm, - version, - null, - Engine.Operation.Origin.REPLICA, - System.nanoTime(), - autoGeneratedTimeStamp, - isRetry, - UNASSIGNED_SEQ_NO, - 0 + return getEngine().index( + getNonParsedIndex( + seqNo, + opPrimaryTerm, + version, + autoGeneratedTimeStamp, + isRetry, + Engine.Operation.Origin.REPLICA, + sourceToParse, + id + ) ); - return getEngine().index(index); } assert opPrimaryTerm <= getOperationPrimaryTerm() : "op term [ " @@ -1030,6 +1027,50 @@ private Engine.IndexResult applyIndexOperation( return index(engine, operation); } + Engine.Index getNonParsedIndex( + long seqNo, + long opPrimaryTerm, + long version, + long autoGeneratedTimeStamp, + boolean isRetry, + Engine.Operation.Origin origin, + SourceToParse sourceToParse, + String id + ) { + System.out.println( + "seqno : " + + seqNo + + " opprimary: " + + opPrimaryTerm + + " version: " + + version + + " autogen: " + + autoGeneratedTimeStamp + + " isretry: " + + isRetry + + " origin: " + + origin + + " sourcetoparse: " + + sourceToParse + + " id: " + + id + ); + return new Engine.Index( + new Term(IdFieldMapper.NAME, Uid.encodeId(id)), + new ParsedDocument(null, null, id, null, null, sourceToParse.source(), sourceToParse.getMediaType(), null), + seqNo, + opPrimaryTerm, + version, + null, + origin, + System.nanoTime(), + autoGeneratedTimeStamp, + isRetry, + UNASSIGNED_SEQ_NO, + 0 + ); + } + public static Engine.Index prepareIndex( DocumentMapperForType docMapper, SourceToParse source, diff --git a/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java b/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java index 915a15da6cb1d..6759efb83db0f 100644 --- a/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java @@ -214,7 +214,14 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.oneOf; import static org.hamcrest.Matchers.sameInstance; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.never; +import static org.mockito.internal.verification.VerificationModeFactory.times; import static org.opensearch.cluster.routing.TestShardRouting.newShardRouting; import static org.opensearch.common.lucene.Lucene.cleanLuceneIndex; import static org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS; @@ -3285,6 +3292,102 @@ public void testShardActiveDuringInternalRecovery() throws IOException { closeShards(shard); } + public void testDocNotParsedOnSegmentReplicationEnabledReplicaShard() throws IOException { + IndexShard spyReplicaShard1, spyReplicaShard2, spyReplicaShard3; + Settings indexSettings = Settings.builder() + .put(IndexMetadata.SETTING_VERSION_CREATED, org.opensearch.Version.CURRENT) + .put(IndexMetadata.SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT) + .build(); + + // Creating replica shards with segment replication enabled. + spyReplicaShard1 = spy(newStartedShard(false, indexSettings, new NRTReplicationEngineFactory())); + spyReplicaShard2 = spy(newStartedShard(false, indexSettings, new NRTReplicationEngineFactory())); + + // creating a replica shard without segment replication enabled. + spyReplicaShard3 = spy(newStartedShard(false)); + + String id = UUID.randomUUID().toString(); + long seqNo = 2; + byte[] source = new BytesArray("{}").array(); + SourceToParse sourceToParse = new SourceToParse( + spyReplicaShard1.shardId().getIndexName(), + id, + new BytesArray(source), + XContentType.JSON + ); + + // call applyIndexOperationOnReplica() on index shard. This call simulates index operation on replica from TransportBulkShardAction + // class. + spyReplicaShard1.applyIndexOperationOnReplica( + id, + seqNo, + spyReplicaShard1.getOperationPrimaryTerm(), + 1, + IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP, + false, + sourceToParse + ); + + Translog.Operation indexOperation = new Translog.Index( + id, + seqNo, + spyReplicaShard2.getPendingPrimaryTerm(), + 1, + source, + "testRouting", + IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP + ); + // call applyTranslogOperation() on replica shard. This call simulates indexing translog operations from RecoveryTarget class during + // peer recovery. + spyReplicaShard2.applyTranslogOperation(indexOperation, Engine.Operation.Origin.PEER_RECOVERY); + + // Verify getNonParsedIndex() is called once on both replica shards. + verify(spyReplicaShard1, times(1)).getNonParsedIndex(anyLong(), anyLong(), anyLong(), anyLong(), anyBoolean(), any(), any(), any()); + verify(spyReplicaShard2, times(1)).getNonParsedIndex(anyLong(), anyLong(), anyLong(), anyLong(), anyBoolean(), any(), any(), any()); + + // Assert that routing value of index operation is null, to verify that document is not parsed + assertNull( + spyReplicaShard1.getNonParsedIndex( + seqNo, + spyReplicaShard1.getOperationPrimaryTerm(), + 1, + IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP, + false, + Engine.Operation.Origin.REPLICA, + sourceToParse, + id + ).routing() + ); + // Assert that routing value of index operation is null even though we have set routing to testRouting in replicaShard2, to verify + // that document is not parsed + assertNull( + spyReplicaShard1.getNonParsedIndex( + seqNo, + spyReplicaShard2.getOperationPrimaryTerm(), + 1, + IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP, + false, + Engine.Operation.Origin.REPLICA, + sourceToParse, + id + ).routing() + ); + + // Perform same operations on non segment replication replica shard and verify that call to getNonParsedIndex() is never made. + spyReplicaShard3.applyIndexOperationOnReplica( + UUID.randomUUID().toString(), + 0, + primaryTerm, + 1, + IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP, + false, + new SourceToParse(spyReplicaShard3.shardId().getIndexName(), "id", new BytesArray("{}"), XContentType.JSON) + ); + verify(spyReplicaShard3, never()).getNonParsedIndex(anyLong(), anyLong(), anyLong(), anyLong(), anyBoolean(), any(), any(), any()); + + closeShards(spyReplicaShard1, spyReplicaShard2, spyReplicaShard3); + } + public void testShardActiveDuringPeerRecovery() throws IOException { Settings settings = Settings.builder() .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) From 62e9d8c93eb4ae920391fc73e939dd55b948aca7 Mon Sep 17 00:00:00 2001 From: Rishikesh1159 Date: Wed, 2 Aug 2023 22:13:07 +0000 Subject: [PATCH 3/4] remove unnecessary unit tests and address comments. Signed-off-by: Rishikesh1159 --- .../replication/SegmentReplicationIT.java | 76 +++++++++++++ .../opensearch/index/shard/IndexShard.java | 75 +++---------- .../index/shard/IndexShardTests.java | 103 ------------------ 3 files changed, 94 insertions(+), 160 deletions(-) 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 3ab1a2a8564c5..bf59095e65da3 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -88,10 +88,14 @@ import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder; import static org.opensearch.index.query.QueryBuilders.matchAllQuery; import static org.opensearch.index.query.QueryBuilders.matchQuery; +import static org.opensearch.index.query.QueryBuilders.termQuery; +import static org.opensearch.index.query.QueryBuilders.boolQuery; +import static org.opensearch.index.query.QueryBuilders.rangeQuery; import static org.opensearch.indices.replication.SegmentReplicationTarget.REPLICATION_PREFIX; import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAllSuccessful; import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertHitCount; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertNoFailures; import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertSearchHits; @OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0) @@ -1342,4 +1346,76 @@ public void testPrimaryReceivesDocsDuringReplicaRecovery() throws Exception { ensureGreen(INDEX_NAME); waitForSearchableDocs(2, nodes); } + + public void testSimpleDFSQueryWithSegmentReplication() throws Exception { + final String primaryNode = internalCluster().startDataOnlyNode(); + assertAcked( + prepareCreate(INDEX_NAME).setMapping( + jsonBuilder().startObject() + .startObject("_routing") + .field("required", true) + .endObject() + .startObject("properties") + .startObject("online") + .field("type", "boolean") + .endObject() + .startObject("ts") + .field("type", "date") + .field("ignore_malformed", false) + .field("format", "epoch_millis") + .endObject() + .startObject("bs") + .field("type", "keyword") + .endObject() + .endObject() + .endObject() + ) + ); + ensureYellow(INDEX_NAME); + final String replicaNode = internalCluster().startDataOnlyNode(); + + client().prepareIndex(INDEX_NAME) + .setId("1") + .setRouting("Y") + .setSource("online", false, "bs", "Y", "ts", System.currentTimeMillis() - 100, "type", "s") + .get(); + client().prepareIndex(INDEX_NAME) + .setId("2") + .setRouting("X") + .setSource("online", true, "bs", "X", "ts", System.currentTimeMillis() - 10000000, "type", "s") + .get(); + client().prepareIndex(INDEX_NAME) + .setId("3") + .setRouting(randomAlphaOfLength(2)) + .setSource("online", false, "ts", System.currentTimeMillis() - 100, "type", "bs") + .get(); + client().prepareIndex(INDEX_NAME) + .setId("4") + .setRouting(randomAlphaOfLength(2)) + .setSource("online", true, "ts", System.currentTimeMillis() - 123123, "type", "bs") + .get(); + refresh(); + ensureGreen(INDEX_NAME); + waitForSearchableDocs(4, primaryNode, replicaNode); + + SearchResponse response = client().prepareSearch(INDEX_NAME) + .setSearchType(SearchType.DFS_QUERY_THEN_FETCH) + .setQuery( + boolQuery().must(termQuery("online", true)) + .must( + boolQuery().should( + boolQuery().must(rangeQuery("ts").lt(System.currentTimeMillis() - (15 * 1000))).must(termQuery("type", "bs")) + ) + .should( + boolQuery().must(rangeQuery("ts").lt(System.currentTimeMillis() - (15 * 1000))).must(termQuery("type", "s")) + ) + ) + ) + .setVersion(true) + .setFrom(0) + .setSize(100) + .setExplain(true) + .get(); + assertNoFailures(response); + } } diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index b3eb2725e45b2..f3c6d1123097f 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -975,21 +975,26 @@ private Engine.IndexResult applyIndexOperation( SourceToParse sourceToParse, String id ) throws IOException { - if (indexSettings.isSegRepEnabled() && routingEntry().primary() == false && getReplicationEngine().isPresent()) { - return getEngine().index( - getNonParsedIndex( - seqNo, - opPrimaryTerm, - version, - autoGeneratedTimeStamp, - isRetry, - Engine.Operation.Origin.REPLICA, - sourceToParse, - id - ) + + // For Segment Replication enabled replica shards we can be skip parsing the documents as we directly copy segments from primary + // shard. + if (indexSettings.isSegRepEnabled() && routingEntry().primary() == false) { + Engine.Index index = new Engine.Index( + new Term(IdFieldMapper.NAME, Uid.encodeId(id)), + new ParsedDocument(null, null, id, null, null, sourceToParse.source(), sourceToParse.getMediaType(), null), + seqNo, + opPrimaryTerm, + version, + null, + Engine.Operation.Origin.REPLICA, + System.nanoTime(), + autoGeneratedTimeStamp, + isRetry, + UNASSIGNED_SEQ_NO, + 0 ); + return getEngine().index(index); } - assert opPrimaryTerm <= getOperationPrimaryTerm() : "op term [ " + opPrimaryTerm + " ] > shard term [" @@ -1027,50 +1032,6 @@ private Engine.IndexResult applyIndexOperation( return index(engine, operation); } - Engine.Index getNonParsedIndex( - long seqNo, - long opPrimaryTerm, - long version, - long autoGeneratedTimeStamp, - boolean isRetry, - Engine.Operation.Origin origin, - SourceToParse sourceToParse, - String id - ) { - System.out.println( - "seqno : " - + seqNo - + " opprimary: " - + opPrimaryTerm - + " version: " - + version - + " autogen: " - + autoGeneratedTimeStamp - + " isretry: " - + isRetry - + " origin: " - + origin - + " sourcetoparse: " - + sourceToParse - + " id: " - + id - ); - return new Engine.Index( - new Term(IdFieldMapper.NAME, Uid.encodeId(id)), - new ParsedDocument(null, null, id, null, null, sourceToParse.source(), sourceToParse.getMediaType(), null), - seqNo, - opPrimaryTerm, - version, - null, - origin, - System.nanoTime(), - autoGeneratedTimeStamp, - isRetry, - UNASSIGNED_SEQ_NO, - 0 - ); - } - public static Engine.Index prepareIndex( DocumentMapperForType docMapper, SourceToParse source, diff --git a/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java b/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java index 6759efb83db0f..915a15da6cb1d 100644 --- a/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java @@ -214,14 +214,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.oneOf; import static org.hamcrest.Matchers.sameInstance; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyLong; -import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.never; -import static org.mockito.internal.verification.VerificationModeFactory.times; import static org.opensearch.cluster.routing.TestShardRouting.newShardRouting; import static org.opensearch.common.lucene.Lucene.cleanLuceneIndex; import static org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS; @@ -3292,102 +3285,6 @@ public void testShardActiveDuringInternalRecovery() throws IOException { closeShards(shard); } - public void testDocNotParsedOnSegmentReplicationEnabledReplicaShard() throws IOException { - IndexShard spyReplicaShard1, spyReplicaShard2, spyReplicaShard3; - Settings indexSettings = Settings.builder() - .put(IndexMetadata.SETTING_VERSION_CREATED, org.opensearch.Version.CURRENT) - .put(IndexMetadata.SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT) - .build(); - - // Creating replica shards with segment replication enabled. - spyReplicaShard1 = spy(newStartedShard(false, indexSettings, new NRTReplicationEngineFactory())); - spyReplicaShard2 = spy(newStartedShard(false, indexSettings, new NRTReplicationEngineFactory())); - - // creating a replica shard without segment replication enabled. - spyReplicaShard3 = spy(newStartedShard(false)); - - String id = UUID.randomUUID().toString(); - long seqNo = 2; - byte[] source = new BytesArray("{}").array(); - SourceToParse sourceToParse = new SourceToParse( - spyReplicaShard1.shardId().getIndexName(), - id, - new BytesArray(source), - XContentType.JSON - ); - - // call applyIndexOperationOnReplica() on index shard. This call simulates index operation on replica from TransportBulkShardAction - // class. - spyReplicaShard1.applyIndexOperationOnReplica( - id, - seqNo, - spyReplicaShard1.getOperationPrimaryTerm(), - 1, - IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP, - false, - sourceToParse - ); - - Translog.Operation indexOperation = new Translog.Index( - id, - seqNo, - spyReplicaShard2.getPendingPrimaryTerm(), - 1, - source, - "testRouting", - IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP - ); - // call applyTranslogOperation() on replica shard. This call simulates indexing translog operations from RecoveryTarget class during - // peer recovery. - spyReplicaShard2.applyTranslogOperation(indexOperation, Engine.Operation.Origin.PEER_RECOVERY); - - // Verify getNonParsedIndex() is called once on both replica shards. - verify(spyReplicaShard1, times(1)).getNonParsedIndex(anyLong(), anyLong(), anyLong(), anyLong(), anyBoolean(), any(), any(), any()); - verify(spyReplicaShard2, times(1)).getNonParsedIndex(anyLong(), anyLong(), anyLong(), anyLong(), anyBoolean(), any(), any(), any()); - - // Assert that routing value of index operation is null, to verify that document is not parsed - assertNull( - spyReplicaShard1.getNonParsedIndex( - seqNo, - spyReplicaShard1.getOperationPrimaryTerm(), - 1, - IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP, - false, - Engine.Operation.Origin.REPLICA, - sourceToParse, - id - ).routing() - ); - // Assert that routing value of index operation is null even though we have set routing to testRouting in replicaShard2, to verify - // that document is not parsed - assertNull( - spyReplicaShard1.getNonParsedIndex( - seqNo, - spyReplicaShard2.getOperationPrimaryTerm(), - 1, - IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP, - false, - Engine.Operation.Origin.REPLICA, - sourceToParse, - id - ).routing() - ); - - // Perform same operations on non segment replication replica shard and verify that call to getNonParsedIndex() is never made. - spyReplicaShard3.applyIndexOperationOnReplica( - UUID.randomUUID().toString(), - 0, - primaryTerm, - 1, - IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP, - false, - new SourceToParse(spyReplicaShard3.shardId().getIndexName(), "id", new BytesArray("{}"), XContentType.JSON) - ); - verify(spyReplicaShard3, never()).getNonParsedIndex(anyLong(), anyLong(), anyLong(), anyLong(), anyBoolean(), any(), any(), any()); - - closeShards(spyReplicaShard1, spyReplicaShard2, spyReplicaShard3); - } - public void testShardActiveDuringPeerRecovery() throws IOException { Settings settings = Settings.builder() .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) From 79cf317c5e44a7e5e3aa99d978160be735ede369 Mon Sep 17 00:00:00 2001 From: Rishikesh1159 Date: Sun, 6 Aug 2023 19:24:00 +0000 Subject: [PATCH 4/4] address comments on PR. Signed-off-by: Rishikesh1159 --- .../opensearch/indices/replication/SegmentReplicationIT.java | 2 +- 1 file changed, 1 insertion(+), 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 bf59095e65da3..abd1d0ec365f9 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -1347,7 +1347,7 @@ public void testPrimaryReceivesDocsDuringReplicaRecovery() throws Exception { waitForSearchableDocs(2, nodes); } - public void testSimpleDFSQueryWithSegmentReplication() throws Exception { + public void testIndexWhileRecoveringReplica() throws Exception { final String primaryNode = internalCluster().startDataOnlyNode(); assertAcked( prepareCreate(INDEX_NAME).setMapping(