-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns #88605
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
Conversation
Workflow [PR], commit [25675b2] Summary: ❌
|
Test requires sanitizer to reproduce the issue |
9623805
to
954d0f4
Compare
It looks like the problem is caused by this dangerous call of |
You mean here, right?
But the problem is that here we do not have const column anymore, since i.e. ClickHouse/src/Functions/materialize.h Line 59 in 9dea2ef
|
954d0f4
to
9273b7f
Compare
Rewrote it to
|
9273b7f
to
64833aa
Compare
… PREWHERE columns The issue was that in MergeTreeReadTask we may have column that has other references, usually it is a constant column that created during analysis (that is not a constant anymore where we call shrink, i.e. after `materialize()`), and we do not need to mutate such column anyway. v2: move code from MergeTreeSplitPrewhereIntoReadSteps.cpp::addClonedDAGToDAG() into MergeTreeReadTask
64833aa
to
25675b2
Compare
CI is unrelated, something is temporary, something is known |
8ad6289
Cherry pick #88605 to 25.3: Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns
…ation of underlying const PREWHERE columns
Cherry pick #88605 to 25.7: Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns
…ation of underlying const PREWHERE columns
Cherry pick #88605 to 25.8: Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns
…ation of underlying const PREWHERE columns
Cherry pick #88605 to 25.9: Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns
…ation of underlying const PREWHERE columns
Backport #88605 to 25.7: Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns
Backport #88605 to 25.8: Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns
The issue was that a constant column in
PREWHERE
could be mutated concurrently by multiple threads (inMergeTreeReadTask::read()
viashrinkToFit()
), because for single-row columns it returns the same object without copying (e.g., viamaterialize()
).Fixes: #85404