Repository navigation
Description
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 workload is a tenant-upgrade pipeline: it connects as a non-sys tenant account (
account:userlogin) withDBName=moiand executes a chain of DDL migrations against that tenant'smoidatabase, while other test groups concurrently run CREATE/DROP DATABASE and CREATE ACCOUNT elsewhere on the same instance.
Actual Behavior
In the middle of a migration chain, a CREATE TABLE IF NOT EXISTS statement transiently fails with Error 1049 (HY000): Unknown database moi — for a database in which the two immediately preceding migration steps had just executed DDL successfully (seconds earlier, same tenant account, same connection parameters).
Raw state dump from the failing run (2026-07-07; tasks id=39/40 completed fine in database moi, task id=41 then hit 1049):
tenant upgrade failed: task_id=41 target=1.0.0.60 error_class=transient
error=ensure tenant migration table: Error 1049 (HY000): Unknown database moi
tenant_tasks=[
{id=41 target=1.0.0.60 attempts=1 last_error="ensure tenant migration table: Error 1049 (HY000): Unknown database moi"},
{id=40 target=1.0.0.55 state=completed},
{id=39 target=1.0.0.52 state=completed}]
The database obviously still exists: a scheduler retry of the same statement succeeds, and the same test passed on the rerun of the identical commit. Frequency is roughly one occurrence per dozens of full CI runs.
Expected Behavior
A database that exists (and just successfully executed DDL in the same session lineage) must never be reported as Unknown database to a subsequent statement. Catalog visibility of committed objects should be monotonic.
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 2); CI job with raw logs: https://github.com/matrixorigin/matrixflow/actions/runs/28841569270/job/85542178472 (internal, attempt 1).
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 tenant-account-not-found) — three facets of committed-object visibility under concurrent multi-tenant DDL load.
Activity
endlesschasey-ai commentedon Jul 7, 2026
Third independent occurrence within ~27h, same fingerprint on yet another branch/workspace/runner (2026-07-07T08:27Z, branch
fix-10739):Again: offsets .52/.55 had just executed DDL successfully in the same tenant database seconds earlier, then .60 got
Unknown database. Frequency is roughly 2-3 hits per day across the CI fleet.aptend commentedon Jul 7, 2026
I checked the raw logs from the failing attempt (
matrixorigin/matrixflow/actions/runs/28841569270, attempt 1, job85542178472). This looks like the same test lifecycle race as #25513, not a committed-catalog visibility issue.Timeline for the failing workspace:
bf6b3dd3-6d14-bea6-198c-61c412bdddea, accountws_b33da816.sys:dumpstarteddropAccount ws_b33da816and selectedmo_catalog.__mo_account_lock ... for update.dropAccountstarteddrop database if exists moi.dropAccountdeletedmo_catalog.mo_accountrow forws_b33da816.moi_tenant_schema_migrationsunder databasemoi, txn...4c17df....4c17df:[Committed].71read databasemoiand gotengine.database.not-found.in-cache.ws_b33da816failedCREATE TABLE IF NOT EXISTS moi_tenant_schema_migrations ...withUnknown database moi.So the observed
Unknown database moihappened after the same account'sDROP ACCOUNThad already committed and droppedmoi. The tenant upgrade worker continued to use a tenant that the test cleanup/drop path had just removed.Key log references from the artifact:
coverage/logs/auto-upgrade.log:10219workspace/account creation:bf6b3dd3...,ws_b33da816coverage/logs/auto-upgrade.log:10249failing tasktask_id=41, target1.0.0.60,Unknown database moilogs/matrixone-docker.log:471282dropAccount ws_b33da816beginslogs/matrixone-docker.log:471895drop database if exists moilogs/matrixone-docker.log:473324delete frommo_catalog.mo_accountforws_b33da816logs/matrixone-docker.log:473777drop relationmoi_tenant_schema_migrationsin databasemoilogs/matrixone-docker.log:473820TN commit[Committed]for txn...4c17dflogs/matrixone-docker.log:473867engine.database.not-found.in-cache,name=moi,account-id=71logs/matrixone-docker.log:473880failedCREATE TABLE IF NOT EXISTS moi_tenant_schema_migrations ...,Unknown database moi, accountws_b33da816Conclusion: this issue should be treated as a MatrixFlow/MOI test framework cleanup vs tenant-upgrade-worker race. It does not show MO losing visibility of an existing committed database.
XuPeng-SH commentedon Jul 7, 2026
@heni02 please help to close it
endlesschasey-ai commentedon Jul 7, 2026
@aptend Thank you for the thorough timeline — you are right, and we have now traced the exact origin on our side.
The dropper is
CleanupSuiteOrphanedMOAccountsin the MatrixFlow test framework: our CI runsmake ci-testandmake test-python-sdkin parallel against the same MO instance, and the python-sdk integration step is itself anothergo testprocess of the same tests package. When it finishes, its TestMain sweeps "orphaned" test accounts (SHOW ACCOUNTS→ drop everything whose admin user has thetest_prefix, 2s timeout per drop — which matches the exact 2-second drop cadence in the MO logs at 05:39:20-05:39:48, catchingws_b33da816that the concurrently running auto-upgrade test had created 17s earlier).Confirmed not an MO bug. Closing; the fix (scoping the sweeper / serializing the parallel suites) will land in MatrixFlow. Sorry for the noise, and thanks again for the txn-level analysis.