Re: pg_basebackup: could not get transaction log end position from server: FATAL: could not open file "./pg_hba.conf~": Permission denied

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup: could not get transaction log end position from server: FATAL: could not open file "./pg_hba.conf~": Permission denied
Date: 2014-05-16 16:29:25
Message-ID: CABUevEw34wgHBP7+Qpb+NXokf6L7G9e6S4cfpbog++Bn378y_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 16, 2014 at 6:25 PM, Andres Freund <andres(at)2ndquadrant(dot)com>wrote:

> On 2014-05-16 18:20:35 +0200, Magnus Hagander wrote:
> > On Fri, May 16, 2014 at 5:46 PM, Joshua D. Drake <jd(at)commandprompt(dot)com
> >wrote:
> >
> > > At a minimum:
> > >
> > > Check to see if there is going to be a permission error BEFORE the base
> > > backup begins:
> > >
> > > starting basebackup:
> > > checking perms: ERROR no access to pg_hba.conf~ base backup will fail
> >
> >
> > That's pretty much what it does if you enable progress meter. I realize
> you
> > don't necessarily want that one, but we could have a switch that still
> > tells the server to measure the size, but not actually print the output?
> > While it costs a bit of overhead to do that, that's certainly something
> > that's a lot more safe than ignoring errors.
>
> Don't think it'll show you that error - that mode only stats() files,
> right? So you'd need to add access() or open()s.
>
>
You're right, we don't. I thought we did, but was clearly remembering wrong.

I guess we could add an access() call to that codepath though. Not sure if
that's going to cause any real overhead compared to the rest of what we're
doing anyway?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-05-16 16:32:26 Re: pg_basebackup: could not get transaction log end position from server: FATAL: could not open file "./pg_hba.conf~": Permission denied
Previous Message Andres Freund 2014-05-16 16:25:26 Re: pg_basebackup: could not get transaction log end position from server: FATAL: could not open file "./pg_hba.conf~": Permission denied