refactor(db): return sync results explicitly#1224
Merged
Conversation
PR Build Metrics
Binary Size
Dependency ChangesNo dependency changes. govulncheck OutputBuild Info
History (2 previous)
🤖 Updated on each push. |
Collaborator
Author
|
Follow-up after comparing this phase-1 branch against What I added on this branch:
Commands run on this branch:
Focused comparison runs against
Interpretation:
My read at this point:
I wanted this written down here so the merge decision can be based on actual branch-vs-main comparison instead of a single flaky soak run. |
4 tasks
Owner
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
benbjohnson
approved these changes
Apr 10, 2026
7272b64 to
2c90fb0
Compare
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.
Summary
verifyAndSync()to return asyncResultinstead of relying onsync()to apply sync state as a side effectSync()andcheckpoint()applySyncResult()Why
This is the first increment from #1221, following Ben's comment to start with
SyncResultand keep the refactor very small.The existing proof-of-concept work in #1222 and branch
issue-1221-proposal-incremental-extraction-of-sync-checkpoint-monitorinwas useful to validate the overall direction, but it is too broad to merge safely or review comfortably in one pass. The plan here is to keep that branch as reference material only, and land the extraction as small, reviewable steps instead.Scope
This PR intentionally stops at the
SyncResultextraction. It does not include the wider checkpoint restructuring, sync-state split, restore extraction, or soak-test expansion from the proof-of-concept branch.Testing
pre-commit run --all-filesgo test ./...go test -race ./...go test . -run '^(TestApplySyncResult|TestDB_Sync_UpdatesMetrics|TestDB_Sync_InitErrorMetrics)$' -count=1go test . -run '^(TestDB_CheckpointDoesNotTriggerSnapshot|TestDB_CheckpointPageGapWithConcurrentWrites|TestDB_Sync_CompactionValidAfterGrowthAndCheckpoint)$' -count=1go test -count=1 -v -tags='integration,soak' -run '^(TestLTXBehavior|TestLTXBehavior_NoExcessiveSnapshots)$' -test.short -timeout=30m ./tests/integration