Repository navigation
redo Part with unknown projections should not be marked as lost forever - #99623
Conversation
|
Semen Checherinda seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
…rojections After handling unknown projections, clear projections_on_disk so the throw_on_broken_projection block does not re-throw for already-handled entries. This fixes CHECK TABLE returning failure for parts with unknown projections. Suppress expected warnings in the test only for CHECK TABLE and OPTIMIZE commands that read parts with unknown projection directories. Co-Authored-By: Claude Opus 4.6 <[email protected]>
| # knows about projection pp. | ||
| run "ALTER TABLE t_unknown_proj_1 ATTACH PARTITION 0" | ||
|
|
||
| # The part must be usable: CHECK TABLE should pass and data should be intact. |
There was a problem hiding this comment.
The comment says CHECK TABLE should pass, but the assertion right below expects Found unexpected projection directories: pp.proj in stderr.
Could you reword this to match actual behavior (for example: "CHECK TABLE should report unknown projection directories, while the part remains readable")? The current wording is misleading during future triage.
There was a problem hiding this comment.
The warning message is expected, but the check should pass.
|
|
`sendPartFromDisk` already patches `data_checksums` for unknown `.proj` entries so the sender-side `checkEqual` passes, but the receiver in `downloadPartToDisk` was not doing the same. When `checksums.txt` contains `.proj` entries that were not transferred (projection dropped while part was detached), the receiver-side `checkEqual` would fail. Copy unknown `.proj` entries from `checksums.txt` into `data_checksums` before the check, mirroring the sender-side logic. Add test coverage: sync replica 2 and verify it successfully fetches the part with unknown projection from replica 1 on a local disk. Co-Authored-By: Claude Opus 4.6 <[email protected]>
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 97.44% (38/39, 0 noise lines excluded) |
… with unknown projections PR ClickHouse#99623 fixed the receiver-side `downloadPartToDisk` so the immediate `checkEqual` passes after fetching a part whose `checksums.txt` references a projection that is no longer in the table metadata. However, any subsequent call to `checkDataPart` (from `CHECK TABLE` or `ReplicatedMergeTreePartCheckThread`) still fails with `NO_FILE_IN_DATA_PART`, because: - `projections_on_disk` is built by iterating the part directory for `.proj` subdirectories — the directory was never transferred, so it stays empty. - The guard added by ClickHouse#99623 (`if (!projections_on_disk.empty())`) does not fire. - `checksums_txt` (loaded from the on-disk `checksums.txt` written verbatim from the sender) still contains the `pp.proj` entry. - `checksums_data` does not contain `pp.proj` (directory was never on disk). - `checksums_txt.checkEqual(checksums_data)` throws `NO_FILE_IN_DATA_PART`. The part is then marked broken, re-fetched from replica 1, and the cycle repeats. **Fix:** after the existing block that removes unknown projection directories present on disk from `checksums_txt`, add a complementary pass that removes any remaining `.proj` entries in `checksums_txt` whose key is absent from `checksums_data`. This covers the fetch case where the directory was never on disk at all. **Test:** extend `03822_attach_with_unknown_projection.sh` to run `CHECK TABLE t_unknown_proj_2` after `SYSTEM SYNC REPLICA t_unknown_proj_2`, explicitly covering the code path that was broken. Fixes: ClickHouse#100413 Related: ClickHouse#99623 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Cherry-picked from ClickHouse/ClickHouse master (PR #99623).
Cherry-picked from ClickHouse/ClickHouse master (PR ClickHouse#99623).
Changelog category (leave one):
Redo #95952
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Part with unknown projections should not be marked as lost forever
Documentation entry for user-facing changes
Version info
26.4.1.73