Re: Using old master as new replica after clean switchover

2019-02-22 Thread Claudio Freire
On Fri, Feb 22, 2019 at 5:47 AM Jehan-Guillaume de Rorthais wrote: > > On Thu, 21 Feb 2019 15:38:21 -0300 > Claudio Freire wrote: > > > On Tue, Feb 19, 2019 at 9:44 PM Michael Paquier wrote: > > > > > > On Tue, Feb 19, 2019 at 04:27:02PM -0800, RSR999GMAILCOM wrote: > > > > So wanted to

Re: Using old master as new replica after clean switchover

2019-02-22 Thread Jehan-Guillaume de Rorthais
On Thu, 21 Feb 2019 15:38:21 -0300 Claudio Freire wrote: > On Tue, Feb 19, 2019 at 9:44 PM Michael Paquier wrote: > > > > On Tue, Feb 19, 2019 at 04:27:02PM -0800, RSR999GMAILCOM wrote: > > > So wanted to clarify if this procedure really requires the WAL archive > > > location on a shared

Re: Using old master as new replica after clean switchover

2019-02-21 Thread Michael Paquier
On Thu, Feb 21, 2019 at 10:26:37AM -0800, RSR999GMAILCOM wrote: > Is there any link where the required setup and the step by step procedure > for performing the controlled switchover are listed? Docs about failover are here: https://www.postgresql.org/docs/current/warm-standby-failover.html Now

Re: Using old master as new replica after clean switchover

2019-02-21 Thread Michael Paquier
On Thu, Feb 21, 2019 at 03:38:21PM -0300, Claudio Freire wrote: > If I'm not mistaken, if you don't have WAL archive set up (a shared > filesystem isn't necessary, but the standby has to be able to restore > WAL segments from the archive), a few transactions that haven't been > streamed at primary

Re: Using old master as new replica after clean switchover

2019-02-21 Thread Claudio Freire
On Tue, Feb 19, 2019 at 9:44 PM Michael Paquier wrote: > > On Tue, Feb 19, 2019 at 04:27:02PM -0800, RSR999GMAILCOM wrote: > > So wanted to clarify if this procedure really requires the WAL archive > > location on a shared storage ? > > Shared storage for WAL archives is not a requirement. It

Re: Using old master as new replica after clean switchover

2019-02-21 Thread RSR999GMAILCOM
Is there any link where the required setup and the step by step procedure for performing the controlled switchover are listed? Thanks Raj On Tue, Feb 19, 2019 at 4:44 PM Michael Paquier wrote: > On Tue, Feb 19, 2019 at 04:27:02PM -0800, RSR999GMAILCOM wrote: > > So wanted to clarify if this

Re: Using old master as new replica after clean switchover

2019-02-19 Thread Michael Paquier
On Tue, Feb 19, 2019 at 04:27:02PM -0800, RSR999GMAILCOM wrote: > So wanted to clarify if this procedure really requires the WAL archive > location on a shared storage ? Shared storage for WAL archives is not a requirement. It is perfectly possible to use streaming replication to get correct

Using old master as new replica after clean switchover

2019-02-19 Thread RSR999GMAILCOM
Hello Postgres Gurus, After searching (on www.postgresql.org/Google) I found that the following steps can be used to perform a switchover in Postgres (version 9.3): *Step 1.* Do clean shutdown of Primary (-m fast or smart). *Step 2. *Check for sync status and recovery status of Standby before

Re: Using old master as new replica after clean switchover

2018-10-25 Thread Nikolay Samokhvalov
On Thu, Oct 25, 2018 at 6:03 AM Jehan-Guillaume de Rorthais wrote: > What about logging the shutdown checkpoint on the old master? > On the standby side, we could cross-check it with a function confirming: > 1/ the very last XLogRecord received was the old master shutdown checkpoint > 2/ the

Re: Using old master as new replica after clean switchover

2018-10-25 Thread Michael Paquier
On Thu, Oct 25, 2018 at 11:15:51AM +0200, Jehan-Guillaume de Rorthais wrote: > On Thu, 25 Oct 2018 02:57:18 -0400 > Nikolay Samokhvalov wrote: >> My research shows that some people already rely on the following when >> planned failover (aka switchover) procedure, doing it in production: >> >>

Re: Using old master as new replica after clean switchover

2018-10-25 Thread Jehan-Guillaume de Rorthais
On Thu, 25 Oct 2018 20:45:57 +0900 Michael Paquier wrote: > On Thu, Oct 25, 2018 at 11:15:51AM +0200, Jehan-Guillaume de Rorthais wrote: > > On Thu, 25 Oct 2018 02:57:18 -0400 > > Nikolay Samokhvalov wrote: > >> My research shows that some people already rely on the following when > >>

Re: Using old master as new replica after clean switchover

2018-10-25 Thread Jehan-Guillaume de Rorthais
On Thu, 25 Oct 2018 02:57:18 -0400 Nikolay Samokhvalov wrote: ... > My research shows that some people already rely on the following when > planned failover (aka switchover) procedure, doing it in production: > > 1) shutdown the current master > 2) ensure that the "master candidate" replica

Using old master as new replica after clean switchover

2018-10-25 Thread Nikolay Samokhvalov
Currently, the documentation explicitly states, that after failover, the old master must be recreated from scratch, or pg_rewind should be used (requiring wal_log_hints to be on, which is off by default): > The former standby is now the primary, but the former primary is down and might stay down.