Skip to content

feat: log sort shuffle spills at WARN, keep write completion at DEBUG#2091

Merged
andygrove merged 3 commits into
apache:mainfrom
andygrove:worktree-shuffle-write-logging
Jul 20, 2026
Merged

feat: log sort shuffle spills at WARN, keep write completion at DEBUG#2091
andygrove merged 3 commits into
apache:mainfrom
andygrove:worktree-shuffle-write-logging

Conversation

@andygrove

@andygrove andygrove commented Jul 18, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Part of the observability work tracked in #2081. This extracts the sort
shuffle write/spill logging from the WIP PR #2084 into a small, standalone
change.

Rationale for this change

When a sort shuffle task spills to disk under memory pressure it produced no
log output at the default level, so spilling was effectively invisible.
Spilling is a key signal when diagnosing slow or memory-constrained TPC-H
stages, so it is worth surfacing even at the default log level.

Per reviewer feedback, the routine per-partition write completion message
stays at debug! to avoid adding day-to-day noise.

What changes are included in this PR?

  • When a task spilled to disk, emit a warn! that names the job, stage, and
    input partition and reports the bytes, batches, and events spilled under
    memory pressure.
  • Keep the per-partition shuffle write completion log at debug!, and add
    the output row count to that message.

Are there any user-facing changes?

Executor logs now report sort shuffle spill activity at WARN. The routine
write completion message remains at DEBUG. There are no API or
configuration changes.

@andygrove
andygrove requested a review from milenkovicm July 18, 2026 20:11
@andygrove
andygrove marked this pull request as ready for review July 18, 2026 20:11
@andygrove
andygrove requested a review from avantgardnerio July 18, 2026 20:11

@milenkovicm milenkovicm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @andygrove, just one comment, but fell free to ignore it if you dont agree

elapsed_secs,
);
} else {
info!(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can info be debug in this case?
it might be important at this moment but in day-to-day operations probably would be just noise? wdyt ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this should probably be debug

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude also wanted debug, so it's 3 against 1 at this point. Updated!

elapsed_secs,
);
} else {
info!(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this should probably be debug

Log sort shuffle spills at warn! with job, stage, and input partition
context so memory pressure is visible at the default log level. Keep the
per-partition write completion message at debug! and add the output row
count to it.
@andygrove
andygrove force-pushed the worktree-shuffle-write-logging branch from f1223b2 to 3a0741b Compare July 19, 2026 13:53
@andygrove andygrove changed the title feat: improve sort shuffle write and spill INFO logging feat: log sort shuffle spills at WARN, keep write completion at DEBUG Jul 19, 2026
@andygrove
andygrove marked this pull request as draft July 19, 2026 14:19
@andygrove

Copy link
Copy Markdown
Member Author

The timings in the log messages are very misleading because they include the time to execute the query that produces the shuffle data. Moving this to draft for now.

…apsed

The previous log reported now.elapsed(), which spans the entire input
stream consumption and therefore includes upstream query execution, not
just shuffle write cost. Report the existing repart_time, spill_time, and
write_time metrics instead, which isolate the partition, spill, and
finalize phases.
@andygrove
andygrove marked this pull request as ready for review July 20, 2026 13:47
…ite-logging

# Conflicts:
#	ballista/core/src/execution_plans/sort_shuffle/writer.rs
@andygrove
andygrove merged commit 2d93837 into apache:main Jul 20, 2026
18 checks passed
@andygrove
andygrove deleted the worktree-shuffle-write-logging branch July 20, 2026 14:16
andygrove added a commit to andygrove/datafusion-ballista that referenced this pull request Jul 20, 2026
Resolve conflicts from the merged sort-shuffle spill-cap work (apache#2091):
adopt the optional proto field and Option<u64> serde handling from main,
keep the per-task budget default at 0 (uncapped), and preserve this
branch's INFO-level shuffle-write logging while folding in main's
repart/spill/write timing breakdown. Take main's refreshed
benchmarking.md results as the base for the pending SF1000 re-run.
andygrove added a commit to andygrove/datafusion-ballista that referenced this pull request Jul 20, 2026
Resolve conflicts from the merged sort-shuffle spill-cap work (apache#2091):
adopt the optional proto field and Option<u64> serde handling from main,
keep the per-task budget default at 0 (uncapped), and preserve this
branch's INFO-level shuffle-write logging while folding in main's
repart/spill/write timing breakdown. Take main's refreshed
benchmarking.md results as the base for the pending SF1000 re-run.
andygrove added a commit to andygrove/datafusion-ballista that referenced this pull request Jul 21, 2026
Drop this branch's change of the sort-shuffle per-task spill-cap default
to 0 (uncapped); restore the 256 MiB default from main. The serde
plumbing for the value stays (it landed on main via apache#2091). This PR no
longer alters the shipped spill-cap default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants