From 65fe29cb38d682b5b2e90cc5259ede894ae5a422 Mon Sep 17 00:00:00 2001 From: Ashish Singh Date: Tue, 16 Aug 2022 14:09:29 +0530 Subject: [PATCH] Revert "Adds NoOp code behind feature flag" This reverts commit ebc57ca71a57ecac72845259b1f50dc2ef61f1a0. Signed-off-by: Ashish Singh --- .../java/org/opensearch/common/util/FeatureFlags.java | 8 -------- .../index/engine/NRTReplicationEngineFactory.java | 3 +-- .../java/org/opensearch/common/util/FeatureFlagTests.java | 7 ------- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/server/src/main/java/org/opensearch/common/util/FeatureFlags.java b/server/src/main/java/org/opensearch/common/util/FeatureFlags.java index 894239a6d1913..fa39dc9ac5aa0 100644 --- a/server/src/main/java/org/opensearch/common/util/FeatureFlags.java +++ b/server/src/main/java/org/opensearch/common/util/FeatureFlags.java @@ -29,14 +29,6 @@ public class FeatureFlags { */ public static final String REMOTE_STORE = "opensearch.experimental.feature.remote_store.enabled"; - /** - * Gates the availability of the NoOpReplicationEngine to isolate development stage bugs that can hinder parallel - * development efforts around Remote Segment, Translog and SegRep. However, this setting will take effect iff when - * the above 2 flags {@value REPLICATION_TYPE} and {@value REMOTE_STORE} are enabled with an index with segrep and - * remote store both enabled. - */ - public static final String NOOP_REPLICATION_ENGINE = "opensearch.experimental.feature.noop_replication_engine.enabled"; - /** * Used to test feature flags whose values are expected to be booleans. * This method returns true if the value is "true" (case-insensitive), diff --git a/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngineFactory.java b/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngineFactory.java index 5ddd81bf4e62b..dd8ba139da706 100644 --- a/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngineFactory.java +++ b/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngineFactory.java @@ -10,7 +10,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.opensearch.common.util.FeatureFlags; /** * Engine Factory implementation used with Segment Replication that wires up replica shards with an ${@link NRTReplicationEngine} @@ -26,7 +25,7 @@ public class NRTReplicationEngineFactory implements EngineFactory { public Engine newReadWriteEngine(EngineConfig config) { Engine engine; if (config.isReadOnlyReplica()) { - if (FeatureFlags.isEnabled(FeatureFlags.NOOP_REPLICATION_ENGINE) && config.getIndexSettings().isRemoteStoreEnabled()) { + if (config.getIndexSettings().isRemoteStoreEnabled()) { engine = new NRTReplicationNoOpEngine(config); } else { engine = new NRTReplicationEngine(config); diff --git a/server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java b/server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java index eb6a239d3145b..a4f2b242564e2 100644 --- a/server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java +++ b/server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java @@ -22,7 +22,6 @@ public class FeatureFlagTests extends OpenSearchTestCase { public static void enableFeature() { AccessController.doPrivileged((PrivilegedAction) () -> System.setProperty(FeatureFlags.REPLICATION_TYPE, "true")); AccessController.doPrivileged((PrivilegedAction) () -> System.setProperty(FeatureFlags.REMOTE_STORE, "true")); - AccessController.doPrivileged((PrivilegedAction) () -> System.setProperty(FeatureFlags.NOOP_REPLICATION_ENGINE, "true")); } public void testReplicationTypeFeatureFlag() { @@ -48,10 +47,4 @@ public void testRemoteStoreFeatureFlag() { assertNotNull(System.getProperty(remoteStoreFlag)); assertTrue(FeatureFlags.isEnabled(remoteStoreFlag)); } - - public void testNoopReplicationEngineFeatureFlag() { - String noopReplicationEngineFlag = FeatureFlags.NOOP_REPLICATION_ENGINE; - assertNotNull(System.getProperty(noopReplicationEngineFlag)); - assertTrue(FeatureFlags.isEnabled(noopReplicationEngineFlag)); - } }