Skip to content

Commit 654dec2

Browse files
authored
[9.1] Revert "Put shards failure under a cap flag (#131371)" (#131542) (#131552)
* Revert "Put shards failure under a cap flag (#131371)" (#131542) This reverts commit 0411940. (cherry picked from commit be2f024) # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java * fix caps
1 parent 72bd4d9 commit 654dec2

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

test/external-modules/error-query/src/javaRestTest/java/org/elasticsearch/test/esql/EsqlPartialResultsIT.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,6 @@ public void testFailureFromRemote() throws Exception {
214214
}
215215

216216
public void testAllShardsFailed() throws Exception {
217-
assumeTrue(
218-
"fail functionality is not enabled",
219-
clusterHasCapability("POST", "/_query", List.of(), List.of("fail_if_all_shards_fail")).orElse(false)
220-
);
221217
setupRemoteClusters();
222218
populateIndices();
223219
try {
@@ -236,26 +232,6 @@ public void testAllShardsFailed() throws Exception {
236232
}
237233
}
238234

239-
public void testAllShardsFailedOldBehavior() throws Exception {
240-
// TODO: drop this once we no longer support the old behavior
241-
assumeFalse(
242-
"fail functionality is enabled",
243-
clusterHasCapability("POST", "/_query", List.of(), List.of("fail_if_all_shards_fail")).orElse(false)
244-
);
245-
setupRemoteClusters();
246-
populateIndices();
247-
try {
248-
Request request = new Request("POST", "/_query");
249-
request.setJsonEntity("{\"query\": \"FROM " + "*:failing*" + " | LIMIT 100\"}");
250-
request.addParameter("allow_partial_results", "true");
251-
Response resp = client().performRequest(request);
252-
Map<String, Object> results = entityAsMap(resp);
253-
assertThat(results.get("is_partial"), equalTo(true));
254-
} finally {
255-
removeRemoteCluster();
256-
}
257-
}
258-
259235
private void setupRemoteClusters() throws IOException {
260236
String settings = String.format(Locale.ROOT, """
261237
{

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,12 +1250,7 @@ public enum Cap {
12501250
* Forbid usage of brackets in unquoted index and enrich policy names
12511251
* https://github.com/elastic/elasticsearch/issues/130378
12521252
*/
1253-
NO_BRACKETS_IN_UNQUOTED_INDEX_NAMES,
1254-
1255-
/**
1256-
* Fail if all shards fail
1257-
*/
1258-
FAIL_IF_ALL_SHARDS_FAIL(Build.current().isSnapshot());
1253+
NO_BRACKETS_IN_UNQUOTED_INDEX_NAMES;
12591254

12601255
private final boolean enabled;
12611256

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/ComputeService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.elasticsearch.transport.RemoteClusterAware;
4848
import org.elasticsearch.transport.TransportException;
4949
import org.elasticsearch.transport.TransportService;
50-
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
5150
import org.elasticsearch.xpack.esql.action.EsqlExecutionInfo;
5251
import org.elasticsearch.xpack.esql.action.EsqlQueryAction;
5352
import org.elasticsearch.xpack.esql.core.expression.Attribute;
@@ -549,9 +548,6 @@ private static void updateExecutionInfoAfterCoordinatorOnlyQuery(EsqlExecutionIn
549548
* which doesn't consider the failures from the remote clusters when skip_unavailable is true.
550549
*/
551550
static void failIfAllShardsFailed(EsqlExecutionInfo execInfo, List<Page> finalResults) {
552-
if (EsqlCapabilities.Cap.FAIL_IF_ALL_SHARDS_FAIL.isEnabled() == false) {
553-
return;
554-
}
555551
// do not fail if any final result has results
556552
if (finalResults.stream().anyMatch(p -> p.getPositionCount() > 0)) {
557553
return;

0 commit comments

Comments
 (0)