Repository navigation
Conversation
|
Workflow [PR], commit [aa88f8e] Summary: ✅
AI ReviewSummaryThis PR relaxes Findings❌ Blockers
Final Verdict
|
|
Updating the branch to fix the |
| /// check below. | ||
| bool non_transactional_removal = info.removal_tid.isNonTransactional(); | ||
|
|
||
| if (info.removal_csn && !(non_transactional_removal && info.removal_csn == Tx::NonTransactionalCSN)) |
There was a problem hiding this comment.
This makes creation_csn == UnknownCSN + non-transactional removal valid for every non-transactional remover, not just TRUNCATE. That changes the behavior of callers that externalize the source part before covering it. For example, DETACH PARTITION clones each selected active part into detached/ at src/Storages/StorageMergeTree.cpp:2802-2823, and MOVE PARTITION TO TABLE clones it into the destination table at src/Storages/StorageMergeTree.cpp:3239-3283. Their part selection still goes through getVisibleDataPartsVector* without MVCC filtering when there is no current transaction (src/Storages/MergeTree/MergeTreeData.cpp:6512-6528 and src/Storages/MergeTree/MergeTreeData.cpp:7946-7958), so an uncommitted insert part is eligible there. Before this patch those cases stopped on the logical error; after it they can complete and leak uncommitted rows outside the creating transaction. I think the exemption needs to be narrowed to the TRUNCATE/empty-coverage paths, or those externalizing DDLs need to stop selecting parts whose creation_csn is still unknown.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 4/9 (44.44%) · Uncovered code |
|
I think we should only remove committed parts when truncating with non-tx query. |
Fix a logical error thrown when a non-transactional TRUNCATE covers a part whose creating transaction is not committed yet.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix LOGICAL_ERROR when TRUNCATE TABLE removes a MergeTree part whose creating transaction has not committed yet.