This reverts commit 04119405d1
.
This commit is contained in:
parent
feafb3a2ef
commit
be2f024412
|
@ -214,10 +214,6 @@ public class EsqlPartialResultsIT extends ESRestTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAllShardsFailed() throws Exception {
|
public void testAllShardsFailed() throws Exception {
|
||||||
assumeTrue(
|
|
||||||
"fail functionality is not enabled",
|
|
||||||
clusterHasCapability("POST", "/_query", List.of(), List.of("fail_if_all_shards_fail")).orElse(false)
|
|
||||||
);
|
|
||||||
setupRemoteClusters();
|
setupRemoteClusters();
|
||||||
populateIndices();
|
populateIndices();
|
||||||
try {
|
try {
|
||||||
|
@ -236,26 +232,6 @@ public class EsqlPartialResultsIT extends ESRestTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAllShardsFailedOldBehavior() throws Exception {
|
|
||||||
// TODO: drop this once we no longer support the old behavior
|
|
||||||
assumeFalse(
|
|
||||||
"fail functionality is enabled",
|
|
||||||
clusterHasCapability("POST", "/_query", List.of(), List.of("fail_if_all_shards_fail")).orElse(false)
|
|
||||||
);
|
|
||||||
setupRemoteClusters();
|
|
||||||
populateIndices();
|
|
||||||
try {
|
|
||||||
Request request = new Request("POST", "/_query");
|
|
||||||
request.setJsonEntity("{\"query\": \"FROM " + "*:failing*" + " | LIMIT 100\"}");
|
|
||||||
request.addParameter("allow_partial_results", "true");
|
|
||||||
Response resp = client().performRequest(request);
|
|
||||||
Map<String, Object> results = entityAsMap(resp);
|
|
||||||
assertThat(results.get("is_partial"), equalTo(true));
|
|
||||||
} finally {
|
|
||||||
removeRemoteCluster();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupRemoteClusters() throws IOException {
|
private void setupRemoteClusters() throws IOException {
|
||||||
String settings = String.format(Locale.ROOT, """
|
String settings = String.format(Locale.ROOT, """
|
||||||
{
|
{
|
||||||
|
|
|
@ -1276,11 +1276,6 @@ public class EsqlCapabilities {
|
||||||
*/
|
*/
|
||||||
NO_BRACKETS_IN_UNQUOTED_INDEX_NAMES,
|
NO_BRACKETS_IN_UNQUOTED_INDEX_NAMES,
|
||||||
|
|
||||||
/**
|
|
||||||
* Fail if all shards fail
|
|
||||||
*/
|
|
||||||
FAIL_IF_ALL_SHARDS_FAIL(Build.current().isSnapshot()),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cosine vector similarity function
|
* Cosine vector similarity function
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -46,7 +46,6 @@ import org.elasticsearch.transport.AbstractTransportRequest;
|
||||||
import org.elasticsearch.transport.RemoteClusterAware;
|
import org.elasticsearch.transport.RemoteClusterAware;
|
||||||
import org.elasticsearch.transport.TransportException;
|
import org.elasticsearch.transport.TransportException;
|
||||||
import org.elasticsearch.transport.TransportService;
|
import org.elasticsearch.transport.TransportService;
|
||||||
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
|
|
||||||
import org.elasticsearch.xpack.esql.action.EsqlExecutionInfo;
|
import org.elasticsearch.xpack.esql.action.EsqlExecutionInfo;
|
||||||
import org.elasticsearch.xpack.esql.action.EsqlQueryAction;
|
import org.elasticsearch.xpack.esql.action.EsqlQueryAction;
|
||||||
import org.elasticsearch.xpack.esql.core.expression.Attribute;
|
import org.elasticsearch.xpack.esql.core.expression.Attribute;
|
||||||
|
@ -548,9 +547,6 @@ public class ComputeService {
|
||||||
* which doesn't consider the failures from the remote clusters when skip_unavailable is true.
|
* which doesn't consider the failures from the remote clusters when skip_unavailable is true.
|
||||||
*/
|
*/
|
||||||
static void failIfAllShardsFailed(EsqlExecutionInfo execInfo, List<Page> finalResults) {
|
static void failIfAllShardsFailed(EsqlExecutionInfo execInfo, List<Page> finalResults) {
|
||||||
if (EsqlCapabilities.Cap.FAIL_IF_ALL_SHARDS_FAIL.isEnabled() == false) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// do not fail if any final result has results
|
// do not fail if any final result has results
|
||||||
if (finalResults.stream().anyMatch(p -> p.getPositionCount() > 0)) {
|
if (finalResults.stream().anyMatch(p -> p.getPositionCount() > 0)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue