fix(store): persist periodic SQLite cleanup and retry failed deletes - #2344
Merged
Merged
Conversation
Refs #2343. Exercise a real cleanup timer and durable reopen without final persistence masking the missing write. Co-authored-by: Codex <codex@vectorcontrol.tech>
Commit background retention deletes, retry a failed transaction on later cleanup ticks, and finish owned workers before final persistence and database close. Cover durable reopen, SQL fault recovery and shutdown ordering with production-cadence synctest regressions. Co-authored-by: Codex <codex@vectorcontrol.tech>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
7 tasks
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
LastPersistErrorreporting.Closes #2343
Verification
Four focused tests use real SQLite with
testing/synctestvirtual time to drive the constructor's unchanged production cadence: durable deletion before close, retry after SQL trigger failure, close flushing pending cleanup and close waiting for owned work. The reopen helper deliberately bypasses finalClose/Flushpersistence, so shutdown cannot conceal a missing background commit. Unrelated queued run/checkpoint data is retained.Three temporary negative controls each failed for the intended behavioral reason and were restored byte-for-byte:
Passed locally using Go 1.26.5:
CGO_ENABLED=0:go test -p 2 ./internal/store ./internal/api -count=1 -cpu=4 -timeout=10m.CGO_ENABLED=1:go test -race -p 2 ./internal/store ./internal/api -count=1 -cpu=4 -timeout=10m.go vet -p 2 ./internal/store ./internal/api;staticcheck ./internal/store ./internal/api; gofmt clean.verify-doc-ssot.py,verify-project-skills.py,verify-real-e2e-contract.py, OpenAPI YAML parse andgit diff --check. Skills-specific checks report their existing absent-root skip/trivial-pass boundary; this is not real E2E.Boundaries / pending
The 5-minute cadence, 24-hour terminal TTL, 50-per-thread cap, terminal states, cascade membership, public API, SQL/schema, connection pool, PRAGMAs and WAL policy are unchanged. No runtime configuration, deployment, restart or real workspace-file deletion. This is local SQLite durability/fault-injection evidence, not a production-load, real process-kill, live-login or packaged Desktop claim. All seven required checks passed on
df01b0e1cc8eefba209e6125af2205407233cd66; checks workflow 34034111396 completed successfully. Frontend-only lanes were intentionally path-filtered. CodeRabbit reported Review skipped; this is not an automated review approval.