Skip to content

Commit

Permalink
Revert "Adds NoOp code behind feature flag"
Browse files Browse the repository at this point in the history
This reverts commit ebc57ca71a57ecac72845259b1f50dc2ef61f1a0.

Signed-off-by: Ashish Singh <[email protected]>
  • Loading branch information
ashking94 committed Aug 16, 2022
1 parent 974ba60 commit 65fe29c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class FeatureFlagTests extends OpenSearchTestCase {
public static void enableFeature() {
AccessController.doPrivileged((PrivilegedAction<String>) () -> System.setProperty(FeatureFlags.REPLICATION_TYPE, "true"));
AccessController.doPrivileged((PrivilegedAction<String>) () -> System.setProperty(FeatureFlags.REMOTE_STORE, "true"));
AccessController.doPrivileged((PrivilegedAction<String>) () -> System.setProperty(FeatureFlags.NOOP_REPLICATION_ENGINE, "true"));
}

public void testReplicationTypeFeatureFlag() {
Expand All @@ -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));
}
}

0 comments on commit 65fe29c

Please sign in to comment.