diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java index 82159065bcc8a..8f25ca0d6112f 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java @@ -75,7 +75,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; -@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE, numDataNodes = 0) +@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0) public class AllocationIdIT extends OpenSearchIntegTestCase { @Override @@ -170,10 +170,15 @@ public void testFailedRecoveryOnAllocateStalePrimaryRequiresAnotherAllocateStale node2 = internalCluster().startNode(node2DataPathSettings); ensureGreen(indexName); - assertThat(historyUUID(node1, indexName), not(equalTo(historyUUID))); + // historyUUID remains same as we are fetching data from remote store + assertThat(historyUUID(node1, indexName), equalTo(historyUUID)); assertThat(historyUUID(node1, indexName), equalTo(historyUUID(node2, indexName))); internalCluster().assertSameDocIdsOnShards(); + + // This is only applicable for remote store as we restore the entire data + assertHitCount(client(node1).prepareSearch(indexName).setQuery(matchAllQuery()).get(), numDocs + numExtraDocs); + assertHitCount(client(node2).prepareSearch(indexName).setQuery(matchAllQuery()).get(), numDocs + numExtraDocs); } public void checkHealthStatus(String indexName, ClusterHealthStatus healthStatus) { @@ -189,7 +194,7 @@ private int indexDocs(String indexName, Object... source) throws InterruptedExce // index some docs in several segments int numDocs = 0; for (int k = 0, attempts = randomIntBetween(5, 10); k < attempts; k++) { - final int numExtraDocs = between(10, 100); + final int numExtraDocs = between(10, 20); IndexRequestBuilder[] builders = new IndexRequestBuilder[numExtraDocs]; for (int i = 0; i < builders.length; i++) { builders[i] = client().prepareIndex(indexName).setSource(source); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java index fb97ae59aae91..d813fc2f0b93d 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java @@ -611,6 +611,7 @@ public void testOpenIndexOverLimit() { public void testIgnoreDotSettingOnMultipleNodes() throws IOException, InterruptedException { int maxAllowedShardsPerNode = 10, indexPrimaryShards = 11, indexReplicaShards = 1; + this.nodeAttributeSettings = null; InternalTestCluster cluster = new InternalTestCluster( randomLong(), createTempDir(), @@ -647,6 +648,8 @@ public Path nodeConfigPath(int nodeOrdinal) { ); cluster.beforeTest(random()); + OpenSearchIntegTestCase.remoteStoreNodeAttributeCluster = cluster; + // Starting 3 ClusterManagerOnlyNode nodes cluster.startClusterManagerOnlyNode(Settings.builder().put("cluster.ignore_dot_indexes", true).build()); cluster.startClusterManagerOnlyNode(Settings.builder().put("cluster.ignore_dot_indexes", false).build()); @@ -656,6 +659,8 @@ public Path nodeConfigPath(int nodeOrdinal) { cluster.startDataOnlyNode(Settings.builder().put("cluster.ignore_dot_indexes", false).build()); cluster.startDataOnlyNode(Settings.builder().put("cluster.ignore_dot_indexes", false).build()); + OpenSearchIntegTestCase.remoteStoreNodeAttributeCluster = null; + // Setting max shards per node to be 10 cluster.client() .admin()