Streaming replication failover/failback - Mailing list pgsql-general

From Israel Brewster
Subject Streaming replication failover/failback
Date
Msg-id BE560682-E304-47C6-BDB1-67040122B36C@ravnalaska.net
Whole thread Raw
Responses Re: Streaming replication failover/failback  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Streaming replication failover/failback  (Jehan-Guillaume de Rorthais <ioguix@free.fr>)
List pgsql-general
I've been playing around with streaming replication, and discovered that the following series of steps *appears* to work without complaint:

- Start with master on server A, slave on server B, replicating via streaming replication with replication slots.
- Shut down master on A
- Promote slave on B to master
- Create recovery.conf on A pointing to B
- Start (as slave) on A, streaming from B

After those steps, A comes up as a streaming replica of B, and works as expected. In my testing I can go back and forth between the two servers all day using the above steps.

My understanding from my initial research, however, is that this shouldn't be possible - I should need to perform a new basebackup from B to A after promoting B to master before I can restart A as a slave. Is the observed behavior then just a "lucky fluke" that I shouldn't rely on? Or is it expected behavior and my understanding about the need for a new basebackup is simply off? Does the new pg_rewind feature of 9.5 change things? If so, how?

Thanks for your time!
-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------



Attachment

pgsql-general by date:

Previous
From: Patrick B
Date:
Subject: Check integrity between servers
Next
From: Patrick B
Date:
Subject: Re: Check integrity between servers