Re: pg_upgrade fails with in-place tablespace

From: "Rui Zhao" <xiyuan(dot)zr(at)alibaba-inc(dot)com>
To: "Michael Paquier" <michael(at)paquier(dot)xyz>
Cc: "pgsql-hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_upgrade fails with in-place tablespace
Date: 2023-08-19 12:11:28
Message-ID: 11bd25e8-a16a-411d-bc24-47d117a39efa.xiyuan.zr@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Aug 19, 2023 at 12:45 PM +0800, Michael Paquier wrote:
> I am not sure to follow the meaning of this logic. There could be
> in-place tablespaces that got created with the GUC enabled during a
> session, while the GUC has disabled the GUC. Shouldn't this stuff be
> more restrictive and not require a lookup at the GUC, only looking at
> the paths returned by pg_tablespace_location()?
There are two cases when we check in-place tablespaces:
1. The GUC allow_in_place_tablespaces is turned on in the old node.
In this case, we assume that the caller is aware of what he is doing
and allow the check to pass.
2. The GUC allow_in_place_tablespaces is turned off in the old node.
In this case, we will fail the check if we find any in-place tablespaces.
However, we provide an option to pass the check by adding
--old-options="-c allow_in_place_tablespaces=on" in pg_upgrade.
This option will turn on allow_in_place_tablespaces like GUC does.
So I lookup at the GUC and check if it is turned on.
We add this check of in-place tablespaces, to deal with the situation
where one would want to be warned if these are in-place tablespaces
when doing upgrades. I think we can take it a step further by providing
an option that allows the check to pass if the caller explicitly adds
--old-options="-c allow_in_place_tablespaces=on".
Please refer to the TAP test I have included for a better understanding
of my suggestion.
--
Best regards,
Rui Zhao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2023-08-19 16:30:12 Re: WIP: new system catalog pg_wait_event
Previous Message Zhang Mingli 2023-08-19 11:36:48 Re: Fix typo in src/interfaces/libpq/po/zh_CN.po