Re: Replication rolling back to normal.

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Dasitha Karunajeewa <dasitha(at)duosoftware(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: Replication rolling back to normal.
Date: 2016-10-22 07:04:15
Message-ID: CAB7nPqRrsjK+E1Jd4qmaFF2fJ-nuJa4E7QQBVDJPi1Ev+Qg+1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 21, 2016 at 10:10 PM, Dasitha Karunajeewa
<dasitha(at)duosoftware(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2016-10-22 07:11:46 Re: Large empty table, balanced INSERTs and DELETEs, not being vacuumed
Previous Message Tom Lane 2016-10-22 00:33:17 Re: checkpoint write errors