Re: [PATCH] Fix pg_upgrade test from v10

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Anton A(dot) Melnikov" <aamelnikov(at)inbox(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Fix pg_upgrade test from v10
Date: 2022-06-02 01:37:51
Message-ID: YpgUbzAOIvpdI57b@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 02, 2022 at 04:22:52AM +0300, Anton A. Melnikov wrote:
> Found out that test for pg_upgrade (test.sh for 11-14 and 002_pg_upgrade.pl
> for 15+) doesn't work from 10th versions to higher ones due to incompatible
> options for initdb and default PGDATA permissions.

Yeah, there are still TODOs in this stuff. Those tests can also break
easily depending on the dump you are pushing to the old node when
doing cross-version upgrades. Perl makes it a bit easier to reason
about improving this area in the future, though, and MSVC is able to
catch up on that.

> # To increase coverage of non-standard segment size and group access without
> # increasing test runtime, run these tests with a custom setting.
> # --allow-group-access and --wal-segsize have been added in v11.
> -$oldnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ]);
> +my ($oldverstr) = `$ENV{oldinstall}/bin/pg_ctl --version` =~ /(\d+\.\d+)/;
> +my ($oldver) = (version->parse(${oldverstr}));
> +$oldnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ])
> + if $oldver >= version->parse('11.0');
> +$oldnode->init()
> + if $oldver < version->parse('11.0');

A node's pg_version is assigned via _set_pg_version() when creating it
using PostgreSQL::Test::Cluster::new(). In order to make the
difference with the set of initdb options to use when setting up the
old node, it would be simpler to rely on that, no? Version.pm is able
to handle integer as well as string comparisons for the version
strings.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-06-02 02:42:44 compiler warnings with gcc 4.8 and -Og
Previous Message Amit Langote 2022-06-02 01:23:00 Re: doc: CREATE FOREIGN TABLE .. PARTITION OF .. DEFAULT