SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join#11041
Merged
alamb merged 18 commits intoapache:mainfrom Jun 22, 2024
Merged
SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join#11041alamb merged 18 commits intoapache:mainfrom
alamb merged 18 commits intoapache:mainfrom
Conversation
comphead
commented
Jun 21, 2024
| let streamed_idx = streamed_indices.value(i); | ||
| if mask.value(i) | ||
| && !seen_as_true | ||
| && !matched_indices.contains(&streamed_idx) |
Contributor
Author
There was a problem hiding this comment.
this is an actual fix!
Member
There was a problem hiding this comment.
Hmm, the fix is correct. I roughly remember I have commented on such case. JoinType::LeftAnti below has considered matched_indices. Maybe for JoinType::LeftSem it is missing.
viirya
reviewed
Jun 21, 2024
Comment on lines
+566
to
568
| /// } | ||
| /// | ||
| /// let ctx: SessionContext = SessionContext::new(); |
viirya
reviewed
Jun 21, 2024
| println!("The data {out_name} saved as parquet into {out_path}"); | ||
| } | ||
|
|
||
| /// Read parquet files preserving partitions, i.e. 1 file -> 1 partition |
Member
There was a problem hiding this comment.
One partition is one batch here?
viirya
approved these changes
Jun 21, 2024
alamb
reviewed
Jun 22, 2024
| .await | ||
| } | ||
|
|
||
| // The test is flaky |
xinlifoobar
pushed a commit
to xinlifoobar/datafusion
that referenced
this pull request
Jun 22, 2024
…pache#11041) * Fix: Sort Merge Join crashes on TPCH Q21 * Fix LeftAnti SMJ join when the join filter is set * rm dbg * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: disable fuzz test to avoid CI spontaneous failures * Fix: Sort Merge Join crashes on TPCH Q21 * Fix LeftAnti SMJ join when the join filter is set * rm dbg * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join
xinlifoobar
pushed a commit
to xinlifoobar/datafusion
that referenced
this pull request
Jun 22, 2024
…pache#11041) * Fix: Sort Merge Join crashes on TPCH Q21 * Fix LeftAnti SMJ join when the join filter is set * rm dbg * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: disable fuzz test to avoid CI spontaneous failures * Fix: Sort Merge Join crashes on TPCH Q21 * Fix LeftAnti SMJ join when the join filter is set * rm dbg * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join
findepi
pushed a commit
to findepi/datafusion
that referenced
this pull request
Jul 16, 2024
…pache#11041) * Fix: Sort Merge Join crashes on TPCH Q21 * Fix LeftAnti SMJ join when the join filter is set * rm dbg * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: disable fuzz test to avoid CI spontaneous failures * Fix: Sort Merge Join crashes on TPCH Q21 * Fix LeftAnti SMJ join when the join filter is set * rm dbg * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: disable fuzz test to avoid CI spontaneous failures * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * Minor: Add routine to debug join fuzz tests * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join * SMJ: fix streaming row concurrency issue for LEFT SEMI filtered join
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #10886 .
Rationale for this change
There was an issue in SMJ when streamed rows handled concurrently. Race conditions for the
self.streamed_batch.join_filter_matched_idxslead SMJ producing duplicates because of unexpected event ordering caused by concurrency.What changes are included in this PR?
Added an extra check when calculating the filter boolean mask and test methods to make fuzz test debugging easier in future
Are these changes tested?
Yes. There is no specifc test because of unstable test nature. The issue can be reproduced on main branch with high probability by running the test 1000 times
Are there any user-facing changes?