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

Commitc71c702

Browse files
committed
Improve the stability of the recovery test 047_checkpoint_physical_slot
Currently, the comments in 047_checkpoint_physical_slot. It shows anincomplete intention to wait for checkpoint completion before performingan immediate database stop. However, an immediate node stop can occur bothbefore and after checkpoint completion. Both cases should work correctly.But we would like the test to be more stable and deterministic. This is whythis commit makes this test explicitly wait for the checkpoint completionlog message.Discussion:https://postgr.es/m/CAPpHfdurV-j_e0pb%3DUFENAy3tyzxfF%2ByHveNDNQk2gM82WBU5A%40mail.gmail.comDiscussion:https://postgr.es/m/aHXLep3OaX_vRTNQ%40paquier.xyzAuthor: Alexander Korotkov <akorotkov@postgresql.org>Reviewed-by: Michael Paquier <michael@paquier.xyz>Backpatch-through: 17
1 parent5449d5b commitc71c702

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/test/recovery/t/047_checkpoint_physical_slot.pl‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,19 @@
9494
q{select pg_replication_slot_advance('slot_physical', pg_current_wal_lsn())}
9595
);
9696

97-
# Continue the checkpoint.
97+
# Continue the checkpoint and wait for its completion.
98+
my$log_offset =-s$node->logfile;
9899
$node->safe_psql('postgres',
99100
q{select injection_points_wakeup('checkpoint-before-old-wal-removal')});
101+
$node->wait_for_log(qr/checkpoint complete/,$log_offset);
100102

101103
my$restart_lsn_old =$node->safe_psql('postgres',
102104
q{select restart_lsn from pg_replication_slots where slot_name = 'slot_physical'}
103105
);
104106
chomp($restart_lsn_old);
105107
note("restart lsn before stop:$restart_lsn_old");
106108

107-
# Abruptly stop the server (1 second should be enough for the checkpoint
108-
# to finish; it would be better).
109+
# Abruptly stop the server.
109110
$node->stop('immediate');
110111

111112
$node->start;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp