Re: While converting the Master to Standby , FATAL: timeline 2 of the primary does not match recovery target timeline 1 - Mailing list pgsql-general

From Greg Smith
Subject Re: While converting the Master to Standby , FATAL: timeline 2 of the primary does not match recovery target timeline 1
Date
Msg-id 4DFCDC82.8040901@2ndQuadrant.com
Whole thread Raw
In response to While converting the Master to Standby , FATAL: timeline 2 of the primary does not match recovery target timeline 1  (Nithya Rajendran <r-nithya@hcl.com>)
List pgsql-general
On 06/18/2011 05:22 AM, Nithya Rajendran wrote:


We are doing Master/Standby setup, We unplugged the master server, then the standby server became the master (by creating trigger file).

 

While converting the old master to new slave server, We are getting the following error in old master,


You can't make a system that used to be in the replication set join it again the way you're trying to do.  The timeline feature you're seeing errors from is there to keep you from making mistakes like this.

Even though this system used to be the master, it still needs to go through the full procedure for creating a new standby:  start a backup, sync all the files from the master, send new archive WAL data over.  The fact that this used to be the master doesn't change that.

If the database is large, it may be worthwhile to use rsync and features such as its "--inplace" feature to make the copy from new master -> old master faster.  Since it has older copies of the files, the copy can go faster than one to an empty system would take.  But you can't just convert the old master to be a standby of a new master. 

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books

pgsql-general by date:

Previous
From: Scott Ribe
Date:
Subject: Re: 2 questions re RAID
Next
From: Frank Miles
Date:
Subject: Re: set returning function with variable argument - possible?