fly-apps / postgres-flex

Postgres HA setup using repmgr
95 stars 45 forks source link

Automatic member unregistration fails if primary role cannot be resolved #79

Open davissp14 opened 1 year ago

davissp14 commented 1 year ago

Example two member setup: Member A ( primary ) Member B

Steps to reproduce

  1. Member B is stopped
  2. Member A goes readonly since quorum cannot be met.
  3. Member B is removed via flyctl
  4. The unregistration process fails, since flyctl cannot find the primary.

Manual fix

  1. SSH into a running VM
  2. su postgres && cd ~
  3. repmgr daemon status
  4. repmgr standby unregister --node-id <node-id>
davissp14 commented 1 year ago

Some additional docs on how to manually address this: https://github.com/fly-apps/postgres-flex/blob/master/docs/troubleshooting.md