Skip to content

[Bug]: DROP ACCOUNT ignores active publications #31356

Open

Description

@Ariznawlll

DRAFT ISSUE 1 (候选, 不要提交)

标题候选: [Bug]: DROP ACCOUNT silently succeeds with active publications — subscribers keep a zombie database that errors as "no publication account"

标签: kind/bug, needs-triage

Relations

#30948 (DROP PUBLICATION leaves zombie) and #29414 (cross-account publication survives DROP DATABASE) cover neighboring lifecycle holes; this report is the third leg: DROP ACCOUNT of the publisher silently succeeds with active publications, orphaning every subscriber database with no protection, cascade, or notice — the same protection that DROP DATABASE already has (can not drop database which is publishing).

Description

DROP DATABASE is protected while it is being published (can not drop database 'pdb' which is publishing), but DROP ACCOUNT has no equivalent protection for an account whose databases have active publications. The publisher account is dropped without any warning or cascade, and every subscriber's database immediately becomes a zombie: it still shows in SHOW DATABASES but errors on any access, with no built-in notification, and no automatic cleanup.

Related but distinct from #30948 (drop publication leaves zombie db): that path had the publisher still alive; here the whole publisher tenant vanishes while subscriptions exist.

Environment

  • MatrixOne dev build (local multi-CN, main, 2026-10-26)
  • Two accounts: publisher psub_a, subscriber psub_b

Reproduction

CREATE ACCOUNT psub_a ADMIN_NAME 'a' IDENTIFIED BY '111';
CREATE ACCOUNT psub_b ADMIN_NAME 'b' IDENTIFIED BY '111';

-- as psub_a:
CREATE DATABASE pdb; CREATE TABLE pdb.pt (id INT PRIMARY KEY, v INT);
INSERT INTO pdb.pt VALUES (1,10);
CREATE PUBLICATION mypub DATABASE pdb ACCOUNT psub_b;

-- as psub_b:
CREATE DATABASE sdb FROM psub_a PUBLICATION mypub;
SELECT * FROM sdb.pt;      -- OK (1, 10)

-- sys:
DROP DATABASE IF EXISTS pdb;   -- as psub_a: ERROR can not drop database which is publishing (protected ✓)
DROP ACCOUNT psub_a;            -- sys: silently succeeds! (no protection, no cascade, no warning ✗)

-- as psub_b afterwards:
SHOW DATABASES;                 -- sdb still listed
SELECT * FROM sdb.pt;
-- ERROR 20101: there is no publication account psub_a

The subscription db is unusable and un-explained from the subscriber's point of view. It can be manually dropped (DROP DATABASE sdb works), but nothing tells the subscriber, and nothing automatically removes the reference.

Impact

  • Deleting any tenant account that still publishes (e.g. a leaving customer, a staging tenant cleanup) instantly breaks N subscriber tenants, silently. Subscriber queries fail at business-hours time with a puzzling "no publication account" error, rather than at deletion time with a clear conflict message.
  • No automatic cleanup or cascade — subscribers' catalogs keep the dead database until someone notices.
  • Protected-surface inconsistency: DROP DATABASE refuses while published, but DROP ACCOUNT (which destroys the same publication wholesale) does not.

Expected behavior

Pick one and implement consistently:

  1. Reject DROP ACCOUNT while it has active publications with a clear error listing them (parity with DROP DATABASE protection); or
  2. Explicit syntax requirement, e.g. DROP ACCOUNT ... CASCADE / FORCE, documented for operators; or
  3. Automatic cascade: drop the publications and all subscriber databases (with a warning), plus a periodic job/notice so subscribers can be notified.

Any of these is better than the current silent breakage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions