Re: Unable to recovery due missing wal_file - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Unable to recovery due missing wal_file
Date
Msg-id 92ae6377-b3b1-77bc-2aab-cbb83b273aff@aklaver.com
Whole thread Raw
In response to Unable to recovery due missing wal_file  (Patrick B <patrickbakerbr@gmail.com>)
List pgsql-general
On 07/03/2016 02:48 PM, Patrick B wrote:
> Hi guys,
>
> I'm currently using PostgreSQL 9.2.
>
> One of my backup servers went down, and I had to re-sync the all the DB.
> I used pg_basebackup and, of course, at the same time wal_archive.
>
> Steps:
>
> 1 - Confirm the wal_files are being copied into the new server.
> 2 - Delete /var/lib/pgsql/9.2/data/*
> 3 - Double check the wal_files are ok into the server
> 4 - Start pg_basebackup
> 5 - pg_basebackup took 10 days, as our DB is 2.0TB.
> 6 - Start postgres with the recovery.conf.restore_comand
> 7 - Wait for the wal_files being processed
>
> I got an error here: 00000002000013B40000001A` not found
> How is that possible? If I double checked!! :(

Did you read this?:
https://www.postgresql.org/docs/9.5/static/app-pgbasebackup.html

-X method
--xlog-method=method

     Includes the required transaction log files (WAL files) in the
backup. This will include all transaction logs generated during the
backup. If this option is specified, it is possible to start a
postmaster directly in the extracted directory without the need to
consult the log archive, thus making this a completely standalone backup.

     The following methods for collecting the transaction logs are
supported:

     f
     fetch

         The transaction log files are collected at the end of the
backup. Therefore, it is necessary for the wal_keep_segments parameter
to be set high enough that the log is not removed before the end of the
backup. If the log has been rotated when it's time to transfer it, the
backup will fail and be unusable.
     s
     stream

         Stream the transaction log while the backup is created. This
will open a second connection to the server and start streaming the
transaction log in parallel while running the backup. Therefore, it will
use up two connections configured by the max_wal_senders parameter. As
long as the client can keep up with transaction log received, using this
mode requires no extra transaction logs to be saved on the master.




> I can't find that file anywhere.. and now I'll have to re-do all the work =(
>
> Is there any tips you guys could give me on this situation?
>
> Should I check the backup_label file when the pg_basebackup starts, and
> check if the wal_file inside the backup_label file exists?
>
> Thanks
> Patrick
>


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: psql connection option: statement_timeout
Next
From: Adrian Klaver
Date:
Subject: Re: Unable to recovery due missing wal_file