From: Stephen Frost <sfrost@snowman.net>
To: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Cc: pgsql-admin@postgresql.org
Subject: Re: Bad recovery: no pg_xlog/RECOVERYXLOG
Date: Tue, 31 Oct 2017 07:47:56 -0400
Message-ID: <20171031114756.GP4628@tamriel.snowman.net> (raw)
In-Reply-To: <7966ee9e-2241-eced-4639-e32c157b915a@catalyst.net.nz>
References: <d90474b1-6913-f3ff-d224-73fd931cdd98@cahoots.pl>
<1070071508952614@web46j.yandex.ru>
<ae7f2ee9-97ff-267e-b6dc-9399250a9314@cahoots.pl>
<20171030154706.GE4628@tamriel.snowman.net>
<7966ee9e-2241-eced-4639-e32c157b915a@catalyst.net.nz>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Mark,
* Mark Kirkwood (mark.kirkwood@catalyst.net.nz) wrote:
> On 31/10/17 04:47, Stephen Frost wrote:
> >* Marcin Koziej (marcin@cahoots.pl) wrote:
> >>Now it's fixed, but if anyone needs I'm attaching all scripts to 1)
> >>backup and restore wal's and 2) backup and restore base backup from
> >>OpenStack SWIFT
> >Interesting, but these scripts seem to be seriously lacking in error
> >checking (what happens if the copy to swift fails..? or pg_basebackup
> >fails?) and it's unclear how you can be sure that the WAL file has been
> >sync'd to disk which is important or you might end up having holes in
> >your WAL stream if the swift system fails. There's also no checking to
> >make sure that the WAL needed for a given pg_basebackup ever actually
> >made it to the swift system, which is required to ensure you have a
> >consistent backup.
> >
> >Generally speaking, these kinds of scripts really aren't a good choice
> >for doing backups of PG. I'd strongly suggest you look at one of the
> >existing tools which are developed specifically for doing backups of PG
> >and are well tested, supported, and maintained. If you'd like support
> >for a new storage system, I know that at least pgBackRest's storage
> >layer is pluggable and adding a new storage option is pretty straight
> >forward.
>
> I'm not convinced that his approach is bad.
I was the same way for a long time, thinking that shell scripts could
reasonably be used with certain caveats, but the devil really is in the
details and it's far too easy to miss things in shell scripts (such as
not checking return codes, or not doing so properly, or various other
issues). Also, you didn't address things like verifying that you
actually have all the WAL needed for a valid backup, and how to handle
retention?
> The script checks the result of the 'swift upload' for the base
> backup, it is the wal backup one that does not explicitly check the
> 'swift upload' result (this should really be added). To be fair,
> anything wrong with the swift system will likely be discovered
> immediately beforehand where he does a 'swift stat'!
Things could certainly break between those two calls to swift, in a
variety of ways.
> I'd guess his original problem was an improperly setup
> recovery.conf, rather than the overall design.
I agree that the original issue is unlikely to be related to these
scripts. That doesn't mean that using them is a good idea.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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: sfrost@snowman.net, mark.kirkwood@catalyst.net.nz
Subject: Re: Bad recovery: no pg_xlog/RECOVERYXLOG
In-Reply-To: <20171031114756.GP4628@tamriel.snowman.net>
* 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