Repository navigation
refactor(sqlite): share one row cache across the SQLite-backed caches - #40028
Merged
Merged
Conversation
The last-status, GitHub cache, notification dismissal and model catalog stores each grew their own legacy-file import, read-only startup read, changed-row writer and retry backoff. They now share src/main/sqlite/row-cache/ (KeyedJsonRowCache with load/write, the legacy JSON source, one failure classifier and backoff); each store keeps only its cadence and fencing policy. Edge cases now behave the same in every store: - a corrupt or rejected older-build file keeps the stored rows (it no longer wipes them); - an older-build file that exists but cannot be read is never treated as absent; - the import receipt is the file's content hash, without its mtime, so a copied leftover is still recognised as imported; - while the rows or that file cannot be read, the store saves nothing that session and never deletes a file it did not load (dismissals keep retrying, as before); - files are user-only and hardened everywhere. The last-status and GitHub caches move to the shared row layout, so each rebuilds empty once.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
What
#39995, #39993 and #39997 each moved a JSON restart cache to SQLite, and each grew its own legacy-file import, startup read, changed-row writer and retry logic. This replaces those with one shared module,
src/main/sqlite/row-cache/:KeyedJsonRowCachehandles the startup read, which goes over a read-only connection.data_versionin one transaction.legacy-json-source.ts: absent / unreadable / read, with the receipt as a sha256 of the file bytes.row-cache-failure.ts: busy / corrupt / other classification and backoff.Each store keeps only its own policy:
The diff is +859 / −1,265 lines.
Edge cases now handled the same way in every store
Compatibility
Testing
pnpm lint(43 steps) and the sync-fs ratchet pass. The baseline shrinks from 11 entries to 3.