Core: Sweep only the transaction's own snapshots after commit - #18095
Open
raunaqmorarka wants to merge 1 commit into
Open
raunaqmorarka wants to merge 1 commit into
raunaqmorarka wants to merge 1 commit into
Conversation
Snapshots committed by other writers while the transaction was open cannot reference files it wrote, so reading their manifest lists during post-commit clean-up is wasted work that grows with the number of concurrent commits.
uros-b
approved these changes
Sep 14, 2026
Member
|
Nice change, thank you @raunaqmorarka! Also, well tested. Please ping committeres who are familiar with the transaction commit path / snapshot infrastructure (e.g. @nastra or @amogh-jahagirdar) |
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.
After a successful commit,
BaseTransactionreads the manifest list of every snapshot added since thebasecaptured before the retry loop, to avoid deleting a committed manifest during clean-up. That set includes snapshots other writers committed while the transaction was open. Those snapshots cannot reference files this transaction wrote, becausedeletedFilesonly holds manifests and manifest lists produced by the transaction's own updates. Reading them is wasted work.On S3 each manifest list read is a HEAD and a GET. With N concurrent inserts each commit reads the manifest lists of all snapshots committed since it opened, so the burst costs O(N^2) reads. Measured: 25 to 30 foreign snapshots per commit at about 35 ms each.
This change takes the starting snapshot set from
baseafter the retry loop.applyUpdatesrefreshesbaseon every attempt and the successful commit uses that field, socurrentminusbaseis exactly the snapshots this transaction created. A manifest deleted in one attempt and reused by a retry is still protected, because the transaction's own committed snapshot references it.Tests:
AI assistance (Claude Code) was used to develop this patch.