public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alvaro Herrera <[email protected]>
To: Drouvot, Bertrand <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Helper functions for wait_for_catchup() in Cluster.pm
Date: Thu, 26 Jan 2023 10:42:41 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 2023-Jan-26, Drouvot, Bertrand wrote:

> On 1/24/23 7:27 PM, Alvaro Herrera wrote:

> > 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().

Hmm, I think that one can use the more general wait_for_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.

Ah, cascading replication.  In that case, let's make the second
parameter optional.  If it's not given, $self is used.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"En las profundidades de nuestro inconsciente hay una obsesiva necesidad
de un universo lógico y coherente. Pero el universo real se halla siempre
un paso más allá de la lógica" (Irulan)






view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Helper functions for wait_for_catchup() in Cluster.pm
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox