Re: Remove extraneous break condition in logical slot advance function - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Re: Remove extraneous break condition in logical slot advance function
Date
Msg-id CABwTF4X0c97t0PP+A7iTY5JfM76TYa0FUqrGZo1F5ZJomv-48g@mail.gmail.com
Whole thread Raw
In response to Remove extraneous break condition in logical slot advance function  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Remove extraneous break condition in logical slot advance function  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Oct 20, 2023 at 7:30 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> Hi,
>
> There exists an extraneous break condition in
> pg_logical_replication_slot_advance(). When the end of WAL or moveto
> LSN is reached, the main while condition helps to exit the loop, so no
> separate break condition is needed. Attached patch removes it.
>
> Thoughts?

+1 for the patch.

The only advantage I see of the code as it stands right now is that it
avoids one last call to CHECK_FOR_INTERRUPTS() by break'ing early. I
don't think we'd lose much in terms of performance by making one (very
cheap, in common case) extra call of this macro.

Best regards,
Gurjeet
http://Gurje.et



pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Custom explain options
Next
From: Tom Lane
Date:
Subject: Re: Remove extraneous break condition in logical slot advance function