Skip to content

[Bug]: mo_catalog.mo_account transiently returns no row for an existing active account #25513

Closed as not planned

Description

@endlesschasey-ai

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

v4.0.0-rc4 (official docker image registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:4.0.0-rc4)

Commit ID

unknown (image tag 4.0.0-rc4)

Other Environment Information

  • Hardware parameters: amd64 Linux CI runner (docker-in-docker), single-node MatrixOne launched from the official image
  • OS type: Linux
  • Others: MySQL protocol on port 6001. The lookup that fails is a sys-account query SELECT account_name, status, created_time, comments FROM mo_catalog.mo_account WHERE account_name = ?, issued while other test groups concurrently run CREATE ACCOUNT / CREATE DATABASE / DROP DATABASE on the same instance.

Actual Behavior

A query on mo_catalog.mo_account transiently returns no row for an existing, active tenant account — an account on which the two immediately preceding tenant-upgrade steps had just executed DDL successfully (seconds earlier).

Raw state dump from the failing run (2026-07-07; tasks id=26/29 completed against that tenant account, task id=30 then failed to find it; it failed twice — attempts=2 — before the application gave up):

tenant upgrade blocked: task_id=30 target=1.0.0.30 error_class=permanent
error=database account not found
tenant_tasks=[
  {id=30 target=1.0.0.30 attempts=2 last_error="database account not found"},
  {id=29 target=1.0.0.28 state=completed},
  {id=26 target=1.0.0.27 state=completed}]

This is the most damaging of the three sibling reports: the application (reasonably) classifies "account not found" as a permanent error, so a single transient visibility blip permanently blocks that tenant's upgrade pipeline until manual repair.

Expected Behavior

mo_catalog.mo_account must consistently return committed, existing accounts. An account that just executed statements successfully cannot be absent from the catalog moments later.

Steps to Reproduce

No minimal standalone repro yet — observed as a low-frequency race under the MOI integration suite's tenant-upgrade tests with concurrent multi-tenant DDL on the same instance. Evidence trail: matrixorigin/matrixflow#12822 (internal, signature 3); CI job with raw logs: https://github.com/matrixorigin/matrixflow/actions/runs/28845823239/job/85549556753 (internal).

Additional information

Likely the same visibility root class as the sibling reports filed alongside this one (transient FK-parent-not-visible Error 1452, and transient Unknown database Error 1049) — three facets of committed-object visibility under concurrent multi-tenant DDL load.

Activity

  1. added theissue type on Jul 7, 2026
  2. added this to the MO-202607 milestone on Jul 7, 2026
  3. aptend commented on Jul 7, 2026

    @aptend
    Contributor

    After checking the raw MO logs for the reported run, this does not look like a transient mo_catalog.mo_account visibility issue.

    For workspace/account ws_401fc77d:

    UTC Event Evidence
    06:38:14.278 CREATE ACCOUNT committed TN commit for txn ...799b8c, account id 71
    06:38:14.433 CREATE DATABASE moi committed TN commit for txn ...799bf7
    06:38:16.143 MOI workspace saga completed workspace created successfully via saga, workspace bf664aad-b678-fb4e-f1e9-b9ae63f61a49, account ws_401fc77d
    06:38:26.663 DROP ACCOUNT ws_401fc77d started session connectionId 1265, account sys:dump, role moadmin, select ... __mo_account_lock ... for update
    06:38:27.094 tenant worker still logged in successfully session connectionId 1267, account ws_401fc77d:..., CheckTenant succeeded while drop was running
    06:38:30.599 mo_account row deleted delete from mo_catalog.mo_account where account_name = "ws_401fc77d"
    06:38:30.740 drop transaction committed TN commit for txn ...79aee9, state [Committed]
    06:38:30.773 worker hit Unknown database moi expected after committed drop of moi
    06:38:31.204 new tenant login hit there is no tenant ws_401fc77d expected after committed delete of mo_account

    The DROP ACCOUNT was not issued by the tenant worker. It came from a separate sys/admin session:

    connectionId 1265
    remote 172.22.0.1:39948
    account sys:dump
    role moadmin
    session_id 019f3b4c-a2b5-7549-b1cc-13847d9a1307
    statement_id 019f3b4c-a565-7e3b-940a-63b2a9561d94
    trace_id 051bea9b-6072-10f0-59cc-77aa92cfd513
    

    The failing tenant worker was a different session using the tenant account after the committed drop.

    Conclusion: the account did not transiently disappear from mo_catalog.mo_account; it was actually dropped and the drop transaction committed before the later account not found / Unknown database errors. The race is in MOI test/lifecycle coordination: a cleanup/delete path can DROP ACCOUNT while tenant upgrade workers are still processing that workspace.

    Recommended action: move this to the MatrixFlow/MOI side. The test framework / upgrade worker should ensure workspace/account deletion is coordinated with tenant upgrade tasks, or workers should treat deleted workspaces/accounts as lifecycle deletion instead of MO catalog visibility failure.

  4. added
    severity/s0
    and removed on Jul 7, 2026
  5. assigned and unassigned on Jul 7, 2026
  6. XuPeng-SH commented on Jul 7, 2026

    @XuPeng-SH
    Contributor

    @heni02 please help to close it

  7. endlesschasey-ai commented on Jul 7, 2026

    @endlesschasey-ai
    Author

    @aptend Confirmed on our side — same conclusion as #25512. The DROP ACCOUNT came from MatrixFlow's own test-suite account sweeper (CleanupSuiteOrphanedMOAccounts) running in a parallel test-python-sdk process that finished mid-run and swept all test_-prefixed accounts, including live ones owned by the concurrently running auto-upgrade suite. Not an MO bug. Closing; fix lands in MatrixFlow. Thanks for the session-level trace — it was decisive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugseverity/s0

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions