Skip to content

Implement rkv->sqlite migration#3488

Open
badboy wants to merge 1 commit into
sqlite/metric-labelsfrom
sqlite/rkv-migration
Open

Implement rkv->sqlite migration#3488
badboy wants to merge 1 commit into
sqlite/metric-labelsfrom
sqlite/rkv-migration

Conversation

@badboy

@badboy badboy commented Jun 8, 2026

Copy link
Copy Markdown
Member

It will be applied at start if
(1) no sqlite database is detected, and
(2) an Rkv database is detected.

Migration works by iterating through all data in the rkv "safe-mode" database and inserting it into the new database. The Rkv database will be kept on disk. This will allow for a rollback if any problems are detected in production and we can implement a recovery step then.


This is straight forward to implement now!
A whole bunch of tests are coming in a bundle later though.

@badboy badboy added the sqlite Any changes to the new SQLite storage backend label Jun 8, 2026
@badboy badboy force-pushed the sqlite/rkv-migration branch from 134f98a to 5990091 Compare June 9, 2026 12:05
@badboy badboy force-pushed the sqlite/metric-labels branch from b861171 to 18b377a Compare June 9, 2026 12:06
@badboy badboy force-pushed the sqlite/rkv-migration branch from 5990091 to 0da9f2b Compare June 9, 2026 12:07
@badboy badboy marked this pull request as ready for review June 9, 2026 12:52
@badboy badboy requested a review from a team as a code owner June 9, 2026 12:52
@badboy badboy requested review from chutten and removed request for a team June 9, 2026 12:52
Comment thread glean-core/tests/sqlite_migration.rs
Comment thread glean-core/src/database/sqlite.rs
@badboy badboy force-pushed the sqlite/metric-labels branch from 18b377a to c51e1e6 Compare June 10, 2026 10:12
@badboy badboy force-pushed the sqlite/rkv-migration branch 3 times, most recently from cb9ef95 to 79d8ba3 Compare June 10, 2026 11:05
It will be applied at start if
(1) no sqlite database is detected, and
(2) an Rkv database is detected.

Migration works by iterating through all data in the rkv "safe-mode" database and inserting it into the new database.
The Rkv database will be kept on disk. This will allow for a rollback if any problems are detected in
production and we can implement a recovery step then.

migrate rename
@badboy badboy force-pushed the sqlite/rkv-migration branch from 79d8ba3 to cd9b97b Compare June 10, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqlite Any changes to the new SQLite storage backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants