Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a0ac68

Browse files
committed
Skip invalid database pg_upgrade test on obsolete servers
When testing pg_upgrade against an old server, ignore failures on thecheck to upgrade invalid databases. This is necessary because oldservers don't know to raise the appropriate error of the database beinginvalid.This change causes no reduction in coverage, because such old versionsdon't know to mark databases invalid when a drop is interrupted; buttesting against such old servers is useful in some circumstances.Backpatch to 16, where it cherry-picks with minimal conflicts.On 16, perltidy 20230309 chooses to change an unrelated line. I let itdo that because that's the version we document as preferred for thatbranch, even though it would make other changes to many other files inthe tree.Discussion:https://postgr.es/m/202404181539.lh42llaesnv3@alvherre.pgsql
1 parent9d36b88 commit5a0ac68

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

‎src/bin/pg_upgrade/t/002_pg_upgrade.pl

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ sub filter_dump
318318
}
319319

320320
# Create an invalid database, will be deleted below
321-
$oldnode->safe_psql('postgres',qq(
321+
$oldnode->safe_psql(
322+
'postgres',qq(
322323
CREATE DATABASE regression_invalid;
323324
UPDATE pg_database SET datconnlimit = -2 WHERE datname = 'regression_invalid';
324325
));
@@ -352,19 +353,31 @@ sub filter_dump
352353
rmtree($newnode->data_dir ."/pg_upgrade_output.d");
353354

354355
# Check that pg_upgrade aborts when encountering an invalid database
355-
command_checks_all(
356-
[
357-
'pg_upgrade','--no-sync','-d',$oldnode->data_dir,
358-
'-D',$newnode->data_dir,'-b',$oldbindir,
359-
'-B',$newbindir,'-s',$newnode->host,
360-
'-p',$oldnode->port,'-P',$newnode->port,
361-
$mode,'--check',
362-
],
363-
1,
364-
[qr/invalid/],# pg_upgrade prints errors on stdout :(
365-
[qr//],
366-
'invalid database causes failure');
367-
rmtree($newnode->data_dir ."/pg_upgrade_output.d");
356+
# (However, versions that were out of support by commit c66a7d75e652 don't
357+
# know how to do this, so skip this test there.)
358+
SKIP:
359+
{
360+
skip"database invalidation not implemented", 1
361+
if$oldnode->pg_version < 11;
362+
363+
command_checks_all(
364+
[
365+
'pg_upgrade','--no-sync',
366+
'-d',$oldnode->data_dir,
367+
'-D',$newnode->data_dir,
368+
'-b',$oldbindir,
369+
'-B',$newbindir,
370+
'-s',$newnode->host,
371+
'-p',$oldnode->port,
372+
'-P',$newnode->port,
373+
$mode,'--check',
374+
],
375+
1,
376+
[qr/invalid/],# pg_upgrade prints errors on stdout :(
377+
[qr/^$/],
378+
'invalid database causes failure');
379+
rmtree($newnode->data_dir ."/pg_upgrade_output.d");
380+
}
368381

369382
# And drop it, so we can continue
370383
$oldnode->start;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp