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

Commit0d2cb6b

Browse files
committed
Make new replication slot test code even less racy
Further fix the test code inead9e51, this time by waiting untilthe checkpoint has completed before moving on; this ensures that theWAL segment removal has already happened when we create the next slot.Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Discussion:https://postgr.es/m/20210719.111318.2042379313472032754.horikyota.ntt@gmail.com
1 parent344dedf commit0d2cb6b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎src/test/recovery/t/019_replslot_limit.pl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use PostgresNode;
1212

1313
use File::Pathqw(rmtree);
14-
use Test::Moretests=>$TestLib::windows_os ?15 :19;
14+
use Test::Moretests=>$TestLib::windows_os ?16 :20;
1515
use Time::HiResqw(usleep);
1616

1717
$ENV{PGDATABASE} ='postgres';
@@ -201,6 +201,19 @@
201201
is($result,"rep1|f|t|lost|",
202202
'check that the slot became inactive and the state "lost" persists');
203203

204+
# Wait until current checkpoint ends
205+
my$checkpoint_ended = 0;
206+
for (my$i = 0;$i < 10000;$i++)
207+
{
208+
if (find_in_log($node_primary,"checkpoint complete:",$logstart))
209+
{
210+
$checkpoint_ended = 1;
211+
last;
212+
}
213+
usleep(100_000);
214+
}
215+
ok($checkpoint_ended,'waited for checkpoint to end');
216+
204217
# The invalidated slot shouldn't keep the old-segment horizon back;
205218
# see bug #17103: https://postgr.es/m/17103-004130e8f27782c9@postgresql.org
206219
# Test for this by creating a new slot and comparing its restart LSN

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp