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
fix(tenant): prevent ghost rows in SHOW TENANTS after DROP TENANT
SHOW TENANTS derives its row set from the union of catalog-registered
tenants and every active user's tenant_id. When DROP TENANT removed the
catalog row but left the auto-provisioned <name>_admin user in place, the
union query resurfaced the dropped tenant as a ghost row — same id, empty
name — making it appear the drop had failed or that a nameless tenant
still existed.
Add reconcile_tenant_users, called before the catalog row is removed:
* The lifecycle-owned <name>_admin (auto-provisioned by CREATE TENANT)
is hard-dropped through the canonical DROP USER path so ownership
reassignment, session invalidation, and catalog removal all run.
* Any other user in the tenant is operator-owned. The drop is refused
with SQLSTATE 42501 and the remaining usernames are surfaced in the
error, so no real account is ever silently hard-deleted by a tenant
drop.
When no catalog is wired up there is no persisted StoredTenant to surface
as a ghost in the union, so reconcile_tenant_users returns early without
performing any work.
0 commit comments