Skip to content

Commit 4b47fd8

Browse files
authored
Revert "Put shards failure under a cap flag (#131371)" (#131542) (#131553)
This reverts commit 0411940. (cherry picked from commit be2f024) # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
1 parent 4b158d8 commit 4b47fd8

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
@@ -1035,12 +1035,7 @@ public enum Cap {
10351035
* Forbid usage of brackets in unquoted index and enrich policy names
10361036
* https://github.com/elastic/elasticsearch/issues/130378
10371037
*/
1038-
NO_BRACKETS_IN_UNQUOTED_INDEX_NAMES,
1039-
1040-
/**
1041-
* Fail if all shards fail
1042-
*/
1043-
FAIL_IF_ALL_SHARDS_FAIL(Build.current().isSnapshot());
1038+
NO_BRACKETS_IN_UNQUOTED_INDEX_NAMES;
10441039

10451040
private final boolean enabled;
10461041

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
@@ -43,7 +43,6 @@
4343
import org.elasticsearch.transport.TransportException;
4444
import org.elasticsearch.transport.TransportRequest;
4545
import org.elasticsearch.transport.TransportService;
46-
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
4746
import org.elasticsearch.xpack.esql.action.EsqlExecutionInfo;
4847
import org.elasticsearch.xpack.esql.action.EsqlQueryAction;
4948
import org.elasticsearch.xpack.esql.core.expression.Attribute;
@@ -400,9 +399,6 @@ private static void updateExecutionInfoAfterCoordinatorOnlyQuery(EsqlExecutionIn
400399
* which doesn't consider the failures from the remote clusters when skip_unavailable is true.
401400
*/
402401
static void failIfAllShardsFailed(EsqlExecutionInfo execInfo, List<Page> finalResults) {
403-
if (EsqlCapabilities.Cap.FAIL_IF_ALL_SHARDS_FAIL.isEnabled() == false) {
404-
return;
405-
}
406402
// do not fail if any final result has results
407403
if (finalResults.stream().anyMatch(p -> p.getPositionCount() > 0)) {
408404
return;

0 commit comments

Comments
 (0)