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

Commitef585de

Browse files
committed
Fix two-phase commit test for recovery mode
The original code had a race condition because it never ensured thestandby was caught up before proceeding; add a wait similar to everyother place that does this.Author: Michaël PaquierDiscussion:https://postgr.es/m/CAB7nPqTm9p+LCm1mVJYvgpwagRK+uibT-pKq0O2-paOWxT62jw@mail.gmail.com
1 parentf15b76a commitef585de

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/test/recovery/t/009_twophase.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,14 @@ sub configure_and_reload
331331
CHECKPOINT;
332332
COMMIT PREPARED 'xact_009_13';");
333333

334+
# Ensure that last transaction is replayed on standby.
335+
my$cur_master_lsn =
336+
$cur_master->safe_psql('postgres',"SELECT pg_current_wal_lsn()");
337+
my$caughtup_query =
338+
"SELECT '$cur_master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()";
339+
$cur_standby->poll_query_until('postgres',$caughtup_query)
340+
ordie"Timed out while waiting for standby to catch up";
341+
334342
$cur_standby->psql(
335343
'postgres',
336344
"SELECT count(*) FROM t_009_tbl2",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp