Skip to content

Commit 11ed2b4

Browse files
[Star tree] Remove star tree feature flag and add index setting to configure star tree search on index basis (opensearch-project#18070)
* Removing star tree indexing and queries added till 2.19 out of experimental Signed-off-by: bharath-techie <[email protected]> * Removing star tree feature flag Signed-off-by: bharath-techie <[email protected]> * Adding more tests for feature flag Signed-off-by: bharath-techie <[email protected]> * Adding Changelog Signed-off-by: bharath-techie <[email protected]> * addressing review comment Signed-off-by: bharath-techie <[email protected]> * resolving conflicts Signed-off-by: bharath-techie <[email protected]> --------- Signed-off-by: bharath-techie <[email protected]>Signed-off-by: TJ Neuenfeldt <[email protected]>
1 parent fb47fcb commit 11ed2b4

File tree

30 files changed

+133
-235
lines changed

30 files changed

+133
-235
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4545
- Add FIPS build tooling ([#4254](https://github.com/opensearch-project/security/issues/4254))
4646
- Support Nested Aggregations as part of Star-Tree ([#18048](https://github.com/opensearch-project/OpenSearch/pull/18048))
4747
- [Star-Tree] Support for date-range queries with star-tree supported aggregations ([#17855](https://github.com/opensearch-project/OpenSearch/pull/17855)
48+
- [Star tree] Remove star tree feature flag and add index setting to configure star tree search on index basis ([#18070](https://github.com/opensearch-project/OpenSearch/pull/18070))
4849
- Approximation Framework Enhancement: Update the BKD traversal logic to improve the performance on skewed data ([#18439](https://github.com/opensearch-project/OpenSearch/issues/18439))
4950

5051
### Changed

distribution/src/config/opensearch.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,3 @@ ${path.logs}
121121
# Once there is no observed impact on performance, this feature flag can be removed.
122122
#
123123
#opensearch.experimental.optimization.datetime_formatter_caching.enabled: false
124-
#
125-
# Gates the functionality of star tree index, which improves the performance of search aggregations.
126-
#
127-
#opensearch.experimental.feature.composite_index.star_tree.enabled: true

modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldMapperTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
import java.util.List;
5757

5858
import static java.util.Collections.singletonList;
59-
import static org.opensearch.common.util.FeatureFlags.STAR_TREE_INDEX;
6059
import static org.hamcrest.Matchers.containsString;
6160

6261
public class ScaledFloatFieldMapperTests extends MapperTestCase {
@@ -104,7 +103,6 @@ public void testExistsQueryDocValuesDisabled() throws IOException {
104103
assertParseMinimalWarnings();
105104
}
106105

107-
@LockFeatureFlag(STAR_TREE_INDEX)
108106
public void testScaledFloatWithStarTree() throws Exception {
109107

110108
double scalingFactorField1 = randomDouble() * 100;

server/src/internalClusterTest/java/org/opensearch/index/mapper/StarTreeMapperIT.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.opensearch.cluster.metadata.IndexMetadata;
1616
import org.opensearch.common.Rounding;
1717
import org.opensearch.common.settings.Settings;
18-
import org.opensearch.common.util.FeatureFlags;
1918
import org.opensearch.core.common.unit.ByteSizeUnit;
2019
import org.opensearch.core.common.unit.ByteSizeValue;
2120
import org.opensearch.core.index.Index;
@@ -581,11 +580,6 @@ private static String getMetric(boolean hasDocValues, boolean isKeyword) {
581580
return "numeric_dv";
582581
}
583582

584-
@Override
585-
protected Settings featureFlagSettings() {
586-
return Settings.builder().put(super.featureFlagSettings()).put(FeatureFlags.STAR_TREE_INDEX, "true").build();
587-
}
588-
589583
@Before
590584
public final void setupNodeSettings() {
591585
Settings request = Settings.builder().put(CompositeIndexSettings.STAR_TREE_INDEX_ENABLED_SETTING.getKey(), true).build();

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ protected FeatureFlagSettings(
3535
FeatureFlags.DATETIME_FORMATTER_CACHING_SETTING,
3636
FeatureFlags.WRITABLE_WARM_INDEX_SETTING,
3737
FeatureFlags.REMOTE_STORE_MIGRATION_EXPERIMENTAL_SETTING,
38-
FeatureFlags.STAR_TREE_INDEX_SETTING,
3938
FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES_SETTING,
4039
FeatureFlags.TERM_VERSION_PRECOMMIT_ENABLE_SETTING,
4140
FeatureFlags.ARROW_STREAMS_SETTING,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
260260
StarTreeIndexSettings.STAR_TREE_MAX_DATE_INTERVALS_SETTING,
261261
StarTreeIndexSettings.STAR_TREE_MAX_BASE_METRICS_SETTING,
262262
StarTreeIndexSettings.IS_COMPOSITE_INDEX_SETTING,
263+
StarTreeIndexSettings.STAR_TREE_SEARCH_ENABLED_SETTING,
263264

264265
IndexSettings.INDEX_CONTEXT_CREATED_VERSION,
265266
IndexSettings.INDEX_CONTEXT_CURRENT_VERSION,

server/src/main/java/org/opensearch/common/util/FeatureFlags.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,6 @@ public class FeatureFlags {
109109
Property.NodeScope
110110
);
111111

112-
/**
113-
* Gates the functionality of star tree index, which improves the performance of search
114-
* aggregations.
115-
*/
116-
public static final String STAR_TREE_INDEX = FEATURE_FLAG_PREFIX + "composite_index.star_tree.enabled";
117-
public static final Setting<Boolean> STAR_TREE_INDEX_SETTING = Setting.boolSetting(STAR_TREE_INDEX, false, Property.NodeScope);
118-
119112
/**
120113
* Gates the functionality of application based configuration templates.
121114
*/
@@ -154,7 +147,6 @@ static class FeatureFlagsImpl {
154147
put(TELEMETRY_SETTING, TELEMETRY_SETTING.getDefault(Settings.EMPTY));
155148
put(DATETIME_FORMATTER_CACHING_SETTING, DATETIME_FORMATTER_CACHING_SETTING.getDefault(Settings.EMPTY));
156149
put(WRITABLE_WARM_INDEX_SETTING, WRITABLE_WARM_INDEX_SETTING.getDefault(Settings.EMPTY));
157-
put(STAR_TREE_INDEX_SETTING, STAR_TREE_INDEX_SETTING.getDefault(Settings.EMPTY));
158150
put(
159151
APPLICATION_BASED_CONFIGURATION_TEMPLATES_SETTING,
160152
APPLICATION_BASED_CONFIGURATION_TEMPLATES_SETTING.getDefault(Settings.EMPTY)

server/src/main/java/org/opensearch/index/IndexSettings.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,16 @@ private void setRetentionLeaseMillis(final TimeValue retentionLease) {
930930
*/
931931
private volatile double docIdFuzzySetFalsePositiveProbability;
932932

933+
/**
934+
* Denotes whether this is a composite index i.e star-tree index etc
935+
*/
933936
private final boolean isCompositeIndex;
934937

938+
/**
939+
* Denotes whether search via star tree index is enabled for this index
940+
*/
941+
private volatile boolean isStarTreeIndexEnabled;
942+
935943
/**
936944
* Returns the default search fields for this index.
937945
*/
@@ -1096,6 +1104,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
10961104
setEnableFuzzySetForDocId(scopedSettings.get(INDEX_DOC_ID_FUZZY_SET_ENABLED_SETTING));
10971105
setDocIdFuzzySetFalsePositiveProbability(scopedSettings.get(INDEX_DOC_ID_FUZZY_SET_FALSE_POSITIVE_PROBABILITY_SETTING));
10981106
isCompositeIndex = scopedSettings.get(StarTreeIndexSettings.IS_COMPOSITE_INDEX_SETTING);
1107+
isStarTreeIndexEnabled = scopedSettings.get(StarTreeIndexSettings.STAR_TREE_SEARCH_ENABLED_SETTING);
10991108
scopedSettings.addSettingsUpdateConsumer(
11001109
TieredMergePolicyProvider.INDEX_COMPOUND_FORMAT_SETTING,
11011110
tieredMergePolicyProvider::setNoCFSRatio
@@ -1220,6 +1229,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
12201229
IndexMetadata.INDEX_REMOTE_TRANSLOG_REPOSITORY_SETTING,
12211230
this::setRemoteStoreTranslogRepository
12221231
);
1232+
scopedSettings.addSettingsUpdateConsumer(StarTreeIndexSettings.STAR_TREE_SEARCH_ENABLED_SETTING, this::setStarTreeIndexEnabled);
12231233
}
12241234

12251235
private void setSearchIdleAfter(TimeValue searchIdleAfter) {
@@ -1790,6 +1800,14 @@ public long getGcDeletesInMillis() {
17901800
return gcDeletesInMillis;
17911801
}
17921802

1803+
public void setStarTreeIndexEnabled(boolean value) {
1804+
this.isStarTreeIndexEnabled = value;
1805+
}
1806+
1807+
public boolean getStarTreeIndexEnabled() {
1808+
return isStarTreeIndexEnabled;
1809+
}
1810+
17931811
/**
17941812
* Returns the merge policy that should be used for this index.
17951813
*

server/src/main/java/org/opensearch/index/compositeindex/CompositeIndexSettings.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.opensearch.common.settings.ClusterSettings;
1313
import org.opensearch.common.settings.Setting;
1414
import org.opensearch.common.settings.Settings;
15-
import org.opensearch.common.util.FeatureFlags;
1615
import org.opensearch.core.common.unit.ByteSizeUnit;
1716
import org.opensearch.core.common.unit.ByteSizeValue;
1817

@@ -25,16 +24,7 @@
2524
public class CompositeIndexSettings {
2625
public static final Setting<Boolean> STAR_TREE_INDEX_ENABLED_SETTING = Setting.boolSetting(
2726
"indices.composite_index.star_tree.enabled",
28-
false,
29-
value -> {
30-
if (FeatureFlags.isEnabled(FeatureFlags.STAR_TREE_INDEX_SETTING) == false && value == true) {
31-
throw new IllegalArgumentException(
32-
"star tree index is under an experimental feature and can be activated only by enabling "
33-
+ FeatureFlags.STAR_TREE_INDEX_SETTING.getKey()
34-
+ " feature flag in the JVM options"
35-
);
36-
}
37-
},
27+
true,
3828
Setting.Property.NodeScope,
3929
Setting.Property.Dynamic
4030
);

server/src/main/java/org/opensearch/index/compositeindex/datacube/startree/StarTreeIndexSettings.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,11 @@ public static DateTimeUnitRounding getTimeUnit(String expression) {
134134
Setting.Property.IndexScope,
135135
Setting.Property.Final
136136
);
137+
138+
public static final Setting<Boolean> STAR_TREE_SEARCH_ENABLED_SETTING = Setting.boolSetting(
139+
"index.search.star_tree_index.enabled",
140+
true,
141+
Setting.Property.IndexScope,
142+
Setting.Property.Dynamic
143+
);
137144
}

0 commit comments

Comments
 (0)