Repository navigation
Fix server crash on startup (in the Upgrade Check) related to transactions (experimental) when loading mutations with outdated TID - #96238
Merged
Conversation
During upgrade checks, the server could crash in `StorageMergeTree::loadMutations` with a `LOGICAL_ERROR` exception: "Trying to get CSN for too old TID". This happened because `TransactionLog::assertTIDIsNotOutdated` was called for mutation entries whose TID had been garbage-collected from the transaction log (i.e., `tail_ptr` had advanced past `TID.start_csn`). In upgrade scenarios, the old binary could advance `tail_ptr` during stress testing, and when the new binary started and loaded mutations, uncommitted mutation entries with outdated TIDs would trigger the assertion. The assertion was unnecessary here: if a mutation has no CSN (`entry.csn == 0`) and `TransactionLog::getCSN` returns nothing, the mutation was not committed regardless of whether the TID is outdated. The correct action in both cases is to remove the uncommitted mutation file, which the code already does on the next line. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
|
Workflow [PR], commit [856f7c2] Summary: ❌
|
This was referenced Aug 13, 2026
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.
During upgrade checks, the server could crash in
StorageMergeTree::loadMutationswith aLOGICAL_ERRORexception: "Trying to get CSN for too old TID".This happened because
TransactionLog::assertTIDIsNotOutdatedwas called for mutation entries whose TID had been garbage-collected from the transaction log (i.e.,tail_ptrhad advanced pastTID.start_csn). In upgrade scenarios, the old binary could advancetail_ptrduring stress testing, and when the new binary started and loaded mutations, uncommitted mutation entries with outdated TIDs would trigger the assertion.The assertion was unnecessary here: if a mutation has no CSN (
entry.csn == 0) andTransactionLog::getCSNreturns nothing, the mutation was not committed regardless of whether the TID is outdated. The correct action in both cases is to remove the uncommitted mutation file, which the code already does on the next line.Changelog category (leave one):
See https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96109&sha=2646faac0046ba91a49626371ca4a24ff30ea4f7&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
#96109
Version info
26.2.1.348