Re: Regression test PANICs with master-standby setup on same machine

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: michael(at)paquier(dot)xyz
Cc: andres(at)anarazel(dot)de, kuntalghosh(dot)2007(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Regression test PANICs with master-standby setup on same machine
Date: 2019-04-23 10:00:54
Message-ID: 20190423.190054.262966274.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 23 Apr 2019 17:44:18 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20190423(dot)174418(dot)262292011(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
> At Tue, 23 Apr 2019 16:08:18 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in <20190423070818(dot)GM2712(at)paquier(dot)xyz>
> > On Mon, Apr 22, 2019 at 11:00:03PM -0700, Andres Freund wrote:
> > > FWIW, I think the right fix for this is to simply drop the requirement
> > > that tablespace paths need to be absolute. It's not buying us anything,
> > > it's just making things more complicated. We should just do a simple
> > > check against the tablespace being inside PGDATA, and leave it at
> > > that. Yes, that can be tricked, but so can the current system.
> >
> > convert_and_check_filename() checks after that already, mostly. For
> > TAP tests I am not sure that this would help much though as all the
> > nodes of a given test use the same root path for their data folders,
> > so you cannot just use "../hoge/" as location. We already generate a
> > warning when a tablespace is in a data folder, as this causes issues
> > with recursion lookups of base backups. What do you mean in this
> > case? Forbidding the behavior?
>
> Isn't it good enough just warning when we see pg_tblspc twice
> while scanning? The check is not perfect for an "abosolute path"
> that continas '/./' above pgdata directory.

I don't get basebackup recurse. How can I do that? basebackup
rejects non-empty direcoty as a tablespace directory. I'm not
sure about pg_upgrade but it's not a problem as far as we keep
waning on that kind of tablespace directory.

So I propose this:

- Allow relative path as a tablespace direcotry in exchange for
issueing WARNING.

=# CREATE TABLESPACE ts1 LOCATION '../../hoge';
"WARNING: tablespace location should be in absolute path"

- For abosolute paths, we keep warning as before. Of course we
don't bother '.' and '..'.

=# CREATE TABLESPACE ts1 LOCATION '/home/.../data';
"WARNING: tablespace location should not be in the data directory"

> For TAP tests, we can point generated temporary directory by
> "../../<tmpdirsname>".

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-04-23 10:16:17 Re: Unhappy about API changes in the no-fsm-for-small-rels patch
Previous Message Daniel Verite 2019-04-23 09:46:44 Re: Trouble with FETCH_COUNT and combined queries in psql