Re: pg_rewind in contrib - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_rewind in contrib
Date
Msg-id CAB7nPqQ6t4ayasnR=-tf8G-aD4hj=UxzaSO-TS=+9_xhWbHOdA@mail.gmail.com
Whole thread Raw
In response to Re: pg_rewind in contrib  (Venkata Balaji N <nag1010@gmail.com>)
Responses Re: pg_rewind in contrib
List pgsql-hackers
On Thu, Mar 26, 2015 at 12:23 PM, Venkata Balaji N <nag1010@gmail.com> wrote:
> Test 1 :
>
> [...]
>
> If the master is crashed or killed abruptly, it may not be possible to do a
> rewind. Is my understanding correct ?

Yep. This is mentioned in the documentation:
http://www.postgresql.org/docs/devel/static/app-pgrewind.html
"The target server must shut down cleanly before running pg_rewind".

> Test 2 :
>
> - On a successfully running streaming replication with one master and one
> slave, i did a clean shutdown of master
> - promoted slave
> - performed some operations (data changes) on newly promoted slave and did a
> clean shutdown
> - Executed pg_rewind on the old master to sync with the latest changes on
> new master. I got the below message
>
> The servers diverged at WAL position 0/A2000098 on timeline 1.
> No rewind required.
>
> I am not getting this too.

In this case the master WAL visibly did not diverge from the slave WAL
line. A rewind is done if the master touches new relation pages after
the standby has been promoted, and before the master is shutdown.
-- 
Michael



pgsql-hackers by date:

Previous
From: Venkata Balaji N
Date:
Subject: Re: pg_rewind in contrib
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql - Assert statement