#6805 Please drop-and-recreate koschei stg DB
Closed: Fixed Opened by msimacek.

Koschei staging DB is (probably irreversibly) broken. I cannot create tables, because their dependent objects exist and I cannot drop those dependent objects, because their tables don't exist.
Please drop it and create again.

How did it get into this situation: Someone dropped some tables. BDR is buggy when it comes to dropping things. It only drops the table object itself, leaving all dependent objects there. Indices, internal types, toast tables, primary keys, foreign keys... The DB schema becomes inconsistent and there is no easy way out.


The koschei database in db01.stg seems to be empty.

The koschei database in pgbdr01.stg seems to have a little more but basically only sequences, no tables in there.

Do you know what DB host you're using?

pgbdr.stg.phx2.fedoraproject.org

It's mostly empty, but the remaining stuff makes it broken. I cannot create the tables I need, because some of their dependent objects are still there. And I cannot delete the dependent objects, because their owners don't exist. The integrity of the db schema is broken.
For example:

koschei=> drop sequence build_id_seq;
ERROR:  cache lookup failed for relation 7405450

@puiterwijk @kevin I was going to do this but I wasn't sure if I needed to take any precaution when deleting and re-creating a database in BDR. Do you know?

You'll need to drop the replication agreement before you can drop the database.
I can try to take care of this today, and at the same time send a PR for the SOPs.

Metadata Update from @kevin:
- Issue assigned to puiterwijk
- Issue priority set to: Waiting on Asignee

Metadata Update from @mizdebsk:
- Issue assigned to mizdebsk (was: puiterwijk)

I'm going to move Koschei staging database to a non-BDR server.

Done in https://infrastructure.fedoraproject.org/cgit/ansible.git/commit/?id=b472456

Metadata Update from @mizdebsk:
- Issue close_status updated to: Fixed
- Issue priority set to: None (was: Waiting on Assignee)
- Issue status updated to: Closed (was: Open)

Metadata