Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns#88605
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? (or maybe even later)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
Backport #88605 to 25.9: Fix potential crash caused by concurrent mutation of underlying const PREWHERE columns
Backport #88605 to 25.3: 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
PREWHEREcould 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