new primary wrongfully updates replication password on leadership change

Bug #1987379 reported by Romain Couturat
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PostgreSQL Charm

Bug Description

postgres unit leadership changed after a juju controller upgrade.
The new primary updated "_juju_repl" user password (aka replication_password) in the primary DB but not in it's .pgpass file, nor did it update anything on the secondary and broke the replication (the secondary having deprecated creds)
It was fixed by applying replication_password from .pgpass (identical on both unit) again on the primary.

afaiu :
from juju logs : (not public)
"Invoking reactive handler: reactive/postgresql/"
updates the replication password and breaks the replica.
It shouldn't (there is already a password) but _juju_repl user pw is not matched.

Either because it's not an entry in "client_passwords" (but an entry on it's own
and/or because replication username is hardcoded here
to a different value than replication_username from

Revision history for this message
Romain Couturat (romaincout) wrote :

by "but _juju_repl user pw is not matched." I mean
appears to set the password again failing to see it already exists

Revision history for this message
Romain Couturat (romaincout) wrote :

happened to me again today, might also be caused by adding a unit with a newer version version of the charm than the one that was previously used to deploy the first unit(s)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.