Repository navigation
[PR] fix(storage): count active blocks without loading content - #6626
Merged
ranxianglei merged 1 commit intoNov 14, 2026
Merged
Conversation
This was referenced Nov 14, 2026
Owner
|
Superseded by #6677 (merged as Landed into master via the real merge commit The fix for #6624 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 #6624.
The drift-latched cold-load path compares the index and envelope active-block counts to choose the fuller compression history. Its scalar helper currently hydrates every block and decodes both CAS views before counting, including inactive block content. Large retained summaries therefore add avoidable work before the actual recovery load.
Changes
UnifiedShadow.activeBlockCount().active = 1semantics, session isolation, orphan block rows without a session header, missing-session zero, and null when the synchronous lane is unavailable or errors.Measured effect
Node 24.22.1, built-in SQLite, real sessions ingested through
planIngestwith both full and one-line block views. Each workload has seven fresh baseline/candidate process pairs with alternating order. Setup, one warmup, input hashing and teardown are outside the measured interval; each interval measures completeUnifiedShadow.activeBlockCount()calls.The large-case ranges are 1,126.274–1,349.795 ms before and 6.290–7.860 ms after. Input hashes and returned counts match across all fourteen runs of every workload. These are scalar-helper measurements, not end-to-end cold-load, memory, or inference-throughput claims. The existing session/block index is sufficient; no new index or migration is introduced.
Validation
active = 2, other sessions, missing headers/content, unchanged persisted rows/CAS ownership, closed SQLite and async-backend null behavior.git diff --checkpass.persist.tsarbitration.This is separate from #6618: that change makes necessary content reads cheaper; this change avoids content reads entirely when the caller only needs a count. Current-head remote CI remains a separate publication check.