Skip to content

fix: Disable dynamic filters on HashJoinExec across broadcast joins#33

Merged
peasee merged 20 commits into
spiceai-52.5from
peasee/260422-revive-offers-on-job-update
Apr 27, 2026
Merged

fix: Disable dynamic filters on HashJoinExec across broadcast joins#33
peasee merged 20 commits into
spiceai-52.5from
peasee/260422-revive-offers-on-job-update

Conversation

@peasee
Copy link
Copy Markdown

@peasee peasee commented Apr 23, 2026

  • When I re-enabled broadcast joins, I introduced a bug where HashJoinExec would configure a dynamic filter that attempts to accumulate across multiple executors/tasks. Because the accumulator is synchronized with a Barrier, but the tasks aren't guaranteed to run on the same executor where the Barrier conditions could be met (all partitions finished), we need to remove the dynamic filter when re-creating joins on executors.

@peasee peasee self-assigned this Apr 23, 2026
Copilot AI review requested due to automatic review settings April 23, 2026 06:14
@peasee peasee added the bug Something isn't working label Apr 23, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a distributed execution deadlock in Ballista caused by DataFusion hash-join dynamic filter state that relies on cross-partition synchronization (e.g., tokio::sync::Barrier) which cannot be satisfied when partitions execute in separate tasks/executors.

Changes:

  • Disables DataFusion join dynamic filter pushdown in the scheduler’s adjusted session config to avoid generating dynamic filters for distributed planning.
  • Rebuilds HashJoinExec nodes via try_new() during plan transforms (scheduler + executor shuffle writing) to strip any dynamic-filter accumulator state, and coalesces build-side partitions for CollectLeft.
  • Adds a regression test intended to ensure nested broadcast (CollectLeft) joins do not deadlock.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
ballista/scheduler/src/state/mod.rs Disables join dynamic filter pushdown and rewrites HashJoinExec nodes in the planned physical plan before job submission.
ballista/core/src/execution_plans/shuffle_writer.rs Rewrites HashJoinExec nodes before executing shuffle write to avoid deadlock-inducing dynamic filter state.
ballista/client/tests/context_checks.rs Adds a regression test that times out if nested joins deadlock.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ballista/scheduler/src/state/mod.rs Outdated
Comment thread ballista/core/src/execution_plans/shuffle_writer.rs Outdated
Comment thread ballista/client/tests/context_checks.rs
Copilot AI review requested due to automatic review settings April 23, 2026 23:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ballista/client/tests/context_checks.rs
Comment thread ballista/client/tests/context_checks.rs
Comment thread ballista/client/tests/context_checks.rs
Comment thread ballista/scheduler/src/state/mod.rs Outdated
Copilot AI review requested due to automatic review settings April 26, 2026 23:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ballista/scheduler/src/state/mod.rs
Comment thread ballista/core/src/execution_plans/shuffle_writer.rs
Comment thread ballista/client/tests/context_checks.rs
@peasee peasee merged commit 383e165 into spiceai-52.5 Apr 27, 2026
33 checks passed
@peasee peasee deleted the peasee/260422-revive-offers-on-job-update branch April 27, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants