From: Michael Paquier <michael@paquier.xyz>
To: Dylan Luong <Dylan.Luong@unisa.edu.au>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Resync second slave to new master
Date: Tue, 6 Mar 2018 14:23:41 +0900
Message-ID: <20180306052341.GA4717@paquier.xyz> (raw)
In-Reply-To: <4acf4492b18c4c4ca42bebc8570c84a5@ITUPW-EXMBOX3B.UniNet.unisa.edu.au>
References: <4acf4492b18c4c4ca42bebc8570c84a5@ITUPW-EXMBOX3B.UniNet.unisa.edu.au>
On Tue, Mar 06, 2018 at 04:45:10AM +0000, Dylan Luong wrote:
> After a failover (promote) to the Slave1, is it easily resync the
> Slave2 to the new master (old slave1)? Do we need to do full rebuild
> of the Slave2 from new master everytime we failover to Slave1 from
> Master? Can we use pg_rewind on Slave2 to resyn it with new master
> (old slave1)?
After promoting slave 1, it could be possible that some records have
slipped to slave 2 from the primary. In this case, a rewind would be
recommended. You should be careful that your slave 2 has not received
WAL to a position newer than where WAL has forked because of the
promotion. If that happened, then a rewind would be necessary before
replugging slave 2 to the newly-promoted server. Be very careful with
your failover flow here. pg_rewind also would not run if it finds that
the target server does not need a rewind, so you could stop the slave 2,
and run pg_rewind unconditionally to keep things simple.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, Dylan.Luong@unisa.edu.au
Subject: Re: Resync second slave to new master
In-Reply-To: <20180306052341.GA4717@paquier.xyz>
References: <4acf4492b18c4c4ca42bebc8570c84a5@ITUPW-EXMBOX3B.UniNet.unisa.edu.au> <20180306052341.GA4717@paquier.xyz>
* 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