Skip to content

fix(storage): use current tenant for account snapshots#169

Merged
XuPeng-SH merged 1 commit intomatrixorigin:mainfrom
gouhongshen:fix/current-tenant-account-snapshots-20260404
Apr 4, 2026
Merged

fix(storage): use current tenant for account snapshots#169
XuPeng-SH merged 1 commit intomatrixorigin:mainfrom
gouhongshen:fix/current-tenant-account-snapshots-20260404

Conversation

@gouhongshen
Copy link
Copy Markdown
Contributor

Summary

  • remove the hardcoded FOR ACCOUNT sys from execute-path pre-migration account snapshots
  • align legacy single-db safety snapshots to use the same current-tenant account snapshot form
  • update the git-for-data RFC examples to match the tenant-safe MatrixOne syntax

Validation

  • cargo check -p memoria-storage -p memoria-cli
  • real memoria migrate legacy-to-multi-db --execute on a non-sys tenant test DB
  • inspected migrate-run.json: no warnings, no row mismatches
  • SQL spot-check: sampled mem_user_registry mapping and mem_memories counts match legacy/user DB

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 4, 2026 08:03
@XuPeng-SH XuPeng-SH enabled auto-merge (squash) April 4, 2026 08:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sys from 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 XuPeng-SH merged commit 72802c1 into matrixorigin:main Apr 4, 2026
8 of 9 checks passed
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
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.

3 participants