Skip to content

Commit 72bc1ea

Browse files
committed
mark isPartial at the end
1 parent e2a3bf1 commit 72bc1ea

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,14 @@ public void markEndQuery() {
175175
assert relativeStartNanos != null : "Relative start time must be set when markEndQuery is called";
176176
overallTook = new TimeValue(System.nanoTime() - relativeStartNanos, TimeUnit.NANOSECONDS);
177177
if (isPartial == false) {
178-
isPartial = clusterInfo.values().stream().anyMatch(c -> c.failedShards != null && c.failedShards > 0);
178+
// TODO: Mark individual clusters as partial if failed shards exist
179+
isPartial = clusterInfo.values()
180+
.stream()
181+
.anyMatch(
182+
c -> c.status == Cluster.Status.PARTIAL
183+
|| c.status == Cluster.Status.SKIPPED
184+
|| c.failedShards != null && c.failedShards > 0
185+
);
179186
}
180187
}
181188

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,6 @@ private void innerExecute(Task task, EsqlQueryRequest request, ActionListener<Es
234234
planRunner,
235235
services,
236236
ActionListener.wrap(result -> {
237-
// If we had any skipped or partial clusters, the result is partial
238-
if (executionInfo.getClusters()
239-
.values()
240-
.stream()
241-
.anyMatch(
242-
c -> c.getStatus() == EsqlExecutionInfo.Cluster.Status.SKIPPED
243-
|| c.getStatus() == EsqlExecutionInfo.Cluster.Status.PARTIAL
244-
)) {
245-
executionInfo.markAsPartial();
246-
}
247237
recordCCSTelemetry(task, executionInfo, request, null);
248238
listener.onResponse(toResponse(task, request, configuration, result));
249239
}, ex -> {

0 commit comments

Comments
 (0)