Re: Notify When Streaming Replication Failover Occurred (slave promoted to master).

From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: AviW(at)gilat(dot)com
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Notify When Streaming Replication Failover Occurred (slave promoted to master).
Date: 2021-06-14 12:10:58
Message-ID: CADK3HHKVjhHbw-EBYG6nAQzDqMwb0etKRXPCFmbuiiVqFDD83A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 13 Jun 2021 at 19:32, Avi Weinberg <AviW(at)gilat(dot)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

>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vijaykumar Jain 2021-06-15 09:20:43 immutable function querying table for partitioning
Previous Message Avi Weinberg 2021-06-13 23:31:23 Notify When Streaming Replication Failover Occurred (slave promoted to master).