Re: Notify When Streaming Replication Failover Occurred (slave promoted to master). - Mailing list pgsql-general

From Dave Cramer
Subject Re: Notify When Streaming Replication Failover Occurred (slave promoted to master).
Date
Msg-id CADK3HHKVjhHbw-EBYG6nAQzDqMwb0etKRXPCFmbuiiVqFDD83A@mail.gmail.com
Whole thread Raw
In response to Notify When Streaming Replication Failover Occurred (slave promoted to master).  ("Avi Weinberg" <AviW@gilat.com>)
Responses Re: Notify When Streaming Replication Failover Occurred (slave promoted to master).
List pgsql-general

On Sun, 13 Jun 2021 at 19:32, Avi Weinberg <AviW@gilat.com> wrote:

I need to take actions when Postgres streaming replication failover occurred.  Is there a way to be notified when Postgres slave becomes master?  If no such notification possible, what is the best way to actively monitor which server is master.  My Postgres  is running inside Kubernetes and the HA is managed by Patroni.

 


On the surface this seems like a great idea, however contemplating this a bit more; where would the signal come from ? Currently the only option I can think of is to send a NOTIFY. 
It seems to me that the Patroni code is a better place to do this from.

Dave

pgsql-general by date:

Previous
From: "Avi Weinberg"
Date:
Subject: Notify When Streaming Replication Failover Occurred (slave promoted to master).
Next
From: Vijaykumar Jain
Date:
Subject: immutable function querying table for partitioning