Re: Replication rolling back to normal. - Mailing list pgsql-general

From Michael Paquier
Subject Re: Replication rolling back to normal.
Date
Msg-id CAB7nPqRrsjK+E1Jd4qmaFF2fJ-nuJa4E7QQBVDJPi1Ev+Qg+1Q@mail.gmail.com
Whole thread Raw
In response to Replication rolling back to normal.  (Dasitha Karunajeewa <dasitha@duosoftware.com>)
List pgsql-general
On Fri, Oct 21, 2016 at 10:10 PM, Dasitha Karunajeewa
<dasitha@duosoftware.com> wrote:
> What I want to know is how to switch them back to the normal status. That
> means pgmaster need to be the Master server which acept the writed and
> pgslave that accepts only reads along with the replication.

If your promoted standby got ahead of the former master, you could use
the promoted standby as a new master, and replug the former master as
a standby. The latter step can be done by either running pg_rewind on
the former masfer or taking a new base backup from the promoted
standby and use that to set up a new standby. pg_rewind will be
successful to run only if the master has kept WAL segments from the
last checkpoint record where WAL forked when standby has been
promoted.
--
Michael


pgsql-general by date:

Previous
From: Арсений Нестюк
Date:
Subject: Re: Showing matrix with single query
Next
From: Michael Paquier
Date:
Subject: Re: Large empty table, balanced INSERTs and DELETEs, not being vacuumed