Skip to content

Commit fa322de

Browse files
astute-decipherShubh Sahu
andauthored
Removing feature flags for tiered storage settings (#20996)
* Removing feature flags for tiered storage settings Signed-off-by: Shubh Sahu <shubhvs@amazon.com> * Updating the IT Signed-off-by: Shubh Sahu <shubhvs@amazon.com> --------- Signed-off-by: Shubh Sahu <shubhvs@amazon.com> Co-authored-by: Shubh Sahu <shubhvs@amazon.com>
1 parent 311d711 commit fa322de

2 files changed

Lines changed: 11 additions & 20 deletions

File tree

server/src/internalClusterTest/java/org/opensearch/remotestore/WritableWarmIT.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.opensearch.action.search.SearchResponse;
2323
import org.opensearch.cluster.metadata.IndexMetadata;
2424
import org.opensearch.common.settings.Settings;
25-
import org.opensearch.common.settings.SettingsException;
2625
import org.opensearch.common.util.FeatureFlags;
2726
import org.opensearch.core.common.unit.ByteSizeUnit;
2827
import org.opensearch.core.common.unit.ByteSizeValue;
@@ -89,7 +88,7 @@ protected Settings nodeSettings(int nodeOrdinal) {
8988
.build();
9089
}
9190

92-
public void testWritableWarmFeatureFlagDisabled() {
91+
public void testWritableWarmSettingAcceptedWhenFeatureFlagDisabled() {
9392
Settings clusterSettings = Settings.builder()
9493
.put(super.nodeSettings(0))
9594
.put(FeatureFlags.WRITABLE_WARM_INDEX_EXPERIMENTAL_FLAG, false)
@@ -105,18 +104,9 @@ public void testWritableWarmFeatureFlagDisabled() {
105104
.put(IndexModule.IS_WARM_INDEX_SETTING.getKey(), false)
106105
.build();
107106

108-
try {
109-
prepareCreate(INDEX_NAME).setSettings(indexSettings).get();
110-
fail("Should have thrown Exception as setting should not be registered if Feature Flag is Disabled");
111-
} catch (SettingsException ex) {
112-
assertEquals(
113-
"unknown setting ["
114-
+ IndexModule.IS_WARM_INDEX_SETTING.getKey()
115-
+ "] please check that any required plugins are installed, or check the "
116-
+ "breaking changes documentation for removed settings",
117-
ex.getMessage()
118-
);
119-
}
107+
// Setting is now always registered (built-in), so index creation should succeed
108+
// even when the feature flag is disabled
109+
assertAcked(prepareCreate(INDEX_NAME).setSettings(indexSettings).get());
120110
}
121111

122112
public void testWritableWarmBasic() throws Exception {

server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.opensearch.common.annotation.PublicApi;
4242
import org.opensearch.common.logging.Loggers;
4343
import org.opensearch.common.settings.Setting.Property;
44-
import org.opensearch.common.util.FeatureFlags;
4544
import org.opensearch.index.IndexModule;
4645
import org.opensearch.index.IndexSettings;
4746
import org.opensearch.index.IndexSortConfig;
@@ -305,6 +304,12 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
305304
IndexSettings.INDEX_DERIVED_SOURCE_SETTING,
306305
IndexSettings.INDEX_DERIVED_SOURCE_TRANSLOG_ENABLED_SETTING,
307306

307+
// Writable warm / tiering settings - always registered so nodes can parse
308+
// index metadata even when the feature flag is disabled
309+
IndexModule.INDEX_STORE_LOCALITY_SETTING,
310+
IndexModule.INDEX_TIERING_STATE,
311+
IndexModule.IS_WARM_INDEX_SETTING,
312+
308313
// validate that built-in similarities don't get redefined
309314
Setting.groupSetting("index.similarity.", (s) -> {
310315
Map<String, Settings> groups = s.getAsGroups();
@@ -327,11 +332,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
327332
* is ready for production release, the feature flag can be removed, and the
328333
* setting should be moved to {@link #BUILT_IN_INDEX_SETTINGS}.
329334
*/
330-
public static final Map<String, List<Setting>> FEATURE_FLAGGED_INDEX_SETTINGS = Map.of(
331-
FeatureFlags.WRITABLE_WARM_INDEX_EXPERIMENTAL_FLAG,
332-
// TODO: Create a separate feature flag for hot tiering index state.
333-
List.of(IndexModule.INDEX_STORE_LOCALITY_SETTING, IndexModule.INDEX_TIERING_STATE, IndexModule.IS_WARM_INDEX_SETTING)
334-
);
335+
public static final Map<String, List<Setting>> FEATURE_FLAGGED_INDEX_SETTINGS = Map.of();
335336

336337
public static final IndexScopedSettings DEFAULT_SCOPED_SETTINGS = new IndexScopedSettings(Settings.EMPTY, BUILT_IN_INDEX_SETTINGS);
337338

0 commit comments

Comments
 (0)