Re: Bug with pg_basebackup and 'shared' tablespace

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: robertmhaas(at)gmail(dot)com
Cc: michael(dot)paquier(at)gmail(dot)com, pierre(dot)ducroquet(at)people-doc(dot)com, pgsql-hackers(at)postgresql(dot)org, daniel(at)yesql(dot)se, magnus(at)hagander(dot)net
Subject: Re: Bug with pg_basebackup and 'shared' tablespace
Date: 2017-10-02 01:28:27
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thanks for the objection with clear reasoning.

For clarity, I first proposed to prohibit servers of different
versions from sharing same tablespace directory.

And I had -1 that it is just a reverting to the previous behavior
(it was exactly the patch intended, though) and persuaded to take
the way in this thread there, so I'm here.

At Fri, 29 Sep 2017 13:43:22 -0400, Robert Haas <robertmhaas(at)gmail(dot)com> wrote in <CA+TgmoYqOQOn_jwgC9V+w+5HfGH7Te5_FnCk3qvA4HzZ0UG0Pw(at)mail(dot)gmail(dot)com>
> On Fri, Sep 29, 2017 at 2:06 AM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
> > My tendency about this patch is still that it should be rejected. This
> > is presenting additional handling for no real gain.
> I vehemently disagree. If the server lets you create a tablespace,
> then everything that happens after that ought to work.
> On another thread, there is the issue that if you create a tablespace
> inside $PGDATA, things break. We should either unbreak those things

pg_basebackup copies the tablespace twice, or some maintenaince
commands give a wrong result, or careless cleanup script can blow
away a part of the data.

> or not allow creating the tablespace in the first place. On this
> thread, there is the issue that if you create two tablespaces for
> different PG versions in the same directory, things break. We should

Server never accesses out of <tblspace>/CARVER/ directory in the
<tblspace> and servers with different versoins can share the
<tblspace> directory (I think this is a bug). pg_upgrade will
complain if it finds the destination CATVER directory created
even though no data will be broken.

Just a clarification, not "fixing" the problem, users may get
punished by pg_basebackup later. If "fixing" in this way,
pg_basebacup will work in the case but in turn pg_upgrade may
punish them later. May I assume that we agree on this point?

> either unbreak those things or not allow creating the tablespace in
> the first place.
> It is completely awful behavior to let users do things and then punish
> them later for having done them. Users are not obliged to read the
> minds of the developers and guess what things the developers consider
> "reasonable". They should be able to count on the principle that if
> they do something that we consider wrong, they'll get an error when
> they try to do it -- not have it superficially appear to work and then
> explode later.
> To put that another way, there should be ONE rule about what is or is
> not allowable in a particular situation, and all commands, utilities,
> etc. that deal with that situation should handle it in a uniform
> fashion. Each .c file shouldn't get to make up its own notion of what
> is or is not supported.

Anyway currently server and pg_basebackup disagrees on the
point. If the "just reverting" patch above is not rejected again,
I'll resume working on it. Or other way to go? This is not an
issue that ought to take a long time.


Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-10-02 01:32:40 Re: pg_prepared_xact_status
Previous Message Amit Langote 2017-10-02 01:13:17 Re: path toward faster partition pruning