#6917 Something is using Bodhi's staging database and I would like it not do so I can drop it
Closed: Fixed 5 years ago Opened 5 years ago by bowlofeggs.

  • Describe what you need us to do:
    I am trying to run Bodhi's staging-sync playbook (manual/staging-sync/bodhi.yml), but it errors at the stop that runs dropdb bodhi2 on the database server, with an error "dropdb: database removal failed: ERROR: database "bodhi2" is being accessed by other users\nDETAIL: There are 4 other sessions using the database."

In the past I've found that typically one connection means that Bodhi's greenwave cron job is running, but I don't see that in the process table on backend01.stg and that would also only account for 1 of the 4 connections. Could someone kill these connections for me, or tell me what they are?

  • When do you need this? (YYYY/MM/DD)
    ASAP

  • When is this no longer needed or useful? (YYYY/MM/DD)
    When Bodhi doesn't use a database anymore (serverless!)

  • If we cannot complete your request, what is the impact?
    I will not be able to sync production data to staging, which is useful during testing.


Patrick unblocked me by getting staging running again, so I've modified the impact.

It's too bad that dropdb doesn't have a --force flag. I did find a post that said you can run some crazy queries to force drop a database:

https://dba.stackexchange.com/questions/11893/force-drop-db-while-others-may-be-connected

Perhaps we should just adjust the Bodhi sync script to do something like that? Since it's staging I think we don't have to worry about any impact on running queries (especially since I'm about to destroy the db ☺)

bodhi01.stg was still lying around. It is gone.
I am -1 to a more forceful dropdb.

Cool, we can close this then. Thanks for figuring that out for me!

Metadata Update from @bowlofeggs:
- Issue assigned to puiterwijk
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.

Metadata