You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a test creates an account on one connection and immediately switches to a new connection authenticated as that account, MO-Tester calls getConnection(command) before syncCommit().
Authentication is part of getConnection(). If Proxy routes the new connection to another CN which has not observed the account metadata yet, authentication fails with:
internal error: there is no tenant acc_idx
The configured JDBC options amplify the short visibility race:
04:27:14.624 new acc_idx connection reaches Proxy
04:27:14.629 CN0 authentication: there is no tenant acc_idx
04:27:14.634 second authentication attempt fails
04:27:24.624 original sys connection is closed after wait_timeout=10
04:28:14.635 JDBC retries after initialTimeout=60
04:28:14.662 acc_idx authentication succeeds
04:28:14 next SQL on the dead sys connection is reported as a timeout
The reported failing SQL was DROP ACCOUNT, but it never reached a CN at that time. Executor classified the dead connection generically as:
MO does not return result in 300000 ms
The 300000 value was the configured socket timeout, not the observed 60-second wait.
Current execution order:
connection = getConnection(command); // target-account authentication happens hereif (last_commit_id != command.getConn_id()) {
syncCommit(); // too late for first authentication
}
This creates a bootstrap dependency: the new-account connection must authenticate before the visibility barrier intended to make that authentication reliable can run.
Expected Behavior
When switching connections, MO-Tester should execute the cluster visibility barrier through its independent sys connection before creating or authenticating the target connection:
if (last_commit_id != command.getConn_id()) {
syncCommit();
}
connection = getConnection(command);
A syncCommit failure should also be returned to the caller and fail the affected command instead of being silently ignored.
This should preserve the existing barrier semantics: MatrixOne mo_ctl('cn', 'synccommit', '') obtains the maximum commit timestamp from all CNs, broadcasts it to every CN, and waits for local logtail application.
Steps to Reproduce
Run against Proxy with at least two CNs:
set wait_timeout =10;
create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456';
-- switch to a new MO-Tester session immediately-- @session:id=1&user=acc_idx:root&password=123456select1;
-- @session
drop account acc_idx;
The failure is routing/timing dependent: account creation executes on CN-A and the new tenant login must be routed to CN-B before its catalog/logtail state has caught up.
Is there an existing issue for the same bug?
Environment
b95f5c09930c42bdbe77828b6ae72d39f2be48ed4.2-dev1b0068a92f91bf6a3e205740db2c1bc41e7c0a6bActual Behavior
When a test creates an account on one connection and immediately switches to a new connection authenticated as that account, MO-Tester calls
getConnection(command)beforesyncCommit().Authentication is part of
getConnection(). If Proxy routes the new connection to another CN which has not observed the account metadata yet, authentication fails with:The configured JDBC options amplify the short visibility race:
In the observed failure:
The reported failing SQL was
DROP ACCOUNT, but it never reached a CN at that time. Executor classified the dead connection generically as:The
300000value was the configured socket timeout, not the observed 60-second wait.Current execution order:
This creates a bootstrap dependency: the new-account connection must authenticate before the visibility barrier intended to make that authentication reliable can run.
Expected Behavior
When switching connections, MO-Tester should execute the cluster visibility barrier through its independent sys connection before creating or authenticating the target connection:
A
syncCommitfailure should also be returned to the caller and fail the affected command instead of being silently ignored.This should preserve the existing barrier semantics: MatrixOne
mo_ctl('cn', 'synccommit', '')obtains the maximum commit timestamp from all CNs, broadcasts it to every CN, and waits for local logtail application.Steps to Reproduce
Run against Proxy with at least two CNs:
The failure is routing/timing dependent: account creation executes on CN-A and the new tenant login must be routed to CN-B before its catalog/logtail state has caught up.
Additional information
mo-tester/src/main/java/io/mo/db/Executor.java
Lines 150 to 180 in b95f5c0
syncCommit()implementation:mo-tester/src/main/java/io/mo/db/Executor.java
Lines 644 to 650 in b95f5c0