Re: Improve error handling for invalid slots and ensure a same 'inactive_since' time for inactive slots - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Improve error handling for invalid slots and ensure a same 'inactive_since' time for inactive slots
Date
Msg-id CAA4eK1+6EAWVVots5s2LyMCSGJk2A0q4yoxd-No4wops+KRp2Q@mail.gmail.com
Whole thread Raw
In response to Re: Improve error handling for invalid slots and ensure a same 'inactive_since' time for inactive slots  (Peter Smith <smithpb2250@gmail.com>)
List pgsql-hackers
On Thu, Jan 30, 2025 at 5:23 AM Peter Smith <smithpb2250@gmail.com> wrote:
>
> My understanding was that the purpose of this patch was not anything
> to do with "optimisations" per se, but rather it was (like the
> $SUBJECT says) to ensure the *same* 'active_since' timestamp value
> gets assigned.
>
> E.g the change to RestoreSlotFromDisk() was to prevent multiple slots
> from all getting assigned different 'active_since' values that differ
> by only 1 or 2 milliseconds because that would look strange to anyone
> inspecting those 'active_since' values.
>

I see your point but not sure whether it will matter in practice
unless the number of slots is large. I feel the second patch discussed
here is a clear improvement as it helps centralize the logic to give
ERRORs for invalid slots. This is useful especially when we are
thinking of adding more reasons for slot invalidation. So, we should
put our energy into getting the 0002 patch proposed here committed and
the related patch to add a new reason for slot invalidation.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: Index AM API cleanup
Next
From: Peter Smith
Date:
Subject: Re: Skip collecting decoded changes of already-aborted transactions