Re: File system level backup of shut down standby does not work?

From: Jürgen Fuchsberger <juergen(dot)fuchsberger(at)uni-graz(dot)at>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "Antman, Jason (CMG-Atlanta)" <Jason(dot)Antman(at)coxinc(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: File system level backup of shut down standby does not work?
Date: 2014-02-19 13:20:33
Message-ID: 5304AFA1.3030901@uni-graz.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/19/2014 11:43 AM, Albe Laurenz wrote:
> Jürgen Fuchsberger wrote:
>> One very important thing I just noted when shutting down and restarting
>> my standby server:
>>
>> My standby server *always needs the last WAL-file* from the archive
>> directory, even when the shut down was "smart". Without this the
>> consistent recovery state will not be reached.
>>
>> 2014-02-19 11:10:20 CET LOG: received smart shutdown request
>> 2014-02-19 11:10:20 CET LOG: shutting down
>> 2014-02-19 11:10:20 CET LOG: database system is shut down
>> 2014-02-19 11:11:00 CET LOG: database system was shut down in recovery
>> at 2014-
>> 02-19 11:10:20 CET
>> 2014-02-19 11:11:00 CET LOG: entering standby mode
>> 2014-02-19 11:11:00 CET LOG: incomplete startup packet
>> 2014-02-19 11:11:01 CET FATAL: the database system is starting up
>>
>> *2014-02-19 11:11:01 CET LOG: restored log file*
>> *"00000001000002DE000000BF" from archive*
>>
>> 2014-02-19 11:11:01 CET LOG: redo starts at 2DE/BF036FA4
>> 2014-02-19 11:11:01 CET FATAL: the database system is starting up
>> 2014-02-19 11:11:01 CET LOG: consistent recovery state reached at
>> 2DE/BFFFE53C
>> 2014-02-19 11:11:01 CET LOG: database system is ready to accept read
>> only connections
>>
>> So my question is, could there be something wrong with my configuration
>> or is this normal?
>
> As far as I can tell, that is as expected:
>
> Upon restart, the recovery process will continue from the last restart point.
> So if the restart point happened after replay of WAL record X in WAL
> file Y, the recovery process will need WAL file Y again to replay
> X+1 and the following records.
>
> Yours,
> Laurenz Albe
>
OK, so it is important to back up the WAL archive dir too to have a
consistent backup. This was not that clear to me and
https://wiki.postgresql.org/wiki/Incrementally_Updated_Backups
does not mention the WAL archive dir neither. I might update the Wiki entry.

Best,
Juergen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tjibbe 2014-02-19 14:17:44 why VARIADIC functions executed on array input?
Previous Message Antman, Jason (CMG-Atlanta) 2014-02-19 13:12:40 Re: File system level backup of shut down standby does not work?