Re: Checkpoint Err on Startup of Rsynced System - Mailing list pgsql-general

From Alan Hodgson
Subject Re: Checkpoint Err on Startup of Rsynced System
Date
Msg-id 1834964.5QaEnphiTj@skynet.simkin.ca
Whole thread Raw
In response to Checkpoint Err on Startup of Rsynced System  (Jim Longwill <longwill@psmfc.org>)
List pgsql-general
On Tuesday, May 31, 2016 10:13:14 AM Jim Longwill wrote:
> I am trying to setup a 2nd, identical, db server (M2) for development
> and I've run into a problem with starting up the 2nd Postgres installation.
>
> Here's what I've done:
>    1) did a 'clone' of 1st (production) machine M1 (so both machines on
> Cent OS 7.2)
>    2) setup an rsync operation, did a complete 'rsync' from M1 to M2
>    3) did a final 'CHECKPOINT' command on M1 postgres
>    4) shutdown postgres on M1 with 'pg_ctl stop'
>    5) did final 'rsync' operation  (then restarted postgres on M1 with
> 'pg_ctl start')
>    6) tried to startup postgres on M2
>
> It won't start, & in the log file gives the error message:
> ...
> < 2016-05-31 09:02:52.337 PDT >LOG:  invalid primary checkpoint record
> < 2016-05-31 09:02:52.337 PDT >LOG:  invalid secondary checkpoint record
> < 2016-05-31 09:02:52.337 PDT >PANIC:  could not locate a valid
> checkpoint record
> < 2016-05-31 09:02:53.184 PDT >LOG:  startup process (PID 26680) was
> terminated by signal 6: Aborted
> < 2016-05-31 09:02:53.184 PDT >LOG:  aborting startup due to startup
> process failure
>
> I've tried several times to do this but always get this result.  So, do
> I need to do a new 'initdb..' operation on machine M2 + restore from M1
> backups?  Or is there another way to fix this?

What you describe should work fine. In order of likelihood of why it doesnt, I
could guess:

1 - you're not waiting for the database to fully shut down before running the
last rsync
2 - you're not in fact rsync'ing the entire data directory
3 - the target server is running a different version of PostgreSQL or has a
different machine architecture



pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Log Shipping
Next
From: Joseph Kregloh
Date:
Subject: Re: Log Shipping