Merge lp:~stub/charms/precise/postgresql/bug-1278731-hot-standby-allowed-units into lp:charms/postgresql
Proposed by
Stuart Bishop
Status: | Merged |
---|---|
Merged at revision: | 87 |
Proposed branch: | lp:~stub/charms/precise/postgresql/bug-1278731-hot-standby-allowed-units |
Merge into: | lp:charms/postgresql |
Prerequisite: | lp:~stub/charms/precise/postgresql/pg93 |
Diff against target: |
80 lines (+30/-8) 2 files modified
hooks/hooks.py (+13/-4) test.py (+17/-4) |
To merge this branch: | bzr merge lp:~stub/charms/precise/postgresql/bug-1278731-hot-standby-allowed-units |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Ceppi (community) | Approve | ||
Review via email: mp+205725@code.launchpad.net |
Description of the change
Fix for Bug #1278731.
It was possible for hot standby units to have their db relation hooks run before the master, in which case they would copy obsolete connection details from the master. Clients following the db relation protocol would rightfully ignore the obsolete credentials (in this case, an invalid database name) and wait for the server unit to catch up (which it never did).
Now the hot standby explicitly overrides the database name in this case, and blocks waiting for the master to create the database and for it to replicate.
To post a comment you must log in.
It seems that with this fix, along with a little more sleep()ing, the replication tests are no longer flaky with the local provider. We might need to increase the sleeps further for other providers.