Re: pg_rewind in contrib - Mailing list pgsql-hackers

From Venkata Balaji N
Subject Re: pg_rewind in contrib
Date
Msg-id CAEyp7J-vDiF4Wc0e=G9oJC=+LuBwZNjjo-UV5hki5-iXg8SkBg@mail.gmail.com
Whole thread Raw
In response to Re: pg_rewind in contrib  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: pg_rewind in contrib  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers

I have committed this, with some more kibitzing.  hope I have not missed any comments given so far. Many thanks for the review, and please continue reviewing and testing it :-).

I have been testing the pg_rewind and have an analysis to share along with few questions -

I had a streaming replication setup with one master and one slave running successfully.

Test 1 :

- Killed postgres process on master and promoted slave. Both were in sync earlier.
- performed some operations (data changes) on newly promoted slave node and shutdown
- Executed pg_rewind on old master and got the below message

target server must be shut down cleanly
Failure, exiting

If the master is crashed or killed abruptly, it may not be possible to do a rewind. Is my understanding correct ?

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.

Regards,
Venkata Balaji N

pgsql-hackers by date:

Previous
From: Shigeru HANADA
Date:
Subject: Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Next
From: Michael Paquier
Date:
Subject: Re: pg_rewind in contrib