Skip to content

Commit fb8c221

Browse files
authored
Remove feature flag from influencing the serialisation (#119875)
When serialising the `IndicesOptions` we were using the helper method `IndicesOptions#allowSelectors()` to retrieve the value of the flag `allowSelector` from the `GatekeeperOptions`. This helper method is taking into consideration the failure store feature flag to ensure we will not allow selectors unless the feature flag is enabled: ``` public boolean allowSelectors() { return DataStream.isFailureStoreFeatureFlagEnabled() && gatekeeperOptions.allowSelectors(); } ``` This was tripping this test. In this case we do not want the feature flag to influence the serialsation of the object. We only want it to be used during index name expression resolution. Fixes: #119862 Fixes: #119861 Fixes: #119860 Fixes: #119859 Fixes: #119822 Fixes: #119821 Fixes: #119820 Fixes: #119819
1 parent e64c8cf commit fb8c221

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

muted-tests.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -245,30 +245,6 @@ tests:
245245
- class: org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizerTests
246246
method: testSingleMatchOperatorFilterPushdownWithStringValues {default}
247247
issue: https://github.com/elastic/elasticsearch/issues/119721
248-
- class: org.elasticsearch.script.mustache.SearchTemplateRequestTests
249-
method: testConcurrentSerialization
250-
issue: https://github.com/elastic/elasticsearch/issues/119819
251-
- class: org.elasticsearch.script.mustache.SearchTemplateRequestTests
252-
method: testEqualsAndHashcode
253-
issue: https://github.com/elastic/elasticsearch/issues/119820
254-
- class: org.elasticsearch.script.mustache.SearchTemplateRequestTests
255-
method: testConcurrentEquals
256-
issue: https://github.com/elastic/elasticsearch/issues/119821
257-
- class: org.elasticsearch.script.mustache.SearchTemplateRequestTests
258-
method: testSerialization
259-
issue: https://github.com/elastic/elasticsearch/issues/119822
260-
- class: org.elasticsearch.index.rankeval.RankEvalRequestTests
261-
method: testSerialization
262-
issue: https://github.com/elastic/elasticsearch/issues/119859
263-
- class: org.elasticsearch.index.rankeval.RankEvalRequestTests
264-
method: testEqualsAndHashcode
265-
issue: https://github.com/elastic/elasticsearch/issues/119860
266-
- class: org.elasticsearch.index.rankeval.RankEvalRequestTests
267-
method: testConcurrentSerialization
268-
issue: https://github.com/elastic/elasticsearch/issues/119861
269-
- class: org.elasticsearch.index.rankeval.RankEvalRequestTests
270-
method: testConcurrentEquals
271-
issue: https://github.com/elastic/elasticsearch/issues/119862
272248

273249
# Examples:
274250
#

server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,8 @@ public void writeIndicesOptions(StreamOutput out) throws IOException {
884884
if (ignoreUnavailable()) {
885885
backwardsCompatibleOptions.add(Option.ALLOW_UNAVAILABLE_CONCRETE_TARGETS);
886886
}
887-
if (allowSelectors()) {
887+
// Until the feature flag is removed we access the field directly from the gatekeeper options.
888+
if (gatekeeperOptions().allowSelectors()) {
888889
if (out.getTransportVersion()
889890
.between(TransportVersions.V_8_14_0, TransportVersions.REPLACE_FAILURE_STORE_OPTIONS_WITH_SELECTOR_SYNTAX)) {
890891
backwardsCompatibleOptions.add(Option.ALLOW_FAILURE_INDICES);
@@ -1464,7 +1465,8 @@ public String toString() {
14641465
+ ignoreAliases()
14651466
+ ", ignore_throttled="
14661467
+ ignoreThrottled()
1467-
+ (DataStream.isFailureStoreFeatureFlagEnabled() ? ", allow_selectors=" + allowSelectors() : "")
1468+
// Until the feature flag is removed we access the field directly from the gatekeeper options.
1469+
+ (DataStream.isFailureStoreFeatureFlagEnabled() ? ", allow_selectors=" + gatekeeperOptions().allowSelectors() : "")
14681470
+ ']';
14691471
}
14701472
}

0 commit comments

Comments
 (0)