Skip to content

Commit 2520226

Browse files
committed
Ensure standby promotion point in 043_wal_replay_wait.pl
This commit ensures standby will be promoted at least at the primary insert LSN we have just observed. We use pg_switch_wal() to force the insert LSN to be written then wait for standby to catchup. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/1d7b08f2-64a2-77fb-c666-c9a74c68eeda%40gmail.com
1 parent 85b98b8 commit 2520226

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/recovery/t/043_wal_replay_wait.pl

+6
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@
177177
CALL pg_wal_replay_wait('${lsn4}');
178178
]);
179179

180+
# Make sure standby will be promoted at least at the primary insert LSN we
181+
# have just observed. Use pg_switch_wal() to force the insert LSN to be
182+
# written then wait for standby to catchup.
183+
$node_primary->safe_psql('postgres', 'SELECT pg_switch_wal();');
184+
$node_primary->wait_for_catchup($node_standby);
185+
180186
$log_offset = -s $node_standby->logfile;
181187
$node_standby->promote;
182188
$node_standby->wait_for_log('recovery is not in progress', $log_offset);

0 commit comments

Comments
 (0)