Re: Test to dump and restore objects left behind by regression
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Michael Paquier <michael@paquier.xyz>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2024-12-31T11:54:44Z
Lists: pgsql-hackers
Attachments
- 0001-Test-pg_dump-restore-of-regression-objects-20241231.patch (text/x-patch) patch 0001
- 0002-Don-t-run-the-test-when-testing-cross-versi-20241231.patch (text/x-patch) patch 0002
On Fri, Dec 27, 2024 at 6:17 PM Daniel Gustafsson <daniel@yesql.se> wrote:
>
> > On 20 Dec 2024, at 11:01, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
> > On Wed, Dec 18, 2024 at 7:39 PM Daniel Gustafsson <daniel@yesql.se> wrote:
> >>
> >>> On 18 Dec 2024, at 12:28, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
>
> >> + if ( $ENV{PG_TEST_EXTRA}
> >> + && $ENV{PG_TEST_EXTRA} =~ /\bregress_dump_test\b/)
> >> Should this also test that $oldnode and $newnode have matching pg_version to
> >> keep this from running in a cross-version upgrade test? While it can be argued
> >> that running this in a cross-version upgrade is breaking it and getting to keep
> >> both pieces, it's also not ideal to run a resource intensive test we know will
> >> fail. (It can't be done at this exact callsite, just picked to illustrate.)
> >
> > You already wrote it in parenthesis. At the exact callsite $oldnode
> > and $newnode can not be of different versions. In fact newnode is yet
> > to be created at this point. But $oldnode has the same version as the
> > server run from the code. In a cross-version upgrade this test will
> > not be executed. I am confused as to what this comment is about.
>
> Sure, it can't be checked until $newnode is created, but it seems like a cheap
> test to ensure it's not executed as part of someones cross-version tests.
Hmm. The new node is always the node created with the version of code.
It's the old node which may have a different version. Hence I added
code to compare the versions of source node (which is the oldnode) and
destination node (which is created the same way as the new node and
hence has the same version as the new node) in
test_regression_dump_restore() itself. Additionally the code makes
sure that the oldnode doesn't use a custom install path. This is 0002
patch. 0001 in this patchset is 0001 + 0002 in the earlier patch set.
--
Best Wishes,
Ashutosh Bapat
Commits
-
Hide expensive pg_upgrade test behind PG_TEST_EXTRA
- d185161e4739 18.0 landed
- 37fc1803cc12 19 (unreleased) landed
-
Set log_statement=none in t/002_pg_upgrade.pl
- 64fba9c61787 18.0 landed
-
002_pg_upgrade.pl: Move pg_dump test code for better stability
- 8806e4e8deb1 18.0 landed
-
002_pg_upgrade.pl: rename some variables for clarity
- abe56227b2e2 18.0 landed
-
Verify roundtrip dump/restore of regression database
- 172259afb563 18.0 landed
-
Refactor TAP test code for file comparisons into new routine in Utils.pm
- 169208092f5c 18.0 landed
-
Virtual generated columns
- 83ea6c54025b 18.0 cited
-
Put generated_stored test objects in a schema
- 894be11adfa6 18.0 cited
-
Introduce "builtin" collation provider.
- 2d819a08a1cb 17.0 cited
-
Revert "Improve compression and storage support with inheritance"
- 74563f6b9021 17.0 cited