Fix parallel_hash global JOIN limit not enforced#109488
Conversation
|
Workflow [PR], commit [029f1ac] Summary: ✅ AI ReviewSummaryThe new global accounting in PR Metadata
Tests
Final Verdict
|
|
Updating the branch to fix the |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 43/44 (97.73%) · Uncovered code |
| @@ -347,7 +351,7 @@ bool ConcurrentHashJoin::addBlockToJoin(const Block & right_block_, bool check_l | |||
| } | |||
|
|
|||
| if (check_limits && table_join->sizeLimits().hasLimits()) | |||
There was a problem hiding this comment.
parallel_hash is documented to honor both THROW and BREAK for join_overflow_mode, but the regression coverage here still only exercises THROW. The previous revision of this fix already showed that a throw-only safety net can leave BREAK returning the full result after the global limit is crossed, so I think this needs a focused stateless test that forces parallel_hash with low max_rows_in_join / max_bytes_in_join and asserts truncation under join_overflow_mode = 'break'.
|
@antaljanosbenjamin I changed the accounting to make the limit check in |
ffeb980
Closes: #109400
Related: #108938
#108938 made
getTotalRowCount/getTotalByteCountlock-free by using atomics and updating them at the end ofaddBlockToJoin.This means
addBlockToJoincould read a stale state of the atomics and not throw even though the limit was exceeded.This PR adjusts the accounting to ensure each thread in addBlockToJoin sees an up-to-date state.
Changelog category (leave one):
Bug Fix (user-visible misbehavior in an official stable release)
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed the global
max_rows_in_join/max_bytes_in_joinlimit not being enforced for the parallel_hash join algorithm, where a query withjoin_overflow_mode = 'throw'could silently succeed instead of raisingSET_SIZE_LIMIT_EXCEEDED.Version info
26.7.1.717(included in26.7and later)