Repository navigation
Description
Summary
CREATE ACCOUNT IF NOT EXISTS returns success but the newly created tenant is not immediately visible on other CN nodes. Subsequent connections routed to a different CN via proxy fail with ERROR 20101: internal error: there is no tenant <name>.
The tenant becomes visible after a few seconds (~7s observed), indicating asynchronous metadata propagation rather than synchronous commit.
Environment
- Branch: main (commit 00d2f57)
- Cluster: TKE, 3 CNs + 1 DN, behind proxy
- Job: MO T+n CDC TEST
Reproduction
# Step 1: Create account (routed to CN-A via proxy)
mysql -h <proxy> -udump -P6001 -p111 \
-e "create account if not exists ac1 ADMIN_NAME 'admin' IDENTIFIED BY '123'";
# Step 2: Immediately connect as new account (may route to CN-B via proxy)
mysql -h <proxy> -uac1:admin -P6001 -p123 \
-e "set global experimental_ivf_index=1";
# => ERROR 20101 (HY000): internal error: there is no tenant ac1Timeline from CI log
23:36:14.723 CREATE ACCOUNT IF NOT EXISTS ac1 returns OK
23:36:15.216 mysql -uac1:admin ... set global FAIL: there is no tenant ac1
(only ~0.5s gap)
23:36:22.301 cdc_test.py connects as ac1:admin SUCCESS
(~7s after CREATE ACCOUNT)
Root Cause Analysis
In a multi-CN cluster behind a proxy:
CREATE ACCOUNTexecutes on CN-A, writes metadata to shared storageCREATE ACCOUNTreturns success to client- Next connection is routed by proxy to CN-B
- CN-B has not yet synced the new tenant metadata =>
there is no tenant ac1 - After ~7s, metadata propagates to all CNs => connections succeed
This is a DDL visibility problem: CREATE ACCOUNT (a DDL operation) returns before the result is visible to all CN nodes.
Expected Behavior
CREATE ACCOUNT should ensure the new tenant is visible across all CNs before returning success to the client. This is consistent with how other DDL operations (CREATE TABLE, etc.) should behave in a multi-CN cluster -- the client should be able to use the created object immediately after the DDL returns.
Impact
- CDC test fails intermittently (depends on proxy routing)
- Any workflow that creates an account and immediately uses it will fail
- Currently worked around with
sleepbetween CREATE ACCOUNT and subsequent operations
Related Occurrences
This same error has been observed in multiple nightly runs:
- run 28744865643 -- MO T+n CDC TEST
- run 28878389999 -- MO T+n CDC TEST
Activity
matrix-meow commentedon Jul 8, 2026
Related Issues (same root cause: multi-CN logtail propagation race)
All share the same root cause: DDL writes return before logtail metadata propagates to all CN nodes. The ~7s propagation delay observed in this issue matches the behavior seen in #25032 (where logtail delay caused CREATE USER → connect failure within ~62ms on a different CN).
This is a systemic issue requiring a DDL-level barrier to ensure metadata visibility across all CNs before returning success.
Ariznawlll commentedon Jul 8, 2026
This is a session consistency issue across CN nodes, not a bug.
In a multi-CN cluster, DDL metadata propagation is asynchronous.
CREATE ACCOUNTreturns after the local CN commits the metadata, but other CNs may not have synced it yet. Subsequent connections routed to a different CN via proxy may not see the new tenant.This is consistent with how distributed databases handle cross-node DDL visibility — the client may need to retry or wait briefly for metadata to propagate.
Closing as expected behavior (session consistency).
iamlinjunhong commentedon Aug 14, 2026
Regression evidence from PR #27016 CI (the failure matches this issue's cross-CN visibility race).
e50764278d1f5066b0e72db5dac611978c1563e8The BVT reporter attributed the first failure to
test/distributed/cases/system_variable/system_variables.sql:124:The complete CN/proxy logs show that the causal event happened earlier, while the script was switching to the newly created tenant:
Thus the reported
DROP ACCOUNTtimeout is downstream of the same behavior documented here:CREATE ACCOUNTwas committed/visible on one CN, while an immediate proxy-routed tenant connection hit another CN that still returnedthere is no tenant acc_idx. The laterwait_timeoutmismatch and duplicate-account error are cascades after reconnect. The Coverage job did not expose another defect; its prerequisite step sayscoverage merge skipped because at least one required producer was skipped or failed.Comparison evidence:
mainatf9af0064116f885ce68b0db4d94d4fafdc9bafc3, native 2-CN + Proxy topology: 50 consecutive create/connect/create-db/drop-db/drop-account cycles completed (drop-account 0.38–2.79s).b95f5c09930c42bdbe77828b6ae72d39f2be48ed: the fullsystem_variables.sqlpassed 175/175 in 3.668s; an additional 50-cycle loop also completed (0.62–3.44s per drop-account).pkg/frontend/mysql_protocol.go,pkg/frontend/util.go,pkg/frontend/util_test.go); the direct cross-CN logs above are the independent cache/metadata-propagation evidence.Per the automated CI intake policy, I will request one failed-job rerun for run
31805711526after this evidence comment is confirmed.iamlinjunhong commentedon Aug 20, 2026
Regression evidence from PR #27157 CI; this matches the cross-CN account-visibility race tracked here.
dd429fe66d2da3298aafea6d6a3ef55745e5296dStart BVT Test, invokingbash "${bvt_runner}" "$GITHUB_WORKSPACE/mo-tester" "$GITHUB_WORKSPACE/test/distributed/cases" "${bvt_group}" "$GITHUB_WORKSPACE/test/distributed/resources"with group 0 in the 2-CN + Proxy compose topology.Stable BVT signature:
The complete CN/proxy logs expose the causal cache/metadata event before those reporter errors:
This is the same create-account → immediate cross-CN connect visibility behavior documented in this issue, with the later DROP timeout, session-variable mismatch, and duplicate-account error cascading after the failed tenant session. The coverage job has no independent product failure:
Verify coverage prerequisitesreports that coverage merge was skipped because a required producer failed.Comparison/independence evidence: the PR changes MongoDB default configuration/runtime metadata and related tests; it does not modify account creation, tenant authentication/cache propagation, proxy routing, or
system_variables.sql. More importantly than diff distance, the current CI artifacts directly show the cross-CN cache inconsistency, and this issue already records the same behavior on clean main (00d2f57ca) and a prior independent PR. Currentup/mainwas fetched at592ad2190a90e063e3877059f4018427a10a4998; the local Darwin host has no Docker runtime, so I am using the direct cache evidence path allowed by the automated CI intake standard rather than claiming an unmatched local compose reproduction.The current PR head's reviewer regression also passes via the repository CGo wrapper:
After this evidence comment is confirmed, I will request the single allowed failed-job rerun for run
32331886226.[4.2] Stabilize index cache retries and CI tests (#32354)