pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Cassaniti <m.cassaniti@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Notification or action when WAL archives fully restored and streaming replication started
Date: Thu, 14 Mar 2019 14:59:38 +1100
Message-ID: <8aee6f5f-6ed8-ed96-f1f4-ec8a38305eed@gmail.com> (raw)
In-Reply-To: <9b97926f-ba7f-2fb1-bb4f-74ed33e49c2b@cassaniti.id.au>
References: <9b97926f-ba7f-2fb1-bb4f-74ed33e49c2b@cassaniti.id.au>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,
I've got master/slave replication setup between a few hosts. At any
point a slave could become a master. I've got appropriate locking in
place using an external system so that only one master can exist at a
time. I'm having trouble determining when my slaves are in sync with the
current master so that they can be a candidate for promotion. I want
some form of indicator _without reading a log_ when streaming
replication has started.

My recovery.conf for slaves:
  standby_mode = on
  restore_command = 'gunzip < /archives/wal/%f > %p'
  recovery_target_timeline = 'latest'
  primary_conninfo = 'host=PGSQL_FRONTEND_NAME port=5432
user=PGSQL_RECOVERY_USER password=PGSQL_RECOVERY_PASS'

Appropriate postgresql.conf:
  wal_level = replica
  archive_mode = on
  archive_command = 'test ! -f /archives/wal/%f && gzip < %p >
/archives/wal/%f'
  archive_timeout = 15min

Regards,
Michael Cassaniti
-----BEGIN PGP SIGNATURE-----

iG0EAREIAB0WIQT0DIHSqEo48gI0VT9pF1oDt4Q+5wUCXInRqgAKCRBpF1oDt4Q+
5661AN4nRJPXF/M0ZoLg3JVH8f0UsO1WlouHruIRMnsnAN4q9x4G6S4RcobUm5Kh
qTNOD2F3v6A8ng4ABFpm
=5qCA
-----END PGP SIGNATURE-----





view thread (4+ messages)  latest in thread

Message-ID: <8aee6f5f-6ed8-ed96-f1f4-ec8a38305eed@gmail.com>
Permalink:  ../8aee6f5f-6ed8-ed96-f1f4-ec8a38305eed@gmail.com/
Also on:    postgresql.org/message-id/8aee6f5f-6ed8-ed96-f1f4-ec8a38305eed@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: m.cassaniti@gmail.com
  Subject: Re: Notification or action when WAL archives fully restored and streaming replication started
  In-Reply-To: <8aee6f5f-6ed8-ed96-f1f4-ec8a38305eed@gmail.com>
  References: <9b97926f-ba7f-2fb1-bb4f-74ed33e49c2b@cassaniti.id.au> <8aee6f5f-6ed8-ed96-f1f4-ec8a38305eed@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox