fix(storage): use current tenant for account snapshots#169
Merged
XuPeng-SH merged 1 commit intomatrixorigin:mainfrom Apr 4, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates MatrixOne snapshot operations to target the current tenant/account instead of hardcoding sys, ensuring pre-migration and safety snapshots work correctly in non-sys tenants.
Changes:
- Remove hardcoded
FOR ACCOUNT sysfrom pre-execution migration account snapshots. - Align legacy single-db safety snapshot creation to use
FOR ACCOUNT(current tenant) when no database is selected. - Update RFC documentation/examples to match the tenant-safe MatrixOne snapshot syntax.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
memoria/docs/git-for-data-rfc.md |
Updates documented snapshot/restore SQL examples to use current-tenant FOR ACCOUNT syntax. |
memoria/crates/memoria-storage/src/store.rs |
Changes safety snapshot creation (account-scope path) to avoid hardcoding sys. |
memoria/crates/memoria-storage/src/migration.rs |
Changes pre-migration snapshot creation to use the current tenant/account rather than sys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
XuPeng-SH
approved these changes
Apr 4, 2026
mergify Bot
pushed a commit
that referenced
this pull request
Apr 6, 2026
## Summary - rebase the branch onto current `upstream/main`, keeping only the follow-up fixes that are not already included by `#167` and `#169` - stabilize the per-user DB rollout by finishing the routed-store / DB-switching follow-ups and fixing multi-db stats routing - remove access-count ranking bias from retrieval scoring, refresh the architecture guide, add the cutover runbook, and expose MCP trust-tier guidance with strict validation ## Validation - `cargo test -p memoria-mcp --test tools_unit test_tools_list -- --nocapture` - DB-backed tests still require a live MatrixOne/MySQL instance via `DATABASE_URL` (default: `mysql://root:111@localhost:6001/...`); current local environment has no listener on `6001` Approved by: @XuPeng-SH
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
FOR ACCOUNT sysfrom execute-path pre-migration account snapshotsValidation
cargo check -p memoria-storage -p memoria-climemoria migrate legacy-to-multi-db --executeon a non-sys tenant test DBmigrate-run.json: no warnings, no row mismatchesmem_user_registrymapping andmem_memoriescounts match legacy/user DB