Re: Helper functions for wait_for_catchup() in Cluster.pm

Поиск
Список
Период
Сортировка
От Drouvot, Bertrand
Тема Re: Helper functions for wait_for_catchup() in Cluster.pm
Дата
Msg-id 606daf52-fcc8-bc5e-6e7a-75d9f7c29532@gmail.com
обсуждение исходный текст
Ответ на Re: Helper functions for wait_for_catchup() in Cluster.pm  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: Helper functions for wait_for_catchup() in Cluster.pm  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Hi,

On 1/24/23 7:27 PM, Alvaro Herrera wrote:
> Looking again, I have two thoughts for making things easier:
> 
> 1. I don't think wait_for_write_catchup is necessary, because
> calling wait_for_catchup() and omitting the 'mode' and 'lsn' arguments
> would already do the same thing.  So what we should do is patch places
> that currently give those two arguments, so that they don't.
> 

Agree but there is one place where the node passed as the second argument is not the "$self":

src/bin/pg_rewind/t/007_standby_source.pl:$node_b->wait_for_write_catchup('node_c', $node_a);

So it looks like there is still a need for wait_for_write_catchup().

> 2. Because wait_for_replay_catchup is an instance method, passing the
> second node as argument is needlessly noisy, because that's already
> known as $self.  So we can just say
> 
>    $primary_node->wait_for_replay_catchup($standby_node);
> 

Yeah, but same here, there is places where the node passed as the second argument is not the "$self":

src/bin/pg_rewind/t/007_standby_source.pl:$node_b->wait_for_replay_catchup('node_c', $node_a);
src/test/recovery/t/001_stream_rep.pl:$node_standby_1->wait_for_replay_catchup($node_standby_2, $node_primary);
src/test/recovery/t/001_stream_rep.pl:$node_standby_1->wait_for_replay_catchup($node_standby_2, $node_primary);
src/test/recovery/t/001_stream_rep.pl:  $node_standby_1->wait_for_replay_catchup($node_standby_2, $node_primary);

So it looks like there is still a need for wait_for_replay_catchup() with 2 parameters.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: meson oddities
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Helper functions for wait_for_catchup() in Cluster.pm