Re: Automatic restore corruption problem

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>, Matthieu Lejeune <matthieu(dot)lejeune(at)exxoss(dot)com>
Cc: Keith <keith(at)keithf4(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Automatic restore corruption problem
Date: 2015-07-16 18:39:34
Message-ID: 715399565.355625.1437071974784.JavaMail.yahoo@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Guillaume Lelarge <guillaume(at)lelarge(dot)info> wrote:

> There were two issues on your script: it removed the backup_label
> file and didn't create the recovery.conf file.

There were more flaws in the script than that. See:

http://www.postgresql.org/docs/current/static/continuous-archiving.html#BACKUP-PITR-RECOVERY

That says, in part:

| Remove any files present in pg_xlog/; these came from the file
| system backup and are therefore probably obsolete rather than
| current.

The point is, if you are unfortunate enough to have recovery use
one of the WAL files copied during the backup, it might not be
complete, since they may have been copied at any point in the
backup -- quite likely before all the WAL records needed for
reaching consistency were added. The archived WAL files will be
complete; set up the recovery.conf file to use them.

Elsewhere on that page it says:

| You might also want to exclude postmaster.pid and
| postmaster.opts, which record information about the running
| postmaster, not about the postmaster which will eventually use
| this backup. (These files can confuse pg_ctl.)

If these files are removed, it is much harder to accidentally bring
up the database with corruption.

> Did you fix this? if yes, can you send back your script? Thanks.

Yeah, if you think you are now following the instructions shown at
the link I show above and are still having problems, please show
all steps in the process -- copy and paste scripts and commands,
and the relevant portions of logs.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Natalie Wenz 2015-07-16 19:10:09 Re: postgres_fdw user mapping and role inheritance
Previous Message Tom Lane 2015-07-16 18:16:07 Re: postgres_fdw user mapping and role inheritance