Re: Cold backup with rsync -- WAL files?

From: Denish Patel <denish(at)omniti(dot)com>
To: Jeff Frost <jeff(at)pgexperts(dot)com>
Cc: Craig James <cjames(at)emolecules(dot)com>, Payal Singh <payal(at)omniti(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Cold backup with rsync -- WAL files?
Date: 2013-12-06 21:40:54
Message-ID: CAFddxvOPbLKaHyhAcOGihq_rk5XcTbZW9dyX76_S5mTqvWP0XA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Jeff,

If you remove pg_xlogs, I do not expect Postgres to come back!

I think Craig is referring to WAL files , not pg_xlogs. He is still going
to take backup of pg_xlogs under $PGDATA when Postgres is still down.

I think there is some misunderstanding here!

On Fri, Dec 6, 2013 at 4:32 PM, Jeff Frost <jeff(at)pgexperts(dot)com> wrote:

> On 12/06/13 13:19, Denish Patel wrote:
> > Payal is right. You don't need WAL for Cold backup.
>
> I'm afraid you do.
>
> I just did a test to confirm with 9.2.6:
>
> pg_ctl -D . -m fast stop
> rsync . ../data-test -avP
> cd ../data-test/pg_xlog
> rm -f *
> cd ..
> pg_ctl -D . start
>
> LOG: could not open file "pg_xlog/00000001000000020000009B" (log file 2,
> segment 155): No such file or directory
> LOG: invalid primary checkpoint record
> LOG: could not open file "pg_xlog/00000001000000020000009B" (log file 2,
> segment 155): No such file or directory
> LOG: invalid secondary checkpoint record
> PANIC: could not locate a valid checkpoint record
> LOG: startup process (PID 13141) was terminated by signal 6: Aborted
> LOG: aborting startup due to startup process failure
>
> Then, if I copy the WAL files back from the old stopped data dir:
>
> rsync . ../data/pg_xlog/ pg_xlog/ -avP
> pg_ctl -D . start
>
> LOG: database system was shut down at 2013-12-06 13:25:13 PST
> LOG: database system is ready to accept connections
> LOG: autovacuum launcher started
>
> then it happily starts up.
>
>

--
Denish Patel,
OmniTi Computer Consulting Inc.
Database Architect,
http://omniti.com/does/data-management
http://www.pateldenish.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2013-12-06 21:46:10 Re: Cold backup with rsync -- WAL files?
Previous Message Jeff Frost 2013-12-06 21:32:12 Re: Cold backup with rsync -- WAL files?