Re: Fixing pg_basebackup with tablespaces found in $PGDATA

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixing pg_basebackup with tablespaces found in $PGDATA
Date: 2014-01-07 16:28:49
Message-ID: CABUevEyeOzSCASc2ZYshZ-k-8Sg-Cmt2FrdYmQob4-_LkaGOMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 2, 2014 at 2:06 PM, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>wrote:

> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > We can't get away with just comparing the relative part of the pathname.
> > Because it will fail if there is another path with exactly the same
> length,
> > containing the tablespace.
>
> Actually… yeah.
>
> > I think we might want to store a value in the tablespaceinfo struct
> > indicating whether it's actually inside PGDATA (since we have the full
> path
> > at that point), and then skip it based on that instead. Or store and pass
> > the value of getcwd() perhaps.
>
> I think it's best to stuff in the tablespaceinfo struct either NIL or
> the relative path of the tablespace when found in $PGDATA, as done in
> the attached.
>
> > I've attached a slightly updated patch - I changed around a bit of logic
> > order and updated some comments during my review. And added
> error-checking.
>
> Thanks! I started again from your version for v3.
>
>
Applied a fairly heavily edited version of this one. I also backpatched it
to 9.1 and up.

Thanks!

--
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 Ronan Dunklau 2014-01-07 16:31:10 Re: Triggers on foreign tables
Previous Message Kevin Grittner 2014-01-07 16:25:36 Re: How to reproduce serialization failure for a read only transaction.