mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
pg_upgrade: Run test suite with initial OID higher than UINT32_MAX
The test already used a pg_resetwal to bump the initial OID to be higher than UINT32_MAX after the main regression test suite has been run, to check that pg_upgrade was able to carry an 8-byte wide value. This now happens set much earlier in the script, before running the main regression test suite. A small oid8-related check is added, while on it. Perhaps this could be expanded to more objects and/or patterns later on. It should be good enough as a starting point. Author: Michael Paquier <michael@paquier.xyz> Reviewed-by: Greg Burd <greg@burd.me> Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Discussion: https://postgr.es/m/aqd_gYs35v--sVlR@paquier.xyz
This commit is contained in:
@@ -229,6 +229,21 @@ $oldnode->append_conf('postgresql.conf', 'log_statement = none');
|
||||
# Set wal_level = replica to run the regression tests in the same
|
||||
# wal_level as when 'make check' runs.
|
||||
$oldnode->append_conf('postgresql.conf', 'wal_level = replica');
|
||||
|
||||
# The OID counter is 8 bytes wide, check that it is carried across the
|
||||
# test. Older versions may not support 8-byte OIDs, so skip in this case.
|
||||
my $big_next_oid = '4295067296'; # 2^32 + 100000
|
||||
if (!defined($ENV{oldinstall}))
|
||||
{
|
||||
command_ok(
|
||||
[
|
||||
'pg_resetwal',
|
||||
'--next-oid' => $big_next_oid,
|
||||
$oldnode->data_dir
|
||||
],
|
||||
'set an 8-byte OID counter in the old instance');
|
||||
}
|
||||
|
||||
$oldnode->start;
|
||||
|
||||
my $result;
|
||||
@@ -296,6 +311,19 @@ else
|
||||
'regression tests in old instance');
|
||||
}
|
||||
|
||||
# Checks for 8-byte OIDs
|
||||
if (!defined($ENV{olddump}))
|
||||
{
|
||||
# Table with 8-byte OID values, past 2^32. toasttest_oid8 is
|
||||
# defined in strings.sql.
|
||||
is( $oldnode->safe_psql(
|
||||
'regression',
|
||||
"SELECT max(pg_column_toast_chunk_id(f1)) > '$big_next_oid'::oid8 FROM toasttest_oid8"
|
||||
),
|
||||
't',
|
||||
'oid8 chunk_ids are past 2^32');
|
||||
}
|
||||
|
||||
# Initialize a new node for the upgrade.
|
||||
my $newnode = PostgreSQL::Test::Cluster->new('new_node');
|
||||
|
||||
@@ -588,20 +616,6 @@ $oldnode->start;
|
||||
$oldnode->safe_psql('postgres', 'DROP DATABASE regression_invalid');
|
||||
$oldnode->stop;
|
||||
|
||||
# The OID counter is 8 bytes wide, check that it is carried. Older versions
|
||||
# may not support 8-byte OIDs, so skip in this case.
|
||||
my $big_next_oid = '4295067296'; # 2^32 + 100000
|
||||
if (!defined($ENV{oldinstall}))
|
||||
{
|
||||
command_ok(
|
||||
[
|
||||
'pg_resetwal',
|
||||
'--next-oid' => $big_next_oid,
|
||||
$oldnode->data_dir
|
||||
],
|
||||
'set an 8-byte OID counter in the old instance');
|
||||
}
|
||||
|
||||
# --check command works here, cleans up pg_upgrade_output.d.
|
||||
command_ok(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user