Skip to content

Add migration to backfill models-by-engine-quantization index#189

Closed
yuranich wants to merge 1 commit into
tetherto:mainfrom
yuranich:migration/backfill-engine-quantization-index
Closed

Add migration to backfill models-by-engine-quantization index#189
yuranich wants to merge 1 commit into
tetherto:mainfrom
yuranich:migration/backfill-engine-quantization-index

Conversation

@yuranich

@yuranich yuranich commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Summary

One-off migration script to backfill the compound models-by-engine-quantization index added in PR #145. HyperDB writes index keys at insert time; records inserted before the new index existed have no keys for it. Autobase does not replay the full log on restart, so a plain server restart leaves the new index empty for existing data.

Technical approach

The script opens the same Autobase/corestore used by the indexer (server must be stopped) and re-appends every model as a put-model dispatch with a custom apply handler that calls HyperDB.insert() with force: true. This bypasses the identical-value short-circuit so all index keys — including the new compound one — are written. Existing index keys are idempotently overwritten; the only net change is the new models-by-engine-quantization entries.

Usage

cd packages/qvac-lib-registry-server
node migrations/001-backfill-engine-quantization-index.js --storage <corestore-path> [--bootstrap <key>] [--dry-run] [--batch-size 50]
  1. Stop the staging server
  2. Deploy code with PR feat(qvac-registry-schema): add findBy() method to RegistryDatabase #145 merged and spec rebuilt
  3. Run the migration
  4. Restart the server

--dry-run lists all models without writing.

Breaking changes

None. One-off script, no runtime code modified.

Co-authored-by: Cursor <cursoragent@cursor.com>
@yuranich yuranich requested review from a team as code owners February 10, 2026 02:03
@yuranich yuranich closed this Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant