From 0ae06f83f05729d52b72a4ecc3d25d5e44cca627 Mon Sep 17 00:00:00 2001 From: "ievgen.degtiarenko" Date: Tue, 12 Aug 2025 08:53:19 +0200 Subject: [PATCH 1/2] Fix testBadAsyncId --- muted-tests.yml | 3 --- .../elasticsearch/xpack/esql/action/EsqlExecutionInfo.java | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index 96c51ba0bf413..22780f575ee44 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -482,9 +482,6 @@ tests: - class: org.elasticsearch.xpack.ml.integration.AutodetectMemoryLimitIT method: testTooManyByAndOverFields issue: https://github.com/elastic/elasticsearch/issues/132310 -- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT - method: testBadAsyncId - issue: https://github.com/elastic/elasticsearch/issues/132353 - class: org.elasticsearch.xpack.esql.inference.completion.CompletionOperatorTests method: testSimpleCircuitBreaking issue: https://github.com/elastic/elasticsearch/issues/132382 diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java index 9ac56ad433872..7b70342d80b6f 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java @@ -7,6 +7,8 @@ package org.elasticsearch.xpack.esql.action; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.TransportVersions; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.common.collect.Iterators; @@ -61,6 +63,7 @@ public class EsqlExecutionInfo implements ChunkedToXContentObject, Writeable { public static final ParseField DETAILS_FIELD = new ParseField("details"); public static final ParseField TOOK = new ParseField("took"); public static final ParseField IS_PARTIAL_FIELD = new ParseField("is_partial"); + private static final Logger log = LogManager.getLogger(EsqlExecutionInfo.class); // Map key is clusterAlias on the primary querying cluster of a CCS minimize_roundtrips=true query // The Map itself is immutable after construction - all Clusters will be accounted for at the start of the search. @@ -124,7 +127,9 @@ public EsqlExecutionInfo(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { out.writeOptionalTimeValue(overallTook); if (clusterInfo != null) { - out.writeCollection(clusterInfo.values()); + // .stream().toList() creates an immutable copy of the cluster info entries + // as today they might be still changing while serialization is happening + out.writeCollection(clusterInfo.values().stream().toList()); } else { out.writeCollection(Collections.emptyList()); } From 9ad22eb31bcda159204034c6ee0a042678413ecb Mon Sep 17 00:00:00 2001 From: "ievgen.degtiarenko" Date: Tue, 12 Aug 2025 17:09:11 +0200 Subject: [PATCH 2/2] remove unused logger --- .../org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java index 7b70342d80b6f..1596bd3f64d91 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java @@ -7,8 +7,6 @@ package org.elasticsearch.xpack.esql.action; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.elasticsearch.TransportVersions; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.common.collect.Iterators; @@ -63,7 +61,6 @@ public class EsqlExecutionInfo implements ChunkedToXContentObject, Writeable { public static final ParseField DETAILS_FIELD = new ParseField("details"); public static final ParseField TOOK = new ParseField("took"); public static final ParseField IS_PARTIAL_FIELD = new ParseField("is_partial"); - private static final Logger log = LogManager.getLogger(EsqlExecutionInfo.class); // Map key is clusterAlias on the primary querying cluster of a CCS minimize_roundtrips=true query // The Map itself is immutable after construction - all Clusters will be accounted for at the start of the search.