Skip to content

Commit

Permalink
Fix SegmentReplicationAllocationIT
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <kalsac@amazon.com>
  • Loading branch information
Sachin Kale committed Sep 2, 2023
1 parent 7e94f98 commit eb37566
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.opensearch.indices.replication;

import org.apache.lucene.tests.util.LuceneTestCase;
import org.opensearch.cluster.ClusterState;
import org.opensearch.cluster.OpenSearchAllocationTestCase.ShardAllocations;
import org.opensearch.cluster.metadata.IndexMetadata;
Expand Down Expand Up @@ -40,11 +41,7 @@ private void createIndex(String idxName, int shardCount, int replicaCount, boole
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, shardCount)
.put(IndexModule.INDEX_QUERY_CACHE_ENABLED_SETTING.getKey(), false)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, replicaCount);
if (isSegRep) {
builder = builder.put(IndexMetadata.SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT);
} else {
builder = builder.put(IndexMetadata.SETTING_REPLICATION_TYPE, ReplicationType.DOCUMENT);
}
builder = builder.put(IndexMetadata.SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT);
prepareCreate(idxName, builder).get();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ public void testMultipleIndices() throws Exception {
refresh(INDEX_NAME, index_2);
waitForSearchableDocs(INDEX_NAME, numDocs, nodes);
waitForSearchableDocs(index_2, numDocs, nodes);
waitForCurrentReplicas();

final IndexShard index_1_primary = getIndexShard(primaryNode, INDEX_NAME);
final IndexShard index_2_primary = getIndexShard(primaryNode, index_2);
Expand Down Expand Up @@ -325,6 +326,7 @@ public void testMultipleIndices() throws Exception {
assertTrue(segmentReplicationStatsResponse.getReplicationStats().containsKey(index_2));
}

@AwaitsFix(bugUrl = "Test tries to create a docrep index which is not possible")
public void testQueryAgainstDocRepIndex() {
internalCluster().startClusterManagerOnlyNode();
List<String> nodes = new ArrayList<>();
Expand Down

0 comments on commit eb37566

Please sign in to comment.