Re: [HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-10 Thread Bruce Momjian
On Thu, Jan 2, 2014 at 03:34:04PM +0100, Bernd Helmle wrote: --On 1. Januar 2014 23:53:46 +0100 Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, As much as I've seen people frown upon $subject, it still happens in the wild, and Magnus seems to agree that the current failure mode of

Re: [HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-07 Thread Michael Paquier
On Thu, Jan 2, 2014 at 11:34 PM, Bernd Helmle maili...@oopsware.de wrote: --On 1. Januar 2014 23:53:46 +0100 Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, As much as I've seen people frown upon $subject, it still happens in the wild, and Magnus seems to agree that the current failure

Re: [HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-07 Thread Magnus Hagander
On Thu, Jan 2, 2014 at 2:06 PM, Dimitri Fontaine dimi...@2ndquadrant.frwrote: Magnus Hagander mag...@hagander.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

Re: [HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-07 Thread Dimitri Fontaine
Magnus Hagander mag...@hagander.net writes: Applied a fairly heavily edited version of this one. I also backpatched it to 9.1 and up. Thanks a lot! Did some reviewing and re-testing here, I like using DataDir and IS_DIR_SEP better than what I did, of course ;-) Regards, -- Dimitri Fontaine

Re: [HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-05 Thread Craig Ringer
On 01/02/2014 06:53 AM, Dimitri Fontaine wrote: As much as I've seen people frown upon $subject, it still happens in the wild I met a new case of it a couple of weeks ago, so I can certainly confirm that. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development,

Re: [HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-02 Thread Magnus Hagander
On Wed, Jan 1, 2014 at 11:53 PM, Dimitri Fontaine dimi...@2ndquadrant.frwrote: Hi, As much as I've seen people frown upon $subject, it still happens in the wild, and Magnus seems to agree that the current failure mode of our pg_basebackup tool when confronted to the situation is a bug. So

Re: [HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-02 Thread Dimitri Fontaine
Magnus Hagander mag...@hagander.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

Re: [HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-02 Thread Bernd Helmle
--On 1. Januar 2014 23:53:46 +0100 Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Hi, As much as I've seen people frown upon $subject, it still happens in the wild, and Magnus seems to agree that the current failure mode of our pg_basebackup tool when confronted to the situation is a bug.

[HACKERS] Fixing pg_basebackup with tablespaces found in $PGDATA

2014-01-01 Thread Dimitri Fontaine
Hi, As much as I've seen people frown upon $subject, it still happens in the wild, and Magnus seems to agree that the current failure mode of our pg_basebackup tool when confronted to the situation is a bug. So here's a fix, attached. To reproduce, mkdir -p $PGDATA/tbs/foo then CREATE