Skip to content

[Bug]: PubSub: concurrent CREATE ACCOUNT and CREATE PUBLICATION ACCOUNT ALL leave the new account unable to subscribe #32941

Open

Description

@LeftHandCold

Is there an existing issue for the same bug?

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

  1. 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.
  2. 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.
  3. 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

  1. added
    severity/s0
    and removed on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions