Skip to content

Commit 8f38b13

Browse files
authored
ESQL: Revert "Allow partial results by default in ES|QL (#125060)" (#126286)
This reverts commit 81555cc from #125060. Fix #126275 @idegtiarenko and I investigated and believe this needs reverting: silently dropping results from the query response in case any index is missing can lead to real problems if users don't spot their mistake. I'm also not sure if all the results will get dropped, or only from some nodes/shards/clusters, meaning that this might be hard to spot by users if only some results get dropped. The main PR has no transport version bump, no new ESQL capability, and was merged 15h ago - so it should be safe to just revert it. I noticed there was a linked Serverless PR on the original PR, but it merely disabled some obsolete tests on Serverless and doesn't require reverting itself.
1 parent a58d8e0 commit 8f38b13

File tree

19 files changed

+60
-100
lines changed

19 files changed

+60
-100
lines changed

docs/changelog/125060.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/changelog/126286.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 126286
2+
summary: Revert "Allow partial results by default in ES|QL"
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 126275

docs/release-notes/breaking-changes.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ To learn how to upgrade, check out <uprade docs>.
1414

1515
% ## Next version [elasticsearch-nextversion-breaking-changes]
1616

17-
## 9.1.0 [elasticsearch-910-breaking-changes]
18-
19-
ES|QL
20-
: * Allow partial results by default in ES|QL [#125060](https://github.com/elastic/elasticsearch/pull/125060)
21-
2217
## 9.0.0 [elasticsearch-900-breaking-changes]
2318

2419
Allocation

test/external-modules/esql-heap-attack/src/javaRestTest/java/org/elasticsearch/xpack/esql/heap_attack/Clusters.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ static ElasticsearchCluster buildCluster() {
2121
.module("test-esql-heap-attack")
2222
.setting("xpack.security.enabled", "false")
2323
.setting("xpack.license.self_generated.type", "trial")
24-
.setting("esql.query.allow_partial_results", "false")
2524
.jvmArg("-Xmx512m");
2625
String javaVersion = JvmInfo.jvmInfo().version();
2726
if (javaVersion.equals("20") || javaVersion.equals("21")) {

x-pack/plugin/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ tasks.named("yamlRestCompatTestTransform").configure({ task ->
124124
task.skipTest("ml/post_data/Test POST data job api, flush, close and verify DataCounts doc", "Flush API is deprecated")
125125
task.replaceValueInMatch("Size", 49, "Test flamegraph from profiling-events")
126126
task.replaceValueInMatch("Size", 49, "Test flamegraph from test-events")
127-
task.skipTest("esql/63_enrich_int_range/Invalid age as double", "TODO: require disable allow_partial_results")
128127
})
129128

130129
tasks.named('yamlRestCompatTest').configure {

x-pack/plugin/esql/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/esql/EsqlSecurityIT.java

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,7 @@ public void testIndexPatternErrorMessageComparison_ESQL_SearchDSL() throws Excep
312312
searchRequest.setOptions(RequestOptions.DEFAULT.toBuilder().addHeader("es-security-runas-user", "metadata1_read2"));
313313

314314
// ES|QL query on the same index pattern
315-
var esqlResp = expectThrows(
316-
ResponseException.class,
317-
() -> runESQLCommand("metadata1_read2", "FROM index-user1,index-user2", false)
318-
);
315+
var esqlResp = expectThrows(ResponseException.class, () -> runESQLCommand("metadata1_read2", "FROM index-user1,index-user2"));
319316
var srchResp = expectThrows(ResponseException.class, () -> client().performRequest(searchRequest));
320317

321318
for (ResponseException r : List.of(esqlResp, srchResp)) {
@@ -334,8 +331,7 @@ public void testLimitedPrivilege() throws Exception {
334331
ResponseException.class,
335332
() -> runESQLCommand(
336333
"metadata1_read2",
337-
"FROM index-user1,index-user2 METADATA _index | STATS sum=sum(value), index=VALUES(_index)",
338-
false
334+
"FROM index-user1,index-user2 METADATA _index | STATS sum=sum(value), index=VALUES(_index)"
339335
)
340336
);
341337
assertThat(
@@ -348,7 +344,7 @@ public void testLimitedPrivilege() throws Exception {
348344

349345
resp = expectThrows(
350346
ResponseException.class,
351-
() -> runESQLCommand("metadata1_read2", "FROM index-user1,index-user2 METADATA _index | STATS index=VALUES(_index)", false)
347+
() -> runESQLCommand("metadata1_read2", "FROM index-user1,index-user2 METADATA _index | STATS index=VALUES(_index)")
352348
);
353349
assertThat(
354350
EntityUtils.toString(resp.getResponse().getEntity()),
@@ -360,7 +356,7 @@ public void testLimitedPrivilege() throws Exception {
360356

361357
resp = expectThrows(
362358
ResponseException.class,
363-
() -> runESQLCommand("metadata1_read2", "FROM index-user1,index-user2 | STATS sum=sum(value)", false)
359+
() -> runESQLCommand("metadata1_read2", "FROM index-user1,index-user2 | STATS sum=sum(value)")
364360
);
365361
assertThat(
366362
EntityUtils.toString(resp.getResponse().getEntity()),
@@ -372,7 +368,7 @@ public void testLimitedPrivilege() throws Exception {
372368

373369
resp = expectThrows(
374370
ResponseException.class,
375-
() -> runESQLCommand("alias_user1", "FROM first-alias,index-user1 METADATA _index | KEEP _index, org, value | LIMIT 10", false)
371+
() -> runESQLCommand("alias_user1", "FROM first-alias,index-user1 METADATA _index | KEEP _index, org, value | LIMIT 10")
376372
);
377373
assertThat(
378374
EntityUtils.toString(resp.getResponse().getEntity()),
@@ -386,8 +382,7 @@ public void testLimitedPrivilege() throws Exception {
386382
ResponseException.class,
387383
() -> runESQLCommand(
388384
"alias_user2",
389-
"from second-alias,index-user2 METADATA _index | stats sum=sum(value), index=VALUES(_index)",
390-
false
385+
"from second-alias,index-user2 METADATA _index | stats sum=sum(value), index=VALUES(_index)"
391386
)
392387
);
393388
assertThat(
@@ -831,10 +826,6 @@ public void testDataStream() throws IOException {
831826
}
832827

833828
protected Response runESQLCommand(String user, String command) throws IOException {
834-
return runESQLCommand(user, command, null);
835-
}
836-
837-
protected Response runESQLCommand(String user, String command, Boolean allowPartialResults) throws IOException {
838829
if (command.toLowerCase(Locale.ROOT).contains("limit") == false) {
839830
// add a (high) limit to avoid warnings on default limit
840831
command += " | limit 10000000";
@@ -848,9 +839,6 @@ protected Response runESQLCommand(String user, String command, Boolean allowPart
848839
request.setJsonEntity(Strings.toString(json));
849840
request.setOptions(RequestOptions.DEFAULT.toBuilder().addHeader("es-security-runas-user", user));
850841
request.addParameter("error_trace", "true");
851-
if (allowPartialResults != null) {
852-
request.addParameter("allow_partial_results", Boolean.toString(allowPartialResults));
853-
}
854842
return client().performRequest(request);
855843
}
856844

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/EsqlRestValidationIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ private RestClient remoteClusterClient() throws IOException {
8383

8484
@Before
8585
public void skipTestOnOldVersions() {
86-
assumeTrue("skip on old versions", Clusters.localClusterVersion().equals(Version.V_8_19_0));
86+
assumeTrue("skip on old versions", Clusters.localClusterVersion().equals(Version.V_8_16_0));
8787
}
8888
}

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/RequestIndexFilteringIT.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.junit.rules.TestRule;
2929

3030
import java.io.IOException;
31-
import java.util.List;
3231
import java.util.Map;
3332

3433
import static org.elasticsearch.test.MapMatcher.assertMap;
@@ -88,12 +87,6 @@ protected String from(String... indexName) {
8887

8988
@Override
9089
public Map<String, Object> runEsql(RestEsqlTestCase.RequestObjectBuilder requestObject) throws IOException {
91-
if (requestObject.allowPartialResults() != null) {
92-
assumeTrue(
93-
"require allow_partial_results on local cluster",
94-
clusterHasCapability("POST", "/_query", List.of(), List.of("support_partial_results")).orElse(false)
95-
);
96-
}
9790
requestObject.includeCCSMetadata(true);
9891
return super.runEsql(requestObject);
9992
}

x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/RestEsqlIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void testInvalidPragma() throws IOException {
111111
request.setJsonEntity("{\"f\":" + i + "}");
112112
assertOK(client().performRequest(request));
113113
}
114-
RequestObjectBuilder builder = requestObjectBuilder().query("from test-index | limit 1 | keep f").allowPartialResults(false);
114+
RequestObjectBuilder builder = requestObjectBuilder().query("from test-index | limit 1 | keep f");
115115
builder.pragmas(Settings.builder().put("data_partitioning", "invalid-option").build());
116116
ResponseException re = expectThrows(ResponseException.class, () -> runEsqlSync(builder));
117117
assertThat(EntityUtils.toString(re.getResponse().getEntity()), containsString("No enum constant"));

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/EsqlRestValidationTestCase.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ private Request createRequest(String indexName) throws IOException {
129129
final var request = new Request("POST", "/_query");
130130
request.addParameter("error_trace", "true");
131131
request.addParameter("pretty", "true");
132-
request.addParameter("allow_partial_results", Boolean.toString(false));
133132
request.setJsonEntity(
134133
Strings.toString(JsonXContent.contentBuilder().startObject().field("query", "from " + indexName).endObject())
135134
);

0 commit comments

Comments
 (0)