Comment 1 for bug 1273636

Revision history for this message
Stuart Bishop (stub) wrote :

The client code looks fine. It will only work with a single unit PostgreSQL service, but that is what is being tested here. 'hostname' is unnecessarily being set in relation-joined, but that should be harmless.

To debug this, we either need to step through or grab the logs from the server side. In particular, the charm unit-postgresql-0.log and /var/log/postgresql/postgresql-9.1-main.log.

What should be happening in the server's db-relation-changed hook:

 - pg_hba.conf rewritten. Authentication credentials and allowed-units set on the relation
 - PostgreSQL reloaded or restarted

The client should not see the relation data change until after the server's db-relation-changed hook has completed, so there should be no race condition between relation-set publishing allowed-units and the PostgreSQL reload. I think what must be happening is a logic error and PostgreSQL not being reloaded, or the reload is failing (eg. bad syntax in a config file), or the reload is not taking effect immediately.