From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Peter <pmc@citylink.dinoex.sub.org>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Something else about Redo Logs disappearing
Date: Sat, 13 Jun 2020 13:53:28 +0200
Message-ID: <fe4fd7730e5f292342eb2b0a86db51fd55cf34fe.camel@cybertec.at> (raw)
In-Reply-To: <20200613032453.GA8494@gate.oper.dinoex.org>
References: <d105ee7a-19d5-3207-6311-a1dde37f95f5@aklaver.com>
<20200609023326.GA61487@gate.oper.dinoex.org>
<c5ae78f9-e922-29bc-379d-739baeb06e2f@aklaver.com>
<20200609175521.GA96231@gate.oper.dinoex.org>
<20200609194248.GL6680@tamriel.snowman.net>
<20200610074608.GA29949@gate.oper.dinoex.org>
<20200610123222.GV6680@tamriel.snowman.net>
<20200611173032.GA93488@gate.oper.dinoex.org>
<CABUevEz8PtmzeXc5smHFm4BxNefOegD5oqUo-_pzyZS4cHphiQ@mail.gmail.com>
<dfc123b2c836c038cf2d49cde07fc5d4dc9f08a8.camel@cybertec.at>
<20200613032453.GA8494@gate.oper.dinoex.org>
On Sat, 2020-06-13 at 05:24 +0200, Peter wrote:
> ! https://github.com/cybertec-postgresql/safe-backup
>
> Ah, thank You, very nice.
>
> I've never seen anybody coding bash - it is strongly shunned in the
> Berkeley community.
Strange, but then I don't move in these circles.
> Some Questions:
> 1. There are explicit error messages in loc-82 and -92 of pgpre.sh.
> To where are these written?
Standard error. It is up to the caller of the script to route that
somewhere useful.
> 2. The result data from pg_stop_backup() are stored into the living
> database. But, according to the docs, they should be placed into
> the completed backup. Do I have a misunderstanding here?
Right, but these scripts don't know anything about that backup itself.
They are designed to be called before and after the backup.
In between, you back up the data directory however you think fit.
It is the responsibility of the caller of the post-backup script
to add the "backup_label" file to the backup.
> 3. The most common error cause of a backup might be tape-side
> malfunction. So far as I see, the way to handle this is currently,
> to provide a timeout for pgpre.sh (which is problematic, because
> we might as well have just reached end-of-tape and have to wait
> until monday for the operator to change it). May I suggest to add
> a switch to pgpost.sh, in order to volutarily fail out of the job?
As said above, the backup itself is not the job of these scripts.
> 4. If, by misconfiguration and/or operator error, the backup system
> happens to start a second backup. in parallel to the first,
> then do I correctly assume, both backups will be rendered
> inconsistent while this may not be visible to the operator; and
> the earlier backup would be flagged as apparently successful while
> carrying the wrong (later) label?
If you are using my scripts and start a second backup while the first
one is still running, the first backup will be interrupted.
This is specific to my scripts, PostgreSQL's non-exclusive backup
can perform more than one concurrent backup successfully.
I tried to keep things simple.
> BTW: what does, in general, happen, if a backup_label file gets
> accidentially swapped with one from a parallel, but slightly later
> backup? Do I correctly assume that such mistake gets somehow detected,
> as otherwise it would have just the same unwelcome effects
> (i.e. silent data corruption) as no backup_label at all?
If you have the wrong "backup_label", you end up with silent data corruption.
That should not happen with my scripts, though.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, pmc@citylink.dinoex.sub.org, magnus@hagander.net, sfrost@snowman.net, adrian.klaver@aklaver.com
Subject: Re: Something else about Redo Logs disappearing
In-Reply-To: <fe4fd7730e5f292342eb2b0a86db51fd55cf34fe.camel@cybertec.at>
References: <d105ee7a-19d5-3207-6311-a1dde37f95f5@aklaver.com> <20200609023326.GA61487@gate.oper.dinoex.org> <c5ae78f9-e922-29bc-379d-739baeb06e2f@aklaver.com> <20200609175521.GA96231@gate.oper.dinoex.org> <20200609194248.GL6680@tamriel.snowman.net> <20200610074608.GA29949@gate.oper.dinoex.org> <20200610123222.GV6680@tamriel.snowman.net> <20200611173032.GA93488@gate.oper.dinoex.org> <CABUevEz8PtmzeXc5smHFm4BxNefOegD5oqUo-_pzyZS4cHphiQ@mail.gmail.com> <dfc123b2c836c038cf2d49cde07fc5d4dc9f08a8.camel@cybertec.at> <20200613032453.GA8494@gate.oper.dinoex.org> <fe4fd7730e5f292342eb2b0a86db51fd55cf34fe.camel@cybertec.at>
* 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