After switching to read-only some connections to the read-write database might still be open
Bug #513196 reported by
Guilherme Salgado
This bug report is a duplicate of:
Bug #531834: When switching to read-only mode, we're left with lots of "idle/select waiting" connections to the DBs which may be blocking the schema upgrade process.
Edit
Remove
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
Low
|
Stuart Bishop |
Bug Description
Tom reported that during the roll out, after switching app servers to read-only, not all connections to the read-write database were closed.
To post a comment you must log in.
We were still seeing connections (idle, admittedly) from app servers to the read-write database a good number of minutes after switching to read-only. We ended up restarting the main DB, which had other knock on issues, as we need to make sure there are no connections to this DB before we run the upgrade.
Jan 27 09:10:33 <mthaddon> stub: I've run "~/scripts/ losa-db- scripts/ pgkillactive. py -s 0 -u '^(?!sso_ |slony$ |postgres$ )'" on wildcherry, but "ps fuwwxx | grep -v session_prod | grep -v slony" still shows a bunch of connections that shouldn't be there I think losa-db- scripts/ pgkillidle. py -s 0 -u '^(?!sso_ |slony$ |postgres$ )'
Jan 27 09:10:50 <mthaddon> stub: should I just kill them manually?
Jan 27 09:11:38 <stub> mthaddon: I don't see any active connections. I see lots of IDLE ones...
Jan 27 09:11:51 <mthaddon> stub: so how do I get rid of those?
Jan 27 09:12:03 <stub> mthaddon: Shut down the services
Jan 27 09:12:16 <mthaddon> stub: we can't - they're the app servers (in readonly mode)
Jan 27 09:12:22 <stub> mthaddon: Lots of shipit still talking to launchpad_prod_3
Jan 27 09:12:24 <mthaddon> stub: how about ~/scripts/
Jan 27 09:12:34 <stub> Hmm.... so switching to read only mode doesn't drop connections to the masters?
Jan 27 09:12:42 <mthaddon> it seems like it doesn't, no
Jan 27 09:12:45 <stub> mthaddon: Not sure if that will work either
Jan 27 09:13:02 <stub> mthaddon: Simplest way is to bounce the database
Jan 27 09:13:12 <mthaddon> ok
Jan 27 09:13:14 <mthaddon> ugh
Jan 27 09:13:23 <mthaddon> stub: using -force?
Jan 27 09:13:29 <stub> Yes
Jan 27 09:13:33 <stub> Otherwise kill things manually