Re: Avoiding Tablespace path collision for primary and standby - Mailing list pgsql-hackers

From Ashwin Agrawal
Subject Re: Avoiding Tablespace path collision for primary and standby
Date
Msg-id CALfoeitcxqXykOhcjACZF7j47zKHHGC9ObPM=5yZNJK+TDjXHw@mail.gmail.com
Whole thread Raw
In response to Re: Avoiding Tablespace path collision for primary and standby  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Avoiding Tablespace path collision for primary and standby  (Thomas Munro <thomas.munro@enterprisedb.com>)
Re: Avoiding Tablespace path collision for primary and standby  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers

On Fri, May 25, 2018 at 7:33 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Ashwin Agrawal <aagrawal@pivotal.io> writes:
> Proposing to create directory with timestamp at time of creating tablespace
> and create symbolic link to it instead.

I'm skeptical that this solves your problem.  What happens when the CREATE
TABLESPACE command is replicated to the standby with sub-second delay?

I thought timestamps have micro-second precision. Are we expecting tabelspace to be created, wal logged, streamed, and replayed on mirror in micro-second ?

Clock skew is another reason to doubt that timestamp == unique identifier,
which is essentially what you're assuming here.

On same machine is what we care about generating uniqueness. Different machines the problem doesn't exist anyways, so doesn't matter clock is skewed or not.
 

Even if we fixed that, the general idea of including a quasi-random
component in the directory name seems like it would have a lot of
unpleasant side effects in terms of reproduceability, testability, etc.

Hmm.. aren't to some degree we currently as well create directories/files with quasi-random numbers like tablespace-oids, database-oids and relfilenodes, etc..

To generate uniqueness for the path between primary and standby need to use something which is not represented within database. So will be random to some degree. Like one can use PORT number of postmaster. As only need to generate unique path while creating link during CREATE TABLESPACE.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Performance regression with PostgreSQL 11 and partitioning
Next
From: Joe Conway
Date:
Subject: Re: Redesigning the executor (async, JIT, memory efficiency)