1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +03:00

Add wait_for_replay_catchup wrapper to Cluster.pm

This simplifies a few lines of Perl test code a bit.

Author: Bertrand Drouvot
Discussion: https://postgr.es/m/846724b5-0723-f4c2-8b13-75301ec7509e@gmail.com
This commit is contained in:
Alvaro Herrera
2023-02-13 11:52:19 +01:00
parent ec5a010ab2
commit a1acdacada
8 changed files with 51 additions and 51 deletions

View File

@@ -2711,6 +2711,29 @@ sub wait_for_catchup
=pod
=item $node->wait_for_replay_catchup($standby_name [, $base_node ])
Wait for the replication connection with application_name I<$standby_name>
until its B<replay> replication column in pg_stat_replication in I<$node>
equals or passes the I<$base_node>'s B<replay_lsn>. If I<$base_node> is
omitted, the LSN to wait for is obtained from I<$node>.
The replication connection must be in a streaming state.
Requires that the 'postgres' db exists and is accessible.
This is not a test. It die()s on failure.
=cut
sub wait_for_replay_catchup
{
my ($self, $standby_name, $node) = @_;
$node = defined($node) ? $node : $self;
$self->wait_for_catchup($standby_name, 'replay', $node->lsn('flush'));
}
=item $node->wait_for_slot_catchup(slot_name, mode, target_lsn)
Wait for the named replication slot to equal or pass the supplied target_lsn.