Database Backup failing due to temp tables

In 1 database, we have multiple versions of a table, temp tables that exist that GC has not cleaned up after several days. These temp tables are preventing other database backup commands from working on entirely differerent databases. Is there a solution to removing these temp tables or forcing GC on these objects?

Hi @michael_skrzypiec! Which version of CockroachDB are you using? Can you share the exact error message you are seeing, or can you share the logs?

Do you have any databases in your cluster that have zero tables in them? It might be the case that you are having this bug, which was fixed in v20.2.4.

We are using 20.2.5.
The error message on the backup indicates that there are multiple versions of a table. We see that GC processes are still in the system for several weeks related to rollback of the create table statement for this table. We can access the correct version of the table, so subsequent create statement has worked properly.
We don’t have any databases in the cluster with 0 tables.

SQL Error [XXUUU]:ERROR: fao;ed to dry run backup: failed to resolve targets specified
in the BACKUP stmt: duplicate table name: “wfadb”.“public”.“basic_employee_info”
used for ID 1416 and 1415

Thanks! A few more questions

  1. Is basic_employee_info a temporary table?
  2. Can you share the result of SELECT * FROM system.public.namespace WHERE id IN (1415, 1416); – this requires you to run the query as an admin.

I’m asking the above since temp tables are not expected to be in the public schema.

Are there any messages in the DB logs that say that it failed to cleanup temporary objects?