Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent query from deadlocking when task output buffer is full #14948

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

sopel39
Copy link
Member

@sopel39 sopel39 commented Nov 8, 2022

When query is of shape:

SourceStage
           \
        PartitionedStage(broadcast output buffer)
        /     \
  ProbeStage  BuildStage

Then it might happen that task output buffer for
PartitionedStage gets full blocking upstream stages (ProbeStage and BuildStage).

Previously, phased scheduled did not schedule SourceStage in such situation because PartitionedStage was already considered completed.

This commit makes PhasedExecutionSchedule#unblockStagesWithFullOutputBuffer check to be run for all stages (including scheduled, but running stages).

When query is of shape:

SourceStage
           \
        PartitionedStage(broadcast output buffer)
        /     \
  ProbeStage  BuildStage

Then it might happen that task output buffer for
PartitionedStage gets full blocking upstream stages
(ProbeStage and BuildStage).

Previously, phased scheduled did not schedule SourceStage
in such situation because PartitionedStage was already considered
completed.

This commit makes PhasedExecutionSchedule#unblockStagesWithFullOutputBuffer
check to be run for all stages (including scheduled, but running stages).
@sopel39 sopel39 requested a review from losipiuk November 8, 2022 12:27
@sopel39 sopel39 merged commit 1ee0cf7 into trinodb:master Nov 8, 2022
@sopel39 sopel39 deleted the ks/fix_deadlock branch November 8, 2022 16:01
@sopel39 sopel39 mentioned this pull request Nov 8, 2022
@github-actions github-actions bot added this to the 403 milestone Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants