Skip to content

Commit

Permalink
Address comments on PR and chnage feature flag to SEGMENT_REPLICATION…
Browse files Browse the repository at this point in the history
…_EXPERIMENTAL.

Signed-off-by: Rishikesh1159 <[email protected]>
  • Loading branch information
Rishikesh1159 committed Apr 6, 2023
1 parent f816fa2 commit 20c2546
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Settings indexSettings() {
protected Settings featureFlagSettings() {
return Settings.builder()
.put(super.featureFlagSettings())
.put(FeatureFlags.SEGMENT_REPLICATION_CLUSTER_SETTING, "true")
.put(FeatureFlags.SEGMENT_REPLICATION_EXPERIMENTAL, "true")
.put(FeatureFlags.REPLICATION_TYPE, "true")
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ public void apply(Settings value, Settings current, Settings previous) {
public static final Map<String, List<Setting>> FEATURE_FLAGGED_CLUSTER_SETTINGS = Map.of(
FeatureFlags.SEARCHABLE_SNAPSHOT,
List.of(Node.NODE_SEARCH_CACHE_SIZE_SETTING),
FeatureFlags.SEGMENT_REPLICATION_CLUSTER_SETTING,
FeatureFlags.SEGMENT_REPLICATION_EXPERIMENTAL,
List.of(IndicesService.CLUSTER_REPLICATION_TYPE_SETTING)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected FeatureFlagSettings(
new HashSet<>(
Arrays.asList(
FeatureFlags.REPLICATION_TYPE_SETTING,
FeatureFlags.REPLICATION_TYPE_SEGMENT_REPLICATION_CLUSTER_SETTING,
FeatureFlags.SEGMENT_REPLICATION_EXPERIMENTAL_SETTING,
FeatureFlags.REMOTE_STORE_SETTING,
FeatureFlags.SEARCHABLE_SNAPSHOT_SETTING,
FeatureFlags.EXTENSIONS_SETTING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ public class FeatureFlags {
public static final String REPLICATION_TYPE = "opensearch.experimental.feature.replication_type.enabled";

/**
* Gates the visibility of the segment replication cluster setting that allows changing of default replication type in a cluster.
* Once the feature is ready for production release, this feature flag can be removed.
* Gates the visibility of the segment replication experimental features that allows users to test unreleased beta features.
*/
public static final String SEGMENT_REPLICATION_CLUSTER_SETTING =
"opensearch.experimental.feature.segment_replication.cluster_setting.enabled";
public static final String SEGMENT_REPLICATION_EXPERIMENTAL =
"opensearch.experimental.feature.segment_replication_experimental.enabled";

/**
* Gates the visibility of the index setting that allows persisting data to remote store along with local disk.
Expand Down Expand Up @@ -91,8 +90,8 @@ public static boolean isEnabled(String featureFlagName) {

public static final Setting<Boolean> REPLICATION_TYPE_SETTING = Setting.boolSetting(REPLICATION_TYPE, false, Property.NodeScope);

public static final Setting<Boolean> REPLICATION_TYPE_SEGMENT_REPLICATION_CLUSTER_SETTING = Setting.boolSetting(
SEGMENT_REPLICATION_CLUSTER_SETTING,
public static final Setting<Boolean> SEGMENT_REPLICATION_EXPERIMENTAL_SETTING = Setting.boolSetting(
SEGMENT_REPLICATION_EXPERIMENTAL,
false,
Property.NodeScope
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
nodeName = Node.NODE_NAME_SETTING.get(settings);
this.indexMetadata = indexMetadata;
numberOfShards = settings.getAsInt(IndexMetadata.SETTING_NUMBER_OF_SHARDS, null);
if (FeatureFlags.isEnabled(FeatureFlags.SEGMENT_REPLICATION_CLUSTER_SETTING)
if (FeatureFlags.isEnabled(FeatureFlags.SEGMENT_REPLICATION_EXPERIMENTAL)
&& indexMetadata.isSystem() == false
&& settings.get(IndexMetadata.SETTING_REPLICATION_TYPE) == null) {
replicationType = IndicesService.CLUSTER_REPLICATION_TYPE_SETTING.get(settings);
Expand Down

0 comments on commit 20c2546

Please sign in to comment.