From: Kevin Grittner <kgrittn@ymail.com>
To: Denish Patel <denish@omniti.com>
To: Craig James <cjames@emolecules.com>
Cc: Jeff Frost <jeff@pgexperts.com>
Cc: Payal Singh <payal@omniti.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Cold backup with rsync -- WAL files?
Date: Fri, 6 Dec 2013 13:46:10 -0800 (PST)
Message-ID: <1386366370.97863.YahooMailNeo@web162901.mail.bf1.yahoo.com> (raw)
In-Reply-To: <CAFddxvNy2EQyH3r5kAwabwkghr+sg7oqi+AwRaH93AydDJMeNQ@mail.gmail.com>
References: <CAFwQ8rd+oDkLG4KWkux=2jwNinBnuwhY8DH3W-_58MGO1m3=Lg@mail.gmail.com>
<23125649.944094.1386343468257.JavaMail.root@mail.int.journyx.com>
<CAFwQ8rf+-rjYKYZLm=ip+OC2evfSTZwa0hEFi7WOcL6vBYXnAA@mail.gmail.com>
<CAFwQ8reT_6hEkHaZ36981zA6pS39i+AUePyWsc9aoiX7MH6FeQ@mail.gmail.com>
<CANUg7LB6yQp4YngQ9zrPHU2OeB5T120Z_hvRoJx9RAvjHbgu8A@mail.gmail.com>
<CAFwQ8rd9Wo7a6HqviP04dyhr0h9A1Fb-comPkxxzpuoi0NXC_Q@mail.gmail.com>
<WM!c8658ce9381c4bf437df90c814a1308ff6cbd72c0dc9f8b9ad8b99ac34963b07ad223e770169e65b1a29e90a9f43003c!@asav-1.01.com>
<B36E5875-ACB1-4FCF-AF5E-10F2C901F77B@pgexperts.com>
<CAFwQ8rdwE58EVB7Aki0kAdeVELerbh8_oe9GTdP=er1Ku37epg@mail.gmail.com>
<CAFddxvNy2EQyH3r5kAwabwkghr+sg7oqi+AwRaH93AydDJMeNQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Denish Patel <denish@omniti.com> wrote:
> Craig James <cjames@emolecules.com> wrote:
>> Jeff Frost <jeff@pgexperts.com> wrote:
>>>> Craig James <cjames@emolecules.com> wrote:
>>>>
>>>> After I rsync the postgres data directory, do I need the WAL
>>>> files from the source (they're on a separate disk, not part of
>>>> the postgres data directory)? Can/should I erase the WAL
>>>> directory of the destination?
>>>
>>> Yes, you need the WAL files.
>>
>> Now I have two directly conflicting answers. You say the WAL
>> files are needed even though the DB is shut off, and Payal Singh
>> says I don't need the WAL files (but I don't think he cc'd the
>> mailing list).
>>
>> Why are the WAL files necessary if the DB is shut off? Why
>> can't they just be erased?
>>
>> It's a gigabyte of copying that I was hoping to avoid.
> Payal is right. You don't need WAL for Cold backup.
This experiment took far less time than reading the thread:
kgrittn@Kevin-Desktop:~/pg/master$ pg_ctl -D Debug/data -m fast -w stop
waiting for server to shut down.... done
server stopped
kgrittn@Kevin-Desktop:~/pg/master$ mkdir Debug/data/xlog2
kgrittn@Kevin-Desktop:~/pg/master$ mv Debug/data/pg_xlog/* Debug/data/xlog2/
kgrittn@Kevin-Desktop:~/pg/master$ rm -f Debug/data/logfile ; pg_ctl -D Debug/data -l Debug/data/logfile -w start || cat Debug/data/logfile
waiting for server to start........ stopped waiting
pg_ctl: could not start server
Examine the log output.
LOG: database system was shut down at 2013-12-06 15:31:27 CST
LOG: creating missing WAL directory "pg_xlog/archive_status"
LOG: invalid primary checkpoint record
LOG: invalid secondary checkpoint record
PANIC: could not locate a valid checkpoint record
LOG: startup process (PID 15471) was terminated by signal 6: Aborted
LOG: aborting startup due to startup process failure
Now, if you're very clever you might be able to copy just
*selected* WAL files. You've gotta ask yourself a question: "Do I
feel lucky?" Well, do ya?
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: kgrittn@ymail.com, denish@omniti.com, cjames@emolecules.com, jeff@pgexperts.com, payal@omniti.com
Subject: Re: Cold backup with rsync -- WAL files?
In-Reply-To: <1386366370.97863.YahooMailNeo@web162901.mail.bf1.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox