Re: test: avoid redundant standby catchup in 049_wait_for_lsn

Xuneng Zhou <xunengzhou@gmail.com>

From: Xuneng Zhou <xunengzhou@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@lists.postgresql.org>, Alexander Korotkov <aekorotkov@gmail.com>
Date: 2026-04-18T04:19:50Z
Lists: pgsql-hackers
Hi Michael,


On Fri, Apr 17, 2026 at 08:25:35PM +0800, Xuneng Zhou wrote:
> > The change preserves the same coverage while removing one redundant
> > replay catch-up on the delayed standby. It appears to reduce the test
> > runtime by about 7 seconds, though I have looked into why much of the
> > improvement comes from this change alone.
>
> Alexander may think differently and remove that, but I disagree.  The
> test is clearly written so as we want two wait checks to happen, for
> for CREATE FUNCTION, and one for CREATE PROCEDURE.  Removing the first
> check to keep only the second one removes its meaning.  In short, I
> see nothing wrong to deal with here.
>

Thank you for the review. I agree that the two wait checks serve distinct
purposes and are not redundant. The main motivation for this patch was
efficiency. In my testing, the new test added approximately 7 seconds to
the runtime, while the creation of the procedure and function completed
quickly. I suspect the latency stems from the wait-for-catch-up step. When
I removed it, the test runtime dropped by about 7 seconds.I haven't yet
investigated why the wait is so costly in this case. I should probably look
into that before proposing this change.

Best,
Xuneng

>

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. 049_wait_for_lsn.pl: create function and procedure at once