Repository navigation
[PR] fix(storage): report actual session cleanup ownership - #6622
Merged
ranxianglei merged 1 commit intoNov 14, 2026
Merged
Conversation
Owner
|
Superseded by #6677 (merged as Landed into master via the real merge commit The fix for #6620 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix. |
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 #6620.
The session-maintenance CLI reports rows and bytes released by deletion, but its accounting currently confuses references with owners, includes pinned survivors, and counts Unicode characters as bytes. This can understate reclaimable content or claim that retained checkpoint bytes were freed.
Changes
deleteSession()per content hash withUNION ALL. Several references owned by one session can release the same blob; a pinned checkpoint contributes zero releases and continues to keep its blob alive. Report each reclaimed blob once.orphans_json, alongside the existing session JSON, block payload and extension fields.pinnedCheckpointsas a subset of checkpoint rows and subtract the surviving rows exactly once.Observable correction
These values come from real SQLite fixtures and actual deletion, not mocked query results:
Logical payload-byte accounting is separate from physical database shrinkage. The existing
indexDbBefore,indexDbAfterand vacuum result continue to report that separately; this does not promise immediate file-size reduction.Validation
git diff --checkpass.No configuration, schema/version, kernel or persistence-format changes. Current-head remote CI is a separate check after publication.