RE: pg_upgrade: Make testing different transfer modes easier

From: "Shinoda, Noriyoshi (PN Japan FSIP)" <noriyoshi(dot)shinoda(at)hpe(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: pg_upgrade: Make testing different transfer modes easier
Date: 2022-12-19 00:39:28
Message-ID: DM4PR84MB173410786F874DC6914F44D9EEE59@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
With the addition of --copy option, pg_upgrade now has three possible transfer mode options. Currently, an error does not occur even if multiple transfer modes are specified. For example, we can also run "pg_upgrade --link --copy --clone" command. As discussed in Horiguchi-san's previous email, options like "--mode=link|copy|clone" can prevent this problem.
The attached patch uses the current implementation and performs a minimum check to prevent multiple transfer modes from being specified.

Regards,
Noriyoshi Shinoda
-----Original Message-----
From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Sent: Saturday, December 17, 2022 2:44 AM
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade: Make testing different transfer modes easier

On 14.12.22 10:40, Daniel Gustafsson wrote:
>> On 14 Dec 2022, at 08:04, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:
>>
>> On 07.12.22 17:33, Peter Eisentraut wrote:
>>> I think if we want to make this configurable on the fly, and environment variable would be much easier, like
>>> my $mode = $ENV{PG_TEST_PG_UPGRADE_MODE} || '--copy';
>>
>> Here is an updated patch set that incorporates this idea.
>
> I would prefer a small note about it in src/bin/pg_upgrade/TESTING to
> document it outside of the code, but otherwise LGTM.
>
> + $mode,
> '--check'
> ],
>
> ...
>
> - '-p', $oldnode->port, '-P', $newnode->port
> + '-p', $oldnode->port, '-P', $newnode->port,
> + $mode,
> ],
>
> Minor nitpick, but while in there should we take the opportunity to
> add a trailing comma on the other two array declarations which now ends with --check?
> It's good Perl practice and will make the code consistent.

committed with these changes

Attachment Content-Type Size
pg_upgrade_check_mode_v1.diff application/octet-stream 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anton A. Melnikov 2022-12-19 00:50:19 [BUG] pg_upgrade test fails from older versions.
Previous Message Nathan Bossart 2022-12-19 00:31:35 Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX