feat(storage): migrate control plane to SQLite - #274
Draft
PascaleBeier wants to merge 5 commits into
Draft
Conversation
Owner
Author
|
This PR is AI generated and a POC |
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
internal/controlstoreusingmodernc.org/sqliteHITKEEP_DB_PATHwhile retaining the post-split DuckDB source as migration recovery evidenceArchitecture and migration safety
The default tenant DuckDB file remains the root of the single tenant-data DuckDB instance. Non-default tenant files continue to use deterministic attached catalogs under the existing global memory and connection gates.
The new SQLite control store owns control-only schema, queries, migrations, health, takeout, and backup behavior. It uses WAL mode, full synchronization, foreign-key enforcement, bounded connections, a busy timeout, file-backed temporary storage, and no CGO dependency.
Legacy conversion:
Control backups now use validated SQLite snapshots, manifests, checksums, and completion markers. Tenant backups remain catalog-scoped DuckDB snapshots. Incomplete backup cycles are not considered restorable.
Operator impact
HITKEEP_DB_PATHnow points to the SQLite control database.<db-path>.pre-sqlite-2.13.0and is never automatically overwritten or deleted.Validation completed
go test -p 2 ./... -count=1go test -p 2 -tags billing ./... -count=1CGO_ENABLED=0 go test ./internal/controlstore -count=1Required before release
This draft must not be released until all manual gates pass:
No client database, production identifier, credential, or private diagnostic is included in this PR.