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

Commit6078770

Browse files
committed
In tests, await an LSN no later than the recovery target.
Otherwise, the test fails with "Timed out while waiting for standby tocatch up". This happened rarely, perhaps only when autovacuum wrote WALbetween our choosing the recovery target and choosing the LSN to await.Commitb26f7fa fixed one case of this.Fix two more. Back-patch to 9.6, which introduced the affected test.Discussion:https://postgr.es/m/20180101055227.GA2952815@rfd.leadboat.com
1 parent3e724aa commit6078770

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

‎src/test/recovery/t/003_recovery_targets.pl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
use TestLib;
66
use Test::Moretests=> 9;
77

8-
# Create and test a standby from given backup, with a certain
9-
# recovery target.
8+
# Create and test a standby from given backup, with a certain recovery target.
9+
# Choose $until_lsn later than the transaction commit that causes the row
10+
# count to reach $num_rows, yet not later than the recovery target.
1011
subtest_recovery_standby
1112
{
1213
my$test_name =shift;
@@ -70,9 +71,9 @@ sub test_recovery_standby
7071
# More data, with recovery target timestamp
7172
$node_master->safe_psql('postgres',
7273
"INSERT INTO tab_int VALUES (generate_series(2001,3000))");
73-
$ret =
74-
$node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn(), now();");
75-
my($lsn3,$recovery_time) =split /\|/,$ret;
74+
my$lsn3 =
75+
$node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn();");
76+
my$recovery_time =$node_master->safe_psql('postgres', "SELECT now()");
7677
7778
# Even more data, this time with a recovery target name
7879
$node_master->safe_psql('postgres',
@@ -86,10 +87,8 @@ sub test_recovery_standby
8687
# And now for a recovery target LSN
8788
$node_master->safe_psql('postgres',
8889
"INSERT INTO tab_int VALUES (generate_series(4001,5000))");
89-
my$recovery_lsn =
90+
my$lsn5 = my$recovery_lsn =
9091
$node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn()");
91-
my$lsn5 =
92-
$node_master->safe_psql('postgres',"SELECT pg_current_wal_lsn();");
9392
9493
$node_master->safe_psql('postgres',
9594
"INSERT INTO tab_int VALUES (generate_series(5001,6000))");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp