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]: DROP PUBLICATION leaves subscriber DB as a zombie (listed but 'there is no publication') #30948
Dropping a publication leaves the subscriber's subscription database in a zombie state: the database still appears in SHOW DATABASES, but every access to it (SHOW TABLES, SELECT, etc.) fails with internal error: there is no publication <name>. The subscribed data is no longer reachable, and the only recovery is a manual DROP DATABASE.
Environment
MatrixOne dev build 3a1e42b430, server reports 8.0.30-MatrixOne-v1.3.0
Reproduction
-- publisher (account tenant_a):CREATEDATABASEtdb; CREATE TABLE tdb.t1 (id INTPRIMARY KEY, v INT); INSERT INTOtdb.t1VALUES (1,10);
CREATE PUBLICATION pub1 DATABASE tdb ACCOUNT tenant_b;
-- subscriber (account tenant_b):CREATEDATABASEsub2FROM tenant_a PUBLICATION pub1;
SELECT*FROMsub2.t1; -- OK: 1 10 ...-- publisher drops the publication:
DROP PUBLICATION pub1;
-- subscriber still sees the database, but can't use it:SELECT*FROMsub2.t1; -- ERROR 20101: internal error: there is no publication pub1
SHOW TABLES FROM sub2; -- ERROR 20101: there is no publication pub1
SHOW DATABASES; -- sub2 still listed ← zombieDROPDATABASE sub2; -- only way to clean it up (succeeds)
Root cause
The subscription database's catalog metadata retains a dangling reference to the publication. Once the publication is dropped, resolving any object inside the subscription database fails at the publication lookup, but the database entry itself is not removed or converted to a standalone snapshot. DROP PUBLICATION neither cascades to the subscription databases nor detaches them into independent copies.
Impact
Any subscription database becomes unusable (but still visible) the moment its publication is dropped — data appears lost to the subscriber until a manual DROP DATABASE.
Breaking change in operations: a publisher can't retire a publication without silently breaking every subscriber that still references it.
The official tests (git4data/clone/clone_subscription.sql) always drop the subscription database before dropping the publication, so this ordering is untested.
Expected behavior
One of: (a) DROP PUBLICATION cascades and drops the dependent subscription databases, (b) subscription databases are detached into independent materialized copies and remain fully readable, or (c) DROP PUBLICATION is rejected while subscriptions exist. Silently leaving a visible-but-unusable zombie database is the bug.
Confirmed this also reproduces across CNs in a two-CN cluster (CN1: 16001, CN2: 16002, shared log service/TN):
-- publisher mcn_pa on CN1: CREATE PUBLICATION mpub DATABASE pdb ACCOUNT mcn_sa;
-- subscriber mcn_sa on CN2: CREATE DATABASE sdb FROM mcn_pa PUBLICATION mpub; → SELECT * FROM sdb.pt; → 1 11 (OK)
-- publisher on CN1: DROP PUBLICATION mpub;
-- subscriber on CN2: SELECT * FROM sdb.pt;
-- ERROR 20101: internal error: there is no publication mpub
-- subscriber on CN2: SHOW DATABASES; → sdb still listed (zombie)
So the same dangling-publication-reference / zombie-database state occurs whether publisher and subscriber land on the same CN or different CNs. The fix should be CN-independent (catalog-level) rather than relying on per-CN local state.
This issue requires human involvement and cannot currently be completed independently by the
automated fix loop.
Reason
A publication/subscription maintainer must decide whether to preserve the existing deleted-subscription lifecycle or replace it with cascade deletion, materialization, or rejection of DROP PUBLICATION while subscriptions exist.
Evidence
Current main deliberately retains subscribed databases, marks their subscriptions SubStatusDeleted, and rejects access after publication removal. Existing tests cover deletion and subsequent recovery through publication recreation. The requested alternatives change this established lifecycle contract; the evidence does not demonstrate physical data loss.
Please use this analysis to provide the missing decision, environment, evidence, or ownership
needed before the issue is returned to the AI candidate pool.
Activity
Ariznawlll commentedon Oct 23, 2026
Confirmed this also reproduces across CNs in a two-CN cluster (CN1: 16001, CN2: 16002, shared log service/TN):
So the same dangling-publication-reference / zombie-database state occurs whether publisher and subscriber land on the same CN or different CNs. The fix should be CN-independent (catalog-level) rather than relying on per-CN local state.
gouhongshen commentedon Oct 23, 2026
Automated AI triage
This issue requires human involvement and cannot currently be completed independently by the
automated fix loop.
Reason
A publication/subscription maintainer must decide whether to preserve the existing deleted-subscription lifecycle or replace it with cascade deletion, materialization, or rejection of DROP PUBLICATION while subscriptions exist.
Evidence
Current main deliberately retains subscribed databases, marks their subscriptions SubStatusDeleted, and rejects access after publication removal. Existing tests cover deletion and subsequent recovery through publication recreation. The requested alternatives change this established lifecycle contract; the evidence does not demonstrate physical data loss.
Please use this analysis to provide the missing decision, environment, evidence, or ownership
needed before the issue is returned to the AI candidate pool.