Repository navigation
Fix mark rows mismatch during lightweight delete with non-adaptive granularity - #102592
Closed
Daedalus-Icarus wants to merge 1 commit into
Closed
Daedalus-Icarus wants to merge 1 commit into
Daedalus-Icarus wants to merge 1 commit into
Conversation
…anularity Lightweight `DELETE` mutations on tables with `index_granularity_bytes = 0` (non-adaptive granularity) could cause a logical error after `DETACH`/`ATTACH`: "Incorrect mark rows for part ... in-memory N, on disk 8192". The root cause: `DELETE` reports `affectsAllColumns() == true`, so `MutateAllPartColumnsTask` created a new index granularity object instead of reusing the source part's granularity. The new object was adjusted during writing to match the actual row count, but non-adaptive mark files don't store per-mark granularity, so `validateColumnOfFixedSize` saw a mismatch between the in-memory value and the fixed 8192 assumed from settings. The fix reuses the source part's granularity for lightweight deletes, since they only update the `_row_exists` column without changing the row count. Closes #98585 CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=8bc6bb7c5c71412f303aa0705d11b667e2a6659c&name_0=MasterCI&name_1=BuzzHouse%20%28amd_debug%29
Contributor
|
Workflow [PR], commit [ab3ce57] Summary: ❌
AI ReviewSummaryThis PR fixes a real correctness issue where lightweight Findings💡 Nits
ClickHouse Rules
Final Verdict
|
| -- Tags: no-replicated-database | ||
|
|
||
| -- Lightweight DELETE on a table with non-adaptive index granularity (index_granularity_bytes = 0) | ||
| -- should not cause a "Incorrect mark rows" logical error after DETACH/ATTACH. |
Contributor
There was a problem hiding this comment.
Typo in the test description: a "Incorrect mark rows" logical error should be an "Incorrect mark rows" logical error.
1 task
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.
Lightweight
DELETEmutations on tables withindex_granularity_bytes = 0(non-adaptive granularity) could cause a logical error afterDETACH/ATTACH: "Incorrect mark rows for part ... in-memory N, on disk 8192".The root cause:
DELETEreportsaffectsAllColumns() == true, soMutateAllPartColumnsTaskcreated a new index granularity object instead of reusing the source part's granularity. The new object was adjusted during writing to match the actual row count, but non-adaptive mark files don't store per-mark granularity, sovalidateColumnOfFixedSizesaw a mismatch between the in-memory value and the fixed 8192 assumed from settings.The fix reuses the source part's granularity for lightweight deletes, since they only update the
_row_existscolumn without changing the row count.Closes #98585
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=8bc6bb7c5c71412f303aa0705d11b667e2a6659c&name_0=MasterCI&name_1=BuzzHouse%20%28amd_debug%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix logical error "Incorrect mark rows" during lightweight
DELETEon tables withindex_granularity_bytes = 0afterDETACH/ATTACH.Documentation entry for user-facing changes
No documentation changes are needed for this bug fix.