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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Regression test PANICs with master-standby setup on same machine
Date: 2019-04-23 17:05:03
Message-ID: 20190423170503.uw5jxrujqlozg23l@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-04-23 16:08:18 +0900, Michael Paquier wrote:
> 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.

I don't see the problem here. Putting the primary and standby PGDATAs
into a subdirectory that also can contain a relatively referenced
tablespace seems trivial?

> I'm not 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? -- Michael

I mostly am talking about replacing

Oid
CreateTableSpace(CreateTableSpaceStmt *stmt)
{
...
/*
* Allowing relative paths seems risky
*
* this also helps us ensure that location is not empty or whitespace
*/
if (!is_absolute_path(location))
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("tablespace location must be an absolute path")));

with a check that forces relative paths to be outside of PGDATA (baring
symlinks). As far as I can tell convert_and_check_filename() would check
just about the opposite.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-04-23 17:09:39 Re: finding changed blocks using WAL scanning
Previous Message Tomas Vondra 2019-04-23 17:01:29 Re: finding changed blocks using WAL scanning