From 290e8a11a73b9a65f80e7a9ce3649f3e3f0213ff Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Mon, 5 Jun 2023 11:03:13 -0700 Subject: [PATCH 1/4] Resolve forbidden APIs Signed-off-by: Suraj Singh --- .../opensearch/indices/replication/SegmentReplicationIT.java | 2 ++ 1 file changed, 2 insertions(+) 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 08d1878c2df27..16375cb25be7f 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -42,6 +42,7 @@ import org.opensearch.cluster.routing.ShardRouting; import org.opensearch.cluster.routing.ShardRoutingState; import org.opensearch.cluster.routing.allocation.command.CancelAllocationCommand; +import org.opensearch.common.io.PathUtils; import org.opensearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; import org.opensearch.common.settings.Settings; @@ -73,6 +74,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.concurrent.CountDownLatch; From 6f45a82568999e0f5a79ce570805ad7d2220c836 Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Tue, 6 Jun 2023 16:16:47 -0700 Subject: [PATCH 2/4] Address review comments Signed-off-by: Suraj Singh --- distribution/build.gradle | 2 +- gradle/runtime-jdk-provision.gradle | 2 +- .../indices/replication/SegmentReplicationIT.java | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/distribution/build.gradle b/distribution/build.gradle index 2378ed833ead7..631813aadd615 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -283,7 +283,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { (platform == 'linux' || platform == 'darwin' ? ['x64', 'aarch64', 's390x', 'ppc64le'] : ['x64']).each { architecture -> "bundled_${platform}_${architecture}" { it.platform = platform - it.version = VersionProperties.getBundledJdk(platform, architecture) + it.version = VersionProperties.getBundledJdk(platform) it.vendor = VersionProperties.bundledJdkVendor it.architecture = architecture } diff --git a/gradle/runtime-jdk-provision.gradle b/gradle/runtime-jdk-provision.gradle index 6bff164633c25..cb4bb834f89c9 100644 --- a/gradle/runtime-jdk-provision.gradle +++ b/gradle/runtime-jdk-provision.gradle @@ -32,7 +32,7 @@ if (BuildParams.getIsRuntimeJavaHomeSet()) { jdks { provisioned_runtime { vendor = VersionProperties.bundledJdkVendor - version = VersionProperties.getBundledJdk(OS.current().name().toLowerCase(), Architecture.current().name().toLowerCase()) + version = VersionProperties.getBundledJdk(OS.current().name().toLowerCase()) platform = OS.current().name().toLowerCase() architecture = Architecture.current().name().toLowerCase() } 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 16375cb25be7f..cca3333a6e5f2 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -192,7 +192,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); From 21f319cfb67e3e1ac529d2d558a0cbfd4dae04ea Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Wed, 7 Jun 2023 11:59:37 -0700 Subject: [PATCH 3/4] Remove older lucene test Signed-off-by: Suraj Singh --- .../indices/replication/SegmentReplicationIT.java | 9 +-------- 1 file changed, 1 insertion(+), 8 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 cca3333a6e5f2..16375cb25be7f 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -192,14 +192,7 @@ public void testCancelPrimaryAllocation() throws Exception { public void testReplicationAfterPrimaryRefreshAndFlush() throws Exception { final String nodeA = internalCluster().startNode(); final String nodeB = internalCluster().startNode(); - 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); + createIndex(INDEX_NAME); ensureGreen(INDEX_NAME); final int initialDocCount = scaledRandomIntBetween(0, 200); From 6f33bd9b468d6dd559aa1d8852e7a7ad8c0b2e78 Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Wed, 7 Jun 2023 12:08:00 -0700 Subject: [PATCH 4/4] Remove older lucene test Signed-off-by: Suraj Singh --- distribution/build.gradle | 2 +- gradle/runtime-jdk-provision.gradle | 2 +- .../indices/replication/SegmentReplicationIT.java | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/distribution/build.gradle b/distribution/build.gradle index 631813aadd615..2378ed833ead7 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -283,7 +283,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { (platform == 'linux' || platform == 'darwin' ? ['x64', 'aarch64', 's390x', 'ppc64le'] : ['x64']).each { architecture -> "bundled_${platform}_${architecture}" { it.platform = platform - it.version = VersionProperties.getBundledJdk(platform) + it.version = VersionProperties.getBundledJdk(platform, architecture) it.vendor = VersionProperties.bundledJdkVendor it.architecture = architecture } diff --git a/gradle/runtime-jdk-provision.gradle b/gradle/runtime-jdk-provision.gradle index cb4bb834f89c9..6bff164633c25 100644 --- a/gradle/runtime-jdk-provision.gradle +++ b/gradle/runtime-jdk-provision.gradle @@ -32,7 +32,7 @@ if (BuildParams.getIsRuntimeJavaHomeSet()) { jdks { provisioned_runtime { vendor = VersionProperties.bundledJdkVendor - version = VersionProperties.getBundledJdk(OS.current().name().toLowerCase()) + version = VersionProperties.getBundledJdk(OS.current().name().toLowerCase(), Architecture.current().name().toLowerCase()) platform = OS.current().name().toLowerCase() architecture = Architecture.current().name().toLowerCase() } 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 16375cb25be7f..1daac295630ff 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -42,7 +42,6 @@ import org.opensearch.cluster.routing.ShardRouting; import org.opensearch.cluster.routing.ShardRoutingState; import org.opensearch.cluster.routing.allocation.command.CancelAllocationCommand; -import org.opensearch.common.io.PathUtils; import org.opensearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; import org.opensearch.common.settings.Settings; @@ -53,7 +52,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; @@ -74,7 +75,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.concurrent.CountDownLatch; @@ -192,7 +192,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);