Skip to content

Commit b504514

Browse files
committed
ESQL: Fix async operator warnings not always sent when blocking
1 parent 64023d7 commit b504514

File tree

4 files changed

+16
-35
lines changed

4 files changed

+16
-35
lines changed

muted-tests.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,6 @@ tests:
286286
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
287287
method: testOneRemoteClusterPartial
288288
issue: https://github.com/elastic/elasticsearch/issues/124055
289-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
290-
method: test {csv-spec:lookup-join.MvJoinKeyOnTheLookupIndex}
291-
issue: https://github.com/elastic/elasticsearch/issues/128030
292289
- class: org.elasticsearch.packaging.test.EnrollmentProcessTests
293290
method: test20DockerAutoFormCluster
294291
issue: https://github.com/elastic/elasticsearch/issues/128113
@@ -350,9 +347,6 @@ tests:
350347
- class: org.elasticsearch.index.IndexingPressureIT
351348
method: testWriteCanRejectOnPrimaryBasedOnMaxOperationSize
352349
issue: https://github.com/elastic/elasticsearch/issues/130281
353-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
354-
method: test {csv-spec:lookup-join.MvJoinKeyOnFrom}
355-
issue: https://github.com/elastic/elasticsearch/issues/130296
356350
- class: org.elasticsearch.xpack.esql.inference.bulk.BulkInferenceExecutorTests
357351
method: testSuccessfulExecution
358352
issue: https://github.com/elastic/elasticsearch/issues/130306
@@ -362,9 +356,6 @@ tests:
362356
- class: org.elasticsearch.gradle.LoggedExecFuncTest
363357
method: failed tasks output logged to console when spooling true
364358
issue: https://github.com/elastic/elasticsearch/issues/119509
365-
- class: org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT
366-
method: test {csv-spec:lookup-join.MvJoinKeyFromRow}
367-
issue: https://github.com/elastic/elasticsearch/issues/130642
368359
- class: org.elasticsearch.indices.stats.IndexStatsIT
369360
method: testFilterCacheStats
370361
issue: https://github.com/elastic/elasticsearch/issues/124447
@@ -374,9 +365,6 @@ tests:
374365
- class: org.elasticsearch.search.SearchWithRejectionsIT
375366
method: testOpenContextsAfterRejections
376367
issue: https://github.com/elastic/elasticsearch/issues/130821
377-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
378-
method: test {csv-spec:lookup-join.MvJoinKeyOnFromAfterStats}
379-
issue: https://github.com/elastic/elasticsearch/issues/131148
380368
- class: org.elasticsearch.xpack.esql.ccq.MultiClustersIT
381369
method: testLookupJoinAliases
382370
issue: https://github.com/elastic/elasticsearch/issues/131166
@@ -488,12 +476,6 @@ tests:
488476
- class: org.elasticsearch.xpack.esql.inference.completion.CompletionOperatorTests
489477
method: testSimpleCircuitBreaking
490478
issue: https://github.com/elastic/elasticsearch/issues/132382
491-
- class: org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT
492-
method: test {csv-spec:lookup-join.MvJoinKeyOnFrom}
493-
issue: https://github.com/elastic/elasticsearch/issues/132554
494-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
495-
method: test {csv-spec:lookup-join.MvJoinKeyFromRow}
496-
issue: https://github.com/elastic/elasticsearch/issues/132555
497479
- class: org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT
498480
method: test {csv-spec:spatial.ConvertFromStringParseError}
499481
issue: https://github.com/elastic/elasticsearch/issues/132558
@@ -506,9 +488,6 @@ tests:
506488
- class: org.elasticsearch.xpack.logsdb.qa.StoredSourceLogsDbVersusReindexedLogsDbChallengeRestIT
507489
method: testEsqlSource
508490
issue: https://github.com/elastic/elasticsearch/issues/132602
509-
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
510-
method: test {csv-spec:lookup-join.MvJoinKeyFromRowExpanded}
511-
issue: https://github.com/elastic/elasticsearch/issues/132604
512491
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
513492
method: test {p0=esql/60_usage/Basic ESQL usage output (telemetry) non-snapshot version}
514493
issue: https://github.com/elastic/elasticsearch/issues/132608

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/AsyncOperator.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,16 @@ public void addInput(Page input) {
9595
driverContext.addAsyncAction();
9696
boolean success = false;
9797
try {
98-
final ActionListener<Fetched> listener = ActionListener.wrap(output -> {
99-
buffers.put(seqNo, output);
100-
onSeqNoCompleted(seqNo);
101-
}, e -> {
98+
final ActionListener<Fetched> listener = ActionListener.wrap(output -> buffers.put(seqNo, output), e -> {
10299
releasePageOnAnyThread(input);
103100
failureCollector.unwrapAndCollect(e);
104-
onSeqNoCompleted(seqNo);
105101
});
106102
final long startNanos = System.nanoTime();
107103
performAsync(input, ActionListener.runAfter(listener, () -> {
108104
responseHeadersCollector.collect();
109-
driverContext.removeAsyncAction();
110105
processNanos.add(System.nanoTime() - startNanos);
106+
onSeqNoCompleted(seqNo);
107+
driverContext.removeAsyncAction();
111108
}));
112109
success = true;
113110
} finally {
@@ -241,7 +238,7 @@ public IsBlockedResult isBlocked() {
241238

242239
@Override
243240
public final Operator.Status status() {
244-
return status(Math.max(0L, checkpoint.getMaxSeqNo()), Math.max(0L, checkpoint.getProcessedCheckpoint()), processNanos.sum());
241+
return status(checkpoint.getMaxSeqNo() + 1, checkpoint.getProcessedCheckpoint() + 1, processNanos.sum());
245242
}
246243

247244
protected Operator.Status status(long receivedPages, long completedPages, long processNanos) {
@@ -292,7 +289,7 @@ public long completedPages() {
292289
return completedPages;
293290
}
294291

295-
public long procesNanos() {
292+
public long processNanos() {
296293
return processNanos;
297294
}
298295

x-pack/plugin/esql/qa/testFixtures/src/main/resources/lookup-join.csv-spec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ emp_no:integer | language_code:integer | language_name:keyword
429429

430430
mvJoinKeyOnTheLookupIndex
431431
required_capability: join_lookup_v12
432-
required_capability: join_lookup_skip_mv_warnings
432+
required_capability: async_operator_warnings_fix
433433

434434
FROM employees
435435
| WHERE 10003 < emp_no AND emp_no < 10008
@@ -451,7 +451,7 @@ emp_no:integer | language_code:integer | language_name:keyword
451451

452452
mvJoinKeyOnFrom
453453
required_capability: join_lookup_v12
454-
required_capability: join_lookup_skip_mv_warnings
454+
required_capability: async_operator_warnings_fix
455455

456456
FROM employees
457457
| WHERE emp_no < 10006
@@ -474,7 +474,7 @@ emp_no:integer | language_code:integer | language_name:keyword
474474

475475
mvJoinKeyOnTheLookupIndexAfterStats
476476
required_capability: join_lookup_v12
477-
required_capability: join_lookup_skip_mv_warnings
477+
required_capability: async_operator_warnings_fix
478478

479479
FROM employees
480480
| WHERE 10003 < emp_no AND emp_no < 10008
@@ -497,7 +497,7 @@ emp_no:integer | language_code:integer | language_name:keyword
497497

498498
mvJoinKeyOnFromAfterStats
499499
required_capability: join_lookup_v12
500-
required_capability: join_lookup_skip_mv_warnings
500+
required_capability: async_operator_warnings_fix
501501

502502
FROM employees
503503
| WHERE emp_no < 10006
@@ -521,7 +521,7 @@ emp_no:integer | language_code:integer | language_name:keyword
521521

522522
mvJoinKeyFromRow
523523
required_capability: join_lookup_v12
524-
required_capability: join_lookup_skip_mv_warnings
524+
required_capability: async_operator_warnings_fix
525525

526526
ROW language_code = [4, 5, 6, 7]
527527
| LOOKUP JOIN languages_lookup_non_unique_key ON language_code
@@ -538,7 +538,7 @@ language_code:integer | language_name:keyword | country:text
538538

539539
mvJoinKeyFromRowExpanded
540540
required_capability: join_lookup_v12
541-
required_capability: join_lookup_skip_mv_warnings
541+
required_capability: async_operator_warnings_fix
542542

543543
ROW language_code = [4, 5, 6, 7, 8]
544544
| MV_EXPAND language_code

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,11 @@ public enum Cap {
825825
*/
826826
JOIN_LOOKUP_SKIP_MV_WARNINGS(JOIN_LOOKUP_V12.isEnabled()),
827827

828+
/**
829+
* Fix for async operator sometimes completing the driver without emitting the stored warnings
830+
*/
831+
ASYNC_OPERATOR_WARNINGS_FIX,
832+
828833
/**
829834
* Fix pushing down LIMIT past LOOKUP JOIN in case of multiple matching join keys.
830835
*/

0 commit comments

Comments
 (0)