Re: Minimal logical decoding on standbys - Mailing list pgsql-hackers

From Drouvot, Bertrand
Subject Re: Minimal logical decoding on standbys
Date
Msg-id 513952f7-e8d5-4bdf-f8b3-002b1264badf@gmail.com
Whole thread Raw
In response to Re: Minimal logical decoding on standbys  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Minimal logical decoding on standbys
Re: Minimal logical decoding on standbys
Re: Minimal logical decoding on standbys
List pgsql-hackers
Hi,

On 4/4/23 7:57 AM, Amit Kapila wrote:
> On Mon, Apr 3, 2023 at 8:51 PM Drouvot, Bertrand
> <bertranddrouvot.pg@gmail.com> wrote:
>>
>> I made it as simple as:
>>
>>           /*
>>            * If the slot is already invalid or is a non conflicting slot, we don't
>>            * need to do anything.
>>            */
>>           islogical = xid ? true : false;
>>
>>           if (SlotIsInvalid(s, islogical) || SlotIsNotConflicting(s, islogical, xid, &oldestLSN))
>>
>> in V56 attached.
>>
> 
> Here the variable 'islogical' doesn't seem to convey its actual
> meaning because one can imagine that it indicates whether the slot is
> logical which I don't think is the actual intent.

Good point. Just renamed it to 'check_on_xid' (as still needed outside of
the "CanInvalidateSlot" context) in V58 attached.

> One idea to simplify
> this is to introduce a single function CanInvalidateSlot() or
> something like that and move the logic from both the functions
> SlotIsInvalid() and SlotIsNotConflicting() into the new function.
> 

Oh right, even better, thanks!
Done in V58 and now this is as simple as:

+               if (DoNotInvalidateSlot(s, xid, &oldestLSN))
                 {
                         /* then, we are not forcing for invalidation */


Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Should vacuum process config file reload more often
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: Minimal logical decoding on standbys