Rich-T-kid opened a new pull request, #27740: URL: https://github.com/apache/datafusion/pull/27740
## Which issue does this PR close? - N/A, follow-up to #27707. ## Rationale for this change Bounded unordered `RepartitionExec` currently performs completion signaling, coalescer finalization bookkeeping, sender cloning, and spill-writer cloning for every input/output pair. At high partition counts, that coordination grows quadratically. This PR is stacked on #27707 at `8a4e97e53ebee18e6761dd67f4dd4e92caf244c6` and must remain draft until that PR lands or this branch is rebased. ## What changes are included in this PR? Bounded unordered producers share one output-channel set. One coordinator waits for producers, propagates the first error after cancellation completes, finalizes each output coalescer once, and closes channels by dropping the final senders. Pending memory reservations are released on cancellation. Ordered repartition and unbounded inputs keep their existing paths. For `P` inputs and outputs, completion messages go from `P²` to zero, finalizer operations from `P²` to `P`, waiter tasks from `P` to one coordinator, and spill-sink clones from `P²` to zero. ## What is the testing strategy for this PR? The complete `datafusion-physical-plan` suite passes, including focused success, upstream error/panic, cancellation, early-drop, spill, and ordered-spill coverage. Format, diff-check, and workspace all-target/all-feature Clippy pass. The extended workspace test command was also run, but 139 file-backed tests could not start because this worktree did not have the declared Arrow/DataFusion test-data submodules (`ARROW_TEST_DATA` was unset); the changed crate's complete suite passed independently. The table is a disposable out-of-tree harness at exact baseline `8a4e97e5` versus `b10f13ab`, with separate release targets, 14 measured samples per side/cell, balanced ascending/descending order, 64 rows per input, and concurrent output polling. Every run produced the expected row count and checksum, one batch per output, and zero spills. Setup was noisy and regressed at 24 (+0.6%), 96 (+3.7%), and 256 (+3.2%) partitions. | Partitions | Mean total | Mean first output | Setup | Peak RSS | | ---: | ---: | ---: | ---: | ---: | | 8 | 133 µs → 74 µs (-44.5%) | 91 µs → 63 µs (-30.9%) | -10.7% | 10.8 → 10.6 MiB (-1.2%) | | 12 | 190 µs → 97 µs (-48.9%) | 132 µs → 86 µs (-35.4%) | -6.8% | 10.9 → 10.7 MiB (-1.7%) | | 16 | 301 µs → 123 µs (-59.0%) | 188 µs → 106 µs (-44.0%) | -4.0% | 11.2 → 11.0 MiB (-2.0%) | | 24 | 573 µs → 234 µs (-59.2%) | 370 µs → 200 µs (-46.0%) | +0.6% | 11.5 → 11.3 MiB (-1.6%) | | 32 | 986 µs → 307 µs (-68.9%) | 653 µs → 270 µs (-58.6%) | -2.4% | 12.0 → 11.7 MiB (-2.6%) | | 64 | 3.39 ms → 820 µs (-75.8%) | 2.44 ms → 727 µs (-70.2%) | -5.6% | 15.0 → 13.8 MiB (-8.0%) | | 96 | 6.49 ms → 1.54 ms (-76.3%) | 4.46 ms → 1.40 ms (-68.7%) | +3.7% | 18.5 → 16.7 MiB (-9.5%) | | 128 | 11.6 ms → 2.38 ms (-79.6%) | 8.20 ms → 2.21 ms (-73.1%) | -0.9% | 23.4 → 20.5 MiB (-12.7%) | | 192 | 23.1 ms → 4.74 ms (-79.5%) | 16.2 ms → 4.54 ms (-72.0%) | -4.3% | 36.7 → 30.4 MiB (-17.2%) | | 256 | 42.7 ms → 8.47 ms (-80.1%) | 30.9 ms → 8.22 ms (-73.4%) | +3.2% | 55.1 → 43.5 MiB (-21.1%) | | 384 | 95.6 ms → 18.0 ms (-81.2%) | 71.5 ms → 17.7 ms (-75.2%) | -2.1% | 105.4 → 80.0 MiB (-24.1%) | | 512 | 170.3 ms → 30.4 ms (-82.2%) | 121.3 ms → 29.9 ms (-75.4%) | -6.4% | 189.3 → 139.3 MiB (-26.4%) | ## Are there any user-facing changes? No. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
