From: Peter <pmc@citylink.dinoex.sub.org>
To: Magnus Hagander <magnus@hagander.net>
Cc: Peter <pmc@citylink.dinoex.sub.org>
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 19:48:18 +0200
Message-ID: <20200613174818.GA91251@gate.oper.dinoex.org> (raw)
In-Reply-To: <CABUevEz8PtmzeXc5smHFm4BxNefOegD5oqUo-_pzyZS4cHphiQ@mail.gmail.com>
References: <20200609000253.GA21670@gate.oper.dinoex.org>
<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>
On Thu, Jun 11, 2020 at 10:35:13PM +0200, Magnus Hagander wrote:
! > Okay. So lets behave like professional people and figure how that
! > can be achieved:
! > At first, we drop that WAL requirement, because with WAL archiving
! > it is already guaranteed that an unbroken chain of WAL is always
! > present in the backup (except when we have a bug like the one that
! > lead to this discussion).
! > So this is **not part of the scope**.
! >
!
! I would assume that anybody who deals with backups professionally wouldn't
! consider that out of scope,
I strongly disagree. I might suppose You haven't thought this to the
proper end. See:
The WAL backup is, for a couple of reasons, different to most other
backup objects:
- it runs on demand, not per schedule.
- it must be immediately repeated (or alerted), until success,
otherwise the database might stop.
- it might use a different storage (e.g. twofold/mirrored),
for obvious reasons.
- it gets deleted after backup, and that is a point-of-no-return.
For the data tree backup, on the contrary, all these attributes are
identical to those of any other incr/full filesystem backup.
You can see that all the major attributes (scheduling, error-handling,
signalling, ...) of a WAL backup are substantially different to that
of any usual backup.
This is a different *Class* of backup object, therefore it needs an
appropriate infrastructure that can handle these attributes correctly.
The WAL do *not belong* into the scope of the data tree backup, they
are to be handled by different schemes in a different way.
But, if You never have considered *continuous* archiving, and only
intend to take a functional momentarily backup of a cluster, then You
may well have never noticed these differences. I noticed them mainly
because I did *BUILD* such an infrastructure (the 20 lines of shell
script, you know).
And yes, I was indeed talking about *professional* approaches.
! There is *absolutely* no need for threading to use the current APIs. You
! need to run one query, go do something else, and then run another
! query.
Wrong. The point is, I dont want to "go do something else", I have to
exit() and get back to the initiator at that place.
This is also clearly visible in Laurenz' code: he utilizes two
unchecked background tasks (processes, in this case) with loose
coupling for the purpose, as it does not work otherwise.
! But then, lets think another step forward: for what purpose do we
! > actually need to call pg_start_backup() and pg_stop_backup() at all?
! > I couldn't find exhaustive information about that, only some partial
! > facts.
! >
!
! Since you don't trust the documentation, I suggest you take a look at
! https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/access/transam/xlog.c;h=55c...
Thanks, this indeed gives a most entertaining read. Honestly, I've
never seen such a source before - there is thrice as much storytime
than code. :)
The most interesting point in there appears to be this:
> that the backup label and tablespace map files are not written to
> disk. Instead, their would-be contents are returned in *labelfile
> and *tblspcmapfile,
This is in do_pg_start_backup() - so we actually HAVE this data
already at the *START* time of the backup!
Then why in hell do we wait until the END of the backup before we
hand this data to the operator: at a time when the DVD with the
backup is already fixated and cannot be changed anymore, so that
we have to send this data to quarternary storage (spell: the line
printer) and have girl Friday sort them out (and probably mix them
up)??
Is this indeed Boeing-security: try to avoid possible mistake by
creating a much bigger risk?
! Things that remain to be figured out:
! > 1. What does pg_start_backup actually do and why would that be
! > necessary? I could not find exhaustive information, but this can
! > probably figured from the source. Currently I know so much:
! > - it writes a backup_label file. That is just a few lines of
! > ASCII and should not be difficult to produce.
! >
!
! It does that only in exclusive mode, and doing that is one of the big
! problems with exclusive mode. So don't do that.
As I can read, there is no difference in the function requirements
between exclusive and non-exclusive mode, in that regard: the
backup-label file is NOT necessary in the running cluster data tree,
BUT it should get into the RESTORED data tree before starting it.
And I can't find a single one of those "big problems". What I do find
is just people whining that their cluster doesn't start and they can't
simply delete a file, even if told so. Like soldier complaining that
his gun doesn't shoot and he has no idea how to reload.
I could devise a dozen ways how to detect that situation automatically
during rc.d and remove the file - if it were of any concern to me.
! > I now hope very much that Magnus Hagander will tell some of the
! > impeding "failure scenarios", because I am getting increasingly
! > tired of pondering about probable ones, and searching the old
! > list entries for them, without finding something substantial.
! Feel free to look at the mailinglist archives. Many of them have been
! explained there before. Pay particular attention to the threads around when
! the deprecated APIs were actually deprecaed.
I *DID* read all that stuff. About hundred messages. It is HORRIBLE.
I was tearing out my hair in despair.
To subsume: it all circles around catering for gross pilot error and
stupidity.
cheerio,
PMc
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: 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: <20200613174818.GA91251@gate.oper.dinoex.org>
References: <20200609000253.GA21670@gate.oper.dinoex.org> <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> <20200613174818.GA91251@gate.oper.dinoex.org>
* 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