Re: test: avoid redundant standby catchup in 049_wait_for_lsn - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: test: avoid redundant standby catchup in 049_wait_for_lsn
Date
Msg-id CAPpHfdvSgasQ3XeTAbA=cqH_BVY9pD6BVuXj+xEgyYGx2_nfEw@mail.gmail.com
Whole thread
In response to Re: test: avoid redundant standby catchup in 049_wait_for_lsn  (Xuneng Zhou <xunengzhou@gmail.com>)
Responses Re: test: avoid redundant standby catchup in 049_wait_for_lsn
List pgsql-hackers
Hi, Xuneng.

On Sat, Apr 18, 2026 at 7:20 AM Xuneng Zhou <xunengzhou@gmail.com> wrote:
>> 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
motivationfor this patch was efficiency. In my testing, the new test added approximately 7 seconds to the runtime,
whilethe creation of the procedure and function completed quickly. I suspect the latency stems from the
wait-for-catch-upstep. When I removed it, the test runtime dropped by about 7 seconds.I haven't yet investigated why
thewait is so costly in this case. I should probably look into that before proposing this change. 

On my laptop the time needed to run t/049_wait_for_lsn.pl also drops
from 20 secs to 12 secs.  The influence to the runtime of the whole
test suite in parallel would be not that big as CPU time only drops
from 2.16 sec to 2.07 sec.  But anyway that's pretty significant.
I've revised comment message a bit and surrounding comments.  I'm
going to push this if no objections.

------
Regards,
Alexander Korotkov
Supabase

Attachment

pgsql-hackers by date:

Previous
From: SATYANARAYANA NARLAPURAM
Date:
Subject: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references
Next
From: Alexander Korotkov
Date:
Subject: Re: test: avoid redundant standby catchup in 049_wait_for_lsn