Repository navigation
improve: reduce repeated archive journal validation work - #334
Merged
Merged
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
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 Problem This Solves
Archive opens, status reads and native captures repeatedly validate the change journal. Each validation currently prepares 23 separate schema lookups plus a trigger-count query.
User Impact
Journal validation does less SQLite work. Missing or modified objects, unexpected journal triggers and invalid journal state still fail validation and retain the existing repair behavior.
Why This Change Was Made
Read the relevant schema definitions together, then compare the same expected definitions. Keep dynamic source-column inspection and journal-state checks. Add coverage for unexpected triggers and unrelated schema objects, plus a repeatable validator benchmark.
Evidence
Independent P0–P3 review: scoped-clean.
Five alternating baseline/candidate benchmark pairs: median 313,932 → 168,517 ns/op (46% lower). Allocations: 2,227 → 1,887 per call; bytes: about 172,060 → 161,590.
Baseline ns/op: 313932, 400037, 486003, 305510, 312987. Candidate: 163655, 168517, 274936, 189149, 161289.
The benchmark measures journal validation on a synthetic temporary archive, not overall CI duration or billing savings.
Full local test suite, go vet and module tidiness checks passed.
Local validation uses GOWORK=off and CGO_ENABLED=0; hosted Linux race and native macOS checks remain required.
Hosted CI run 44733996219 passed on
9b50da54999ecb59618b44aec9df53afc5990be1, including Linux race, native macOS, lint, dependency checks and snapshot builds. Both secret scans, Docker and CodeQL also passed.