Skip to content

Commit 4e3602d

Browse files
authored
ESQL: Fix async operator warnings not always sent when blocking (elastic#132744)
Fixes elastic#128030 Fixes elastic#130296 Fixes elastic#130642 Fixes elastic#131148 Fixes elastic#132554 Fixes elastic#132555 Fixes elastic#132604 Fixes elastic#131563 Fixes elastic#132778 Extracted from elastic#132738 An AsyncOperator listener misordering caused the warnings collection and status metrics updates to be executed after the `onSeqNoCompleted()`>`notifyIfBlocked()`>`future.onResponse(null)`, which ends the processing in some cases.
1 parent 2c85c37 commit 4e3602d

File tree

5 files changed

+28
-33
lines changed

5 files changed

+28
-33
lines changed

docs/changelog/132744.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pr: 132744
2+
summary: Fix async operator warnings not always sent when blocking
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 130642
7+
- 132554
8+
- 132778
9+
- 130296
10+
- 132555
11+
- 131563
12+
- 131148
13+
- 132604
14+
- 128030

muted-tests.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,6 @@ tests:
284284
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
285285
method: testOneRemoteClusterPartial
286286
issue: https://github.com/elastic/elasticsearch/issues/124055
287-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
288-
method: test {csv-spec:lookup-join.MvJoinKeyOnTheLookupIndex}
289-
issue: https://github.com/elastic/elasticsearch/issues/128030
290287
- class: org.elasticsearch.packaging.test.EnrollmentProcessTests
291288
method: test20DockerAutoFormCluster
292289
issue: https://github.com/elastic/elasticsearch/issues/128113
@@ -348,18 +345,12 @@ tests:
348345
- class: org.elasticsearch.index.IndexingPressureIT
349346
method: testWriteCanRejectOnPrimaryBasedOnMaxOperationSize
350347
issue: https://github.com/elastic/elasticsearch/issues/130281
351-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
352-
method: test {csv-spec:lookup-join.MvJoinKeyOnFrom}
353-
issue: https://github.com/elastic/elasticsearch/issues/130296
354348
- class: org.elasticsearch.xpack.esql.inference.bulk.BulkInferenceExecutorTests
355349
method: testSuccessfulExecution
356350
issue: https://github.com/elastic/elasticsearch/issues/130306
357351
- class: org.elasticsearch.gradle.LoggedExecFuncTest
358352
method: failed tasks output logged to console when spooling true
359353
issue: https://github.com/elastic/elasticsearch/issues/119509
360-
- class: org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT
361-
method: test {csv-spec:lookup-join.MvJoinKeyFromRow}
362-
issue: https://github.com/elastic/elasticsearch/issues/130642
363354
- class: org.elasticsearch.indices.stats.IndexStatsIT
364355
method: testFilterCacheStats
365356
issue: https://github.com/elastic/elasticsearch/issues/124447
@@ -369,9 +360,6 @@ tests:
369360
- class: org.elasticsearch.search.SearchWithRejectionsIT
370361
method: testOpenContextsAfterRejections
371362
issue: https://github.com/elastic/elasticsearch/issues/130821
372-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
373-
method: test {csv-spec:lookup-join.MvJoinKeyOnFromAfterStats}
374-
issue: https://github.com/elastic/elasticsearch/issues/131148
375363
- class: org.elasticsearch.xpack.esql.ccq.MultiClustersIT
376364
method: testLookupJoinAliases
377365
issue: https://github.com/elastic/elasticsearch/issues/131166
@@ -462,12 +450,6 @@ tests:
462450
- class: org.elasticsearch.xpack.esql.inference.completion.CompletionOperatorTests
463451
method: testSimpleCircuitBreaking
464452
issue: https://github.com/elastic/elasticsearch/issues/132382
465-
- class: org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT
466-
method: test {csv-spec:lookup-join.MvJoinKeyOnFrom}
467-
issue: https://github.com/elastic/elasticsearch/issues/132554
468-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
469-
method: test {csv-spec:lookup-join.MvJoinKeyFromRow}
470-
issue: https://github.com/elastic/elasticsearch/issues/132555
471453
- class: org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT
472454
method: test {csv-spec:spatial.ConvertFromStringParseError}
473455
issue: https://github.com/elastic/elasticsearch/issues/132558
@@ -480,9 +462,6 @@ tests:
480462
- class: org.elasticsearch.xpack.logsdb.qa.StoredSourceLogsDbVersusReindexedLogsDbChallengeRestIT
481463
method: testEsqlSource
482464
issue: https://github.com/elastic/elasticsearch/issues/132602
483-
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
484-
method: test {csv-spec:lookup-join.MvJoinKeyFromRowExpanded}
485-
issue: https://github.com/elastic/elasticsearch/issues/132604
486465
- class: org.elasticsearch.xpack.ml.integration.RevertModelSnapshotIT
487466
method: testRevertModelSnapshot_DeleteInterveningResults
488467
issue: https://github.com/elastic/elasticsearch/issues/132349

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

Lines changed: 3 additions & 6 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 {

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)