Skip to content

[YSQL] need better error hint when a database is dropped and recreated #30319

@myang2021

Description

@myang2021

Jira Link: DB-20202

Description

ereport(ERROR,
                        (errcode(ERRCODE_DATABASE_DROPPED),
                         errmsg("catalog version for database %u was not found.", db_oid),
                         errhint("Database might have been dropped by another user")));

We have a situation where the database is dropped and recreated with the same name. The newly created database will have a new OID. However even after a universe restart, the client app contains some stale connection metadata that contains the old OID and it continues to use that old OID to contact the Yugabyte universe and gets an error like:

ERROR: catalog version for database 16896 was not found. to FATAL: catalog version for database 16896 was not found.

It will be better if the error hint can indicate that scenario so that a user can be informed to also restart the client app, or refresh its metadata cache to pick the new OID.

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.

Metadata

Metadata

Assignees

Labels

area/ysqlYugabyte SQL (YSQL)kind/enhancementThis is an enhancement of an existing featurepriority/mediumMedium priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions