> On 18 Sep 2026, at 15:47, Nazir Bilal Yavuz <[email protected]> wrote:
> On Fri, 18 Sept 2026 at 15:51, Daniel Gustafsson <[email protected]> wrote:
>> In these cases, couldn't we just wait for the replay LSN, ie the default for
>> wait_for_catchup?
>
> Sorry, I am a bit confused. AFAIU, you meant:
>
> $node_a->wait_for_catchup($node_b);
>
> which is
>
> $node_a->wait_for_catchup($node_b, 'replay', $node_a->lsn('write'));
>
> If that is the case, could we still need to wait for an additional
> primary-side flush, since written WAL might not have been flushed yet?
> I understand that this might not cause the same long delay as waiting
> for the insert LSN. On my local, ->lsn('write') and ->lsn('flush') are
> basically same, they both take ~3 seconds.
I don't see how the test could do that given the sequence of commands in the
TAP file. At the end of the day, it's not super important though.
> My idea was that since the WAL needed by the tests has already been
> flushed, I thought that would be enough for the tests. Also, is using
> ->lsn('write') considered better for these cases or do you recommend
> it because of the simplicity?
I prefer when tests have the least amount of special needs setup outside of the
code under test. This isn't really making assumptions which make the test
synthetic though.
Another option for going with your patch is to use wait_for_replay_catchup
which should accomplish the same.
--
Daniel Gustafsson