Repository navigation
branch-4.1: [fix](fe) Stop split enumeration when queries finish or terminate - #70004
Conversation
### What problem does this PR solve? Issue Number: None Related PR: apache#69835 Problem Summary: Hive and Iceberg split enumeration can outlive LIMIT completion, query cancellation, and planning timeout. Retained queues and queued background tasks keep scan resources alive, while the first split wait is fixed at 30 seconds. Adapt the merged fix to the existing branch-4.1 execution paths without backporting Hive streaming, fair scheduling, changed batch defaults, or the Connector SPI migration. Share a cancellation-aware task owner, stop request pagination and split generation, remove queued tasks, retain read resources until actual worker/source termination, and propagate cancellation before coordinator publication. Keep release batch-mode thresholds and queue units unchanged. Backport source: ea3558d ### Release note External batch scans stop enumeration and release split queues when queries finish, are cancelled, or time out. The first_split_wait_timeout_ms session variable controls the initial split wait (default 30000 ms); timeout errors include enumeration progress. ### Check List (For Author) - Test: Unit Test - 345 distinct targeted FE tests passed using run-fe-ut.sh, across the expanded run and the corrected Hive fixture rerun; Checkstyle passed. Production compilation passed; final packaging and end-to-end validation pending. - Behavior changed: Yes - cooperative early stop and configurable first split wait. - Does this need documentation: Yes - first_split_wait_timeout_ms; documentation pending.
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
### What problem does this PR solve? Issue Number: N/A Related PR: apache#69835 Problem Summary: On branch-4.1, cancellable Hive global file-cache misses must retain the catalog-specific filesystem lister, and TABLESAMPLE must pass cancellation through selection and per-file splitting. Iceberg weighted caches return a query-scoped table that must keep snapshot isolation when installing guarded FileIO and tracking manifest planning tasks. Preserve producer failures during endpoint cleanup and close registered scan tasks when internal-query planning fails before a coordinator exists. ### Release note Complete split early-stop behavior for sampled Hive scans, weighted Iceberg metadata caches, and internal-query planning failures. ### Check List (For Author) - Test: Unit Test - 476 FE tests passed across 20 relevant classes using run-fe-ut.sh; Checkstyle passed with 0 violations - Behavior changed: Yes (stop omitted scan paths and preserve native cache isolation and error details) - Does this need documentation: No (covered by the original early-stop change)
branch-4.1 backport validation and performanceValidated head: Test conditions
Here Main performance comparisonChange =
The 10,000-partition LIMIT improvement reproduced in both execution orders for both storage systems. Smaller LIMIT scenarios did not show a stable improvement or regression across orders. These sizes remain below the existing 1,024-partition threshold, so the results should not be extrapolated as a uniform speedup for every table size. Additional confirmation of the slower filtered-SUM casesThe main series showed roughly 4% higher medians for filtered SUM. These cases were repeated with 60 measured samples per version per scenario, baseline / candidate / candidate / baseline process order, and alternating full-SUM / filtered-SUM query order. These are separate samples from the main table.
The initial ~4% filtered-SUM slowdown was not consistently reproduced: the sign changed between process orders in the confirmation runs. The intervals include zero. This does not prove zero overhead; the machine is shared, and there are only two FE processes per version in each series. The bootstrap intervals describe the collected query samples and do not capture all process-level or host-level variability. Across the main and confirmation series, 1,120 timed queries and 368 warm-up queries completed successfully. Pilot queries and the discarded 3 GiB series are outside these totals. A confirmation-run stop-controller failure occurred after that round's queries had succeeded; process exit was checked before resuming the remaining baseline round with the same settings. Functional and resource acceptanceAcceptance fixture: Hive, local HMS + real OSS, 10,000 partitions x 100 files, common BE 4.1.3.
Example first-Split timeout error: The first-Split timer starts when waiting for the first Split; total SQL wall time also includes earlier planning. The two first-wait cases inject a 5-second SDK delay to exercise cleanup while an SDK call is in progress. Their background termination times after the timeout signal were 4,221 ms and 2,783 ms, both below 10 seconds. An in-flight SDK call can finish after cancellation; this result does not imply instantaneous interruption at the stop signal. The request observer covers the AWS SDK 2.29.52 Other verification
Benchmark scripts, data, runtime configuration, and build workarounds are excluded from this PR's source changes. No associated prerequisite PRs were separately backported. |
|
run buildall |
#69835