| From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
|---|---|
| To: | Zhijie Hou <houzhijie22(at)gmail(dot)com> |
| Cc: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(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-13 11:15:00 |
| Message-ID: | CAA4eK1JtX4T-cQeycc053jgX2PPvJQ-JMk=P=VK5htZttw0dsQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Nov 11, 2026 at 8:43 PM Zhijie Hou <houzhijie22(at)gmail(dot)com> wrote:
>
> On Wed, Nov11, 2026 at 01:04 AM Bertrand Drouvot wrote:
>
> > On Tue, Nov 10, 2026 at 05:17:57PM +0800, Zhijie Hou wrote:
>
> Thanks for catching this. I confirmed that this can happen.
>
> Since any temporary slot that reaches a consistent snapshot is persisted
> immediately in the same cycle, we can check "else if
> (slot->data.persistency == RS_TEMPORARY)" here instead. Attached is the
> v2 patch with this change.
>
+ else if (slot->data.persistency == RS_TEMPORARY)
+ {
+ /*
+ * We reach this point when a previous cycle updated confirmed_flush
+ * but failed to build a consistent snapshot, and the remote slot has
+ * not advanced beyond the local slot since then.
+ */
+ skip_reason = SS_SKIP_NO_CONSISTENT_SNAPSHOT;
+ }
Is it better to directly use the slot's skip_reason rather than
assuming SS_SKIP_NO_CONSISTENT_SNAPSHOT? I understand today it is
correct but tomorrow if there are more reasons, it would be better to
rely on the slot's value.
--
With Regards,
Amit Kapila.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Koshi Shibagaki (Fujitsu) | 2026-11-13 11:15:33 | Re: RE: Injection point: fix race condition between attach and cleanup |
| Previous Message | Zsolt Parragi | 2026-11-13 10:50:10 | Re: transaction_timeout is not enforced during ClientWrite |