Repository navigation
Fix false-positive assertion in paranoid check for covered parts on startup - #100652
Conversation
…perOnStart` `createLogEntriesToFetchBrokenParts` was calling `paranoidCheckForCoveredPartsInZooKeeperOnStart` with an empty `parts_to_fetch` list. This caused a false-positive `chassert(false)` when a covered part existed in ZooKeeper but was missing from disk and was expected to be fetched from another replica. The fix computes `parts_to_fetch` by finding ZooKeeper parts that don't have an active containing part locally, matching the logic already used in `checkPartsImpl`. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100364&sha=4020500293a0a0039b8c4d9e679dfabb8908e9f7&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%2C%20s3%29 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Workflow [PR], commit [fc7c14c] Summary: ✅ AI ReviewSummaryThis PR fixes a real startup correctness issue in PR Metadata
Exact replacement:
Suggested replacement:
Findings
Tests
ClickHouse Rules
Final VerdictStatus: Minimum required actions:
|
| if (!storage.getActiveContainingPart(part_name)) | ||
| parts_to_fetch.push_back(part_name); | ||
|
|
||
| storage.paranoidCheckForCoveredPartsInZooKeeperOnStart(parts_in_zk, parts_to_fetch); |
There was a problem hiding this comment.
This change fixes a subtle assertion path in createLogEntriesToFetchBrokenParts, but the PR has no test changes. A test that reproduces: part exists in Keeper, is covered by another Keeper part, is missing on disk, and is expected to be fetched would prevent future regressions.
| if (!storage.getActiveContainingPart(part_name)) | ||
| parts_to_fetch.push_back(part_name); | ||
|
|
||
| storage.paranoidCheckForCoveredPartsInZooKeeperOnStart(parts_in_zk, parts_to_fetch); |
There was a problem hiding this comment.
Changelog category currently says CI Fix or Improvement, but this PR changes ReplicatedMergeTree startup correctness (createLogEntriesToFetchBrokenParts / paranoidCheckForCoveredPartsInZooKeeperOnStart) rather than CI infrastructure.
Please switch category to Bug Fix (or Not for changelog if you intentionally keep this out of the changelog).
LLVM Coverage Report
Changed lines: 87.50% (7/8) · Uncovered code |
…rOnStart The paranoid check on startup verifies that all ZK parts covered by another ZK part either exist on disk or are in the parts_to_fetch list. However, it does not check whether a local active part already covers the ZK part. This legitimately happens after a merge or mutation: the covering part is active locally, the covered part was cleaned from disk by clearOldPartsAndRemoveFromZK, but the covered part's ZK entry has not been cleaned up yet (ZK cleanup can lag behind disk cleanup, or the server was restarted between the two). The data is preserved in the local covering part, and the stale ZK entry will be removed by the cleanup thread after startup. Without this fix, the chassert(false) fires as a false positive in debug/sanitizer builds during stress tests, particularly in the createLogEntriesToFetchBrokenParts() call path (STID: 2508-5dc3, 2508-6644). Prior fixes PR ClickHouse#96164, ClickHouse#96705, and ClickHouse#100652 addressed other false-positive scenarios in this function but missed the case where a local active part covers the ZK part. Co-Authored-By: Claude Opus 4.6 <[email protected]>
createLogEntriesToFetchBrokenPartswas callingparanoidCheckForCoveredPartsInZooKeeperOnStartwith an emptyparts_to_fetchlist. This caused a false-positivechassert(false)when a covered part existed in ZooKeeper but was missing from disk and was expected to be fetched from another replica.The fix computes
parts_to_fetchby finding ZooKeeper parts that don't have an active containing part locally, matching the logic already used incheckPartsImpl.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100364&sha=4020500293a0a0039b8c4d9e679dfabb8908e9f7&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%2C%20s3%29
#100364
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.4.1.337