From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mike Cardwell <mike.cardwell@hardenize.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pg_basebackup failed to read a file
Date: Tue, 14 Aug 2018 12:14:59 -0400
Message-ID: <1887.1534263299@sss.pgh.pa.us> (raw)
In-Reply-To: <1534256304.6834.4.camel@hardenize.com>
References: <1534256304.6834.4.camel@hardenize.com>
Mike Cardwell <mike.cardwell@hardenize.com> writes:
> pg_basebackup: could not get write-ahead log end position from server:
> ERROR: could not open file "./postgresql.conf~": Permission denied
> Now, I know what this error means. There was a root owned file at
> "/var/lib/pgsql/10/data/postgresql.conf~" which contained an old
> version of our postgres config and was not readable by the postgres
> user. I'll delete this file and try again. However, in the mean time: I
> feel like it would be useful for pg_basebackup to check that it has
> read access to all of the existing files in the source directory at the
> start, before it begins it's copy.
That seems like a pretty expensive thing to do, if there are lots of
files ... and you'd still end up failing, so it's not moving the ball
very far.
More generally, this seems closely related to bug #14999 [1]
which concerned pg_rewind's behavior in the face of unexpected file
permissions within the data directory. We ended up not doing anything
about that except documenting it, which I wasn't very satisfied with,
but the costs of doing better seemed to exceed the benefits.
It'd be nice to have a more coherent theory about what needs to be copied
or not, and not fail on files that could simply be ignored. Up to now
we've resisted having any centrally defined knowledge of what can be
inside a PG data directory, but maybe that bullet needs to be bitten.
regards, tom lane
[1] https://www.postgresql.org/message-id/flat/20180104200633.17004.16377%40wrigleys.postgresql.org
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: tgl@sss.pgh.pa.us, mike.cardwell@hardenize.com
Subject: Re: pg_basebackup failed to read a file
In-Reply-To: <1887.1534263299@sss.pgh.pa.us>
References: <1534256304.6834.4.camel@hardenize.com> <1887.1534263299@sss.pgh.pa.us>
* 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