andygrove commented on code in PR #7249:
URL: https://github.com/apache/datafusion-comet/pull/7249#discussion_r4733505624
##########
native/core/src/execution/memory_pools/mod.rs:
##########
@@ -94,22 +92,16 @@ fn create_pool(
match pool_type {
MemoryPoolType::GreedyUnified => {
acquire_task_shared_pool(task_attempt_id, running_tasks, || {
- Arc::new(SpillReplayPool::new(
- task_attempt_id,
- tracked(CometUnifiedMemoryPool::with_spark(spark())),
- ))
+ tracked(CometUnifiedMemoryPool::with_spark(spark()))
})
}
MemoryPoolType::FairUnified => {
acquire_task_shared_pool(task_attempt_id, running_tasks, || {
- Arc::new(SpillReplayPool::new(
- task_attempt_id,
- tracked(CometFairMemoryPool::with_spark(
- spark(),
- pool_size,
- off_heap_size,
- running_tasks.clone(),
- )),
+ tracked(CometFairMemoryPool::with_spark(
Review Comment:
You're right. `into_replay_stream` builds the replay
`ClusteredFinalAggregateStream` on `reservation.new_empty()`, and its
constructor reserves the empty table. Only after that does the merge pick its
files through another sibling. So `consumer_used > reservation.size()` was
already true for the merge's headroom requests. The pool granted them past the
2 MiB limit, the merge opened every spill file (35.6 MB held, 71.2 MB peak),
and the `ClusteredPartialAggregateStream` below it starved.
DataFusion doesn't let a pool tell sibling reservations apart, so
`SpillReplayPool` now goes by what the rest of the consumer holds. Every
aggregate frees its table (`try_resize(0)`) before it builds the replay, so the
replay's table takes the consumer's first memory from zero. While the merge
picks its files, the rest of the consumer holds exactly that, so a refusal
stands. During the replay the merge holds read buffers for at least two files,
so the rest holds more and the refusal is recorded. The pool tests now step the
reservations in DataFusion's order.
`the_merge_picking_its_spill_files_keeps_to_the_pool_limit` is the #6880 case.
It and `other_refusals_are_unchanged` fail with the old check.
`CometAggregateSuite` passes locally, including both #6880 tests and the #6254
and #6857 ones. (a02d576714)
##########
.github/workflows/pr_build_linux.yml:
##########
@@ -484,13 +484,16 @@ jobs:
# native/native-executors, the Comet Native Executors cluster (issue #7288),
# is a Cargo workspace of its own so that the main build never depends on
# Ballista. linux-test-rust doesn't build it, so this job does, and the lint
- # job checks its formatting. When Comet moves to a DataFusion major that
- # Ballista hasn't released yet, the upgrade can turn this job off until
- # Ballista catches up.
+ # job checks its formatting. The job is turned off because Comet is pinned
+ # to DataFusion's 56.0.0 tag and Ballista main is still on its 56.0.0-rc1
+ # tag, so the build has two copies of DataFusion. Turn it back on, by
+ # restoring the `if:` below, once the Ballista pin in
+ # native/native-executors/Cargo.toml is on the 56.0.0 tag.
linux-test-native-executors:
needs: lint
name: ubuntu-latest/native-executors
- if: ${{ !inputs.cache-refresh-only && inputs.profiles != 'nightly' }}
+ # if: ${{ !inputs.cache-refresh-only && inputs.profiles != 'nightly' }}
+ if: false
Review Comment:
It's a change on Ballista main, and it needed two fixes on the Comet side.
Ballista now runs `EnsureRequirements` over each stage. A range or
single-partition exchange reaches the fragment as a `CoalescePartitionsExec`
over the shuffle reader. The fragment reported `UnspecifiedDistribution` for
that input, so the rule removed the coalesce. It then rebuilt the fragment
through `with_new_children`, and `try_new` refused the 4-partition input.
A fragment with one partition now requires `SinglePartition` of every input,
as it already did for broadcast inputs, so the rule adds the coalesce back.
`with_new_children` skips the partition count check, so the rule can rebuild
the node between removing the coalesce and adding it back. Assembly and the
codec still build through `try_new`, which checks. Without the requirement,
`runs_a_query_across_a_range_exchange` returns only some of the rows. With both
changes, all six cluster tests pass. (2217453e78)
--
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]