| From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
|---|---|
| To: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
| Cc: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Zhijie Hou <houzhijie22(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Assertion failure in update_local_synced_slot(), slotsync.c:364 |
| Date: | 2026-11-16 09:30:26 |
| Message-ID: | CAA4eK1K9HhSTCC0wV84mGkWa7h4dvucNBQoxz=dg0azTEsDUqw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, Nov 16, 2026 at 1:21 PM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> On Sun, Nov 15, 2026 at 10:35:57PM -0800, Masahiko Sawada wrote:
> >
> > I'm concerned that not only changes to this function but also changes
> > to its callers could break these assumptions, and nothing near those
> > places would tell us about them.
>
> Yeah, I agree with this concern. Looking at 788ec96d591, I think remote_slot_precedes
> was redundant with slotsync_skip_reason, but found_consistent_snapshot was not:
> slotsync_skip_reason reports why synchronization was skipped, while found_consistent_snapshot
> tells the caller whether the slot is safe to persist.
>
> v2 is correct with the current temporary slot caller, which persists the slot
> immediately. But relying on this call sequence seems fragile. So I'd vote for
> restoring found_consistent_snapshot.
>
I would have equally worried if this is an exposed function but this
is a local function used in a narrow scope. I feel the wrong usage, if
any, we expect could be covered by Asserts. And, it could be deduced
by slot's property whether it is safe to persist the slot or not but
if we still want to derive it by another flag, it is better to use a
more direct flag like 'can_persist_slot' to decide whether to persist
the slot. Having said that, I feel we are over worried about the wrong
usage of update_local_synced_slot().
--
With Regards,
Amit Kapila.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bertrand Drouvot | 2026-11-16 09:36:12 | Re: Document prepared transaction lock waits with two_phase subscriptions |
| Previous Message | Nitin Jadhav | 2026-11-16 08:59:00 | [PATCH] Check interrupts while draining received WAL |