Re: [HACKERS] Duplicate usage of tablespace location? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] Duplicate usage of tablespace location?
Date
Msg-id CAB7nPqTfsNW3920KOY62NGj761wE3BTeE1OMQNrBKndR1mL2nQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Duplicate usage of tablespace location?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: [HACKERS] Duplicate usage of tablespace location?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
On Thu, May 11, 2017 at 1:09 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:
> If we can accept multiple server versions share a tablespace
> directory, pg_basebackup also can allow that situation. The
> attached patch does that. Similary to the server code, it
> correctly fails if the same version subdirectory exists.

+#define verify_dir_is_empty_or_create(dirname, created, found) \
+    verify_and_create_dir(dirname, created, found, false)
This solution looks like a quick-and-dirty fix. I tend to prefer a
solution close to whet Pierre is proposing on the other thread by
localizing things in ReceiveAndUnpackTarFile(). This makes the check
more localized, and there is no need to complicate low-level APIs of
pg_basebackup.c.

By the way, it may be better to keep discussions on the first thread created:
https://www.postgresql.org/message-id/05c62730-8670-4da6-b783-52e66fb42232@pinaraf.info
A patch has been submitted to the next CF there as well.
-- 
Michael



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Bug with pg_basebackup and 'shared' tablespace
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Bug in ExecModifyTable function and trigger issues forforeign tables