Repository navigation
Add migrate CLI command with datastore:// storage rewrite (Phase 2, #347) - #391
Merged
Merged
Conversation
) Rebuilt on current main: the previous branch stacked on #390's overlay commits, which were squash-merged, leaving only the cli/ changes as the actual contribution. Co-Authored-By: Claude Fable 5 <[email protected]>
…ewrite, carry caches The v2 DDL path maps duplicate creates to 400 with an "already exists" message (there is no 409), so apply keys on that to stay idempotent. The engine resolves every datastore:// URI except the __sys__ metastore as an HBase namespace/table, so the __jdbc__/__local__ sentinel URIs would create labels the server cannot route — plan now fails fast when a label references a non-HBASE storage. Label caches were silently dropped; the plan now carries them. Co-Authored-By: Claude Fable 5 <[email protected]>
em3s
force-pushed
the
feat/issue-347-migration-scripts
branch
from
July 23, 2026 15:05
2eae31f to
d95eba1
Compare
Contributor
Author
|
Optimistic |
Closed
8 of 21 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
Adds a native
migrateCLI command to seed metadata into HBase for Phase 2 of #347, replacing the earlierdev/*.pyprototype scripts (never merged). Each label's storage reference is rewritten to adatastore://URI during migration, so the seeded metadata is valid against the new storage model (#398).Once migration completes, MySQL is effectively dead. Every key exists in HBase, so the overlay (#390) always returns the HBase value and never falls through to MySQL. No code change needed — MySQL just stops being read. That's the gate for Phase 3.
I rebuilt the branch on current main: it previously stacked on #390's overlay commits, which have since been squash-merged. Re-verifying against main surfaced three contract drifts, fixed here: duplicates surface as
400(not409), only HBASE storages have adatastore://equivalent, and labelcacheswere dropped from the replay body.Related: #347, #390, #398
Changes
cli/internal/command/migrate.go— new command, two phases:migrate plan [-o <file>]reads databases/tables/aliases (sys/origin skipped) and writes a{path, body, label}planmigrate apply [-i <file>]replays each entry; duplicates are skipped so re-runs are idempotentfailOnExistduplicates to400with an "already exists" message (AbstractLabel→ExceptionController) — there is no409. A plain409is still treated as a skip.HBASE → datastore://<namespace>/<table>. The engine resolves everydatastore://URI except the reserved__sys__metastore as an HBase namespace/table, so minting sentinel URIs for JDBC/LOCAL would create labels the server can't route.migrate planfails fast, with the reason, if a label references a non-HBASE storage. References that are alreadydatastore://URIs pass through unchanged.cachesare carried into the replay body (previously dropped silently).client.PostRaw/http.PostForResult— POST returning status + raw body, so apply can key on the error message; failures print the server responsecommand_type.go,actionbase_runner.go— register the commandtableBodyrewrite paths, duplicate matching, and the sys/origin filterHow to Test
migrate applyexits non-zero if any entry fails.AI Assistance