Repository navigation
fix: TRUNCATE keeps rows written earlier in the same batch - #90
Merged
Merged
Conversation
`expand_truncates` turned a TRUNCATE into deletes of the keys in the
FileIndex — the rows already materialized — but rows written earlier in
the same fold step aren't there yet, so they survived it. The TRUNCATE
now also drops the events before it in the step; earlier steps of the
unit are in the FileIndex already.
Also: the delete half of a split key change carried the update's
unchanged TOAST columns, so TOAST resolution ran for a delete. Replayed
after a crash between claim and ack, that delete comes after the first
copy moved the row, and resolution failed for good ("TOAST resolution
failed: PK … is not in any indexed data file"). The split now leaves the
delete none, and resolution skips deletes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes
truncate_removes_rows_not_yet_materialized, plus a TOAST stall the random DST found while I was verifying this fix.expand_truncatesturned a TRUNCATE into deletes of the keys in the FileIndex, meaning the rows already materialized. Rows written earlier in the same fold step aren't in the FileIndex yet, so they survived. The TRUNCATE now also drops the events before it in the step. Earlier steps of the same unit are covered already, because preparing a step updates the FileIndex.