Skip to content

Commit ec4b8d8

Browse files
committed
Revert "Allow partial results by default in ES|QL (#125060)"
This reverts commit 81555cc.
1 parent 7402dfd commit ec4b8d8

File tree

19 files changed

+54
-109
lines changed

19 files changed

+54
-109
lines changed

docs/changelog/125060.yaml

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

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
);

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

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -198,26 +198,17 @@ public void testIndicesDontExist() throws IOException {
198198
int docsTest1 = 0; // we are interested only in the created index, not necessarily that it has data
199199
indexTimestampData(docsTest1, "test1", "2024-11-26", "id1");
200200

201-
ResponseException e = expectThrows(
202-
ResponseException.class,
203-
() -> runEsql(timestampFilter("gte", "2020-01-01").query(from("foo")).allowPartialResults(false))
204-
);
201+
ResponseException e = expectThrows(ResponseException.class, () -> runEsql(timestampFilter("gte", "2020-01-01").query(from("foo"))));
205202
assertEquals(400, e.getResponse().getStatusLine().getStatusCode());
206203
assertThat(e.getMessage(), containsString("verification_exception"));
207204
assertThat(e.getMessage(), anyOf(containsString("Unknown index [foo]"), containsString("Unknown index [remote_cluster:foo]")));
208205

209-
e = expectThrows(
210-
ResponseException.class,
211-
() -> runEsql(timestampFilter("gte", "2020-01-01").query(from("foo*")).allowPartialResults(false))
212-
);
206+
e = expectThrows(ResponseException.class, () -> runEsql(timestampFilter("gte", "2020-01-01").query(from("foo*"))));
213207
assertEquals(400, e.getResponse().getStatusLine().getStatusCode());
214208
assertThat(e.getMessage(), containsString("verification_exception"));
215209
assertThat(e.getMessage(), anyOf(containsString("Unknown index [foo*]"), containsString("Unknown index [remote_cluster:foo*]")));
216210

217-
e = expectThrows(
218-
ResponseException.class,
219-
() -> runEsql(timestampFilter("gte", "2020-01-01").query(from("foo", "test1")).allowPartialResults(false))
220-
);
211+
e = expectThrows(ResponseException.class, () -> runEsql(timestampFilter("gte", "2020-01-01").query(from("foo", "test1"))));
221212
assertEquals(404, e.getResponse().getStatusLine().getStatusCode());
222213
assertThat(e.getMessage(), containsString("index_not_found_exception"));
223214
assertThat(e.getMessage(), anyOf(containsString("no such index [foo]"), containsString("no such index [remote_cluster:foo]")));
@@ -226,7 +217,7 @@ public void testIndicesDontExist() throws IOException {
226217
var pattern = from("test1");
227218
e = expectThrows(
228219
ResponseException.class,
229-
() -> runEsql(timestampFilter("gte", "2020-01-01").query(pattern + " | LOOKUP JOIN foo ON id1").allowPartialResults(false))
220+
() -> runEsql(timestampFilter("gte", "2020-01-01").query(pattern + " | LOOKUP JOIN foo ON id1"))
230221
);
231222
assertEquals(400, e.getResponse().getStatusLine().getStatusCode());
232223
assertThat(

0 commit comments

Comments
 (0)