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
{{ message }}
Repository navigation
[Bug]: PubSub: concurrent CREATE ACCOUNT and CREATE PUBLICATION ACCOUNT ALL leave the new account unable to subscribe #32941
Searched open and closed issues for ACCOUNT ALL, CREATE ACCOUNT, mo_subs and concurrent publication. Related but different: [Bug]: DROP ACCOUNT 成功后仍残留引用已删除订阅账号的 mo_subs 记录 #32900 concerns an extra row for a deleted ID; this is a missing row for a live ID.
Branch / commit / environment
Main publication code from d2e7103 (baseline file overlay) and PR head 07d9e10. Isolated two-CN real SQL fixture. Both observed. Not introduced by #32936. No separate 4.2 run claimed here.
Actual behavior
Both CREATE operations return success. After both commits a fresh catalog query sees mo_pubs.account_list=all; by publication and account the existing account has one mo_subs row, the newly created account has zero. An actual CREATE DATABASE … FROM sys PUBLICATION … as the new account fails with 20101/HY000, publication not authorized or no longer exists. The head and baseline have identical observations. This denies an intended subscription; there is no evidence of unintended access or user-table data loss.
Expected behavior
After both DDLs commit, the new account can subscribe and read the published table just as under either serial order, with exactly one matching catalog entry; alternatively surface a retryable conflict rather than silently accepting an inconsistent result.
Steps / evidence
In an isolated two-CN SQL fixture with a source database and an existing subscriber account, start CREATE PUBLICATION ACCOUNT ALL. A transaction holding the source database catalog row was used as a deterministic scheduling barrier; confirm the publication is waiting there after resolving its target accounts.
Complete CREATE ACCOUNT for another subscriber on the other CN, release the barrier, wait for publication success, then inspect both catalog tables and try subscribing from a fresh connection as the new account.
The recorded SQL outcomes on each code version were: existing_sub_rows=1, new_sub_rows=0, new_SUBSCRIBE=Error 20101. These are the assertions to preserve in a regression test, not just both DDL exit statuses.
Why this interleaving is possible
Publication creation operates on an already enumerated target set; account initialization enumerates already visible all-account publications. In this order neither enumeration sees the other object. A lock on the publication creator’s already-resolved IDs cannot protect an ID not yet present at enumeration time. The precise introducing commit and other branches are not established.
Activity
fix(frontend): prevent publication grants from recreating dropped sub…
[4.2-dev] fix(pubsub): keep named publication grants on exact account…