Re: Assertion failure in update_local_synced_slot(), slotsync.c:364

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Zhijie Hou <houzhijie22(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: Assertion failure in update_local_synced_slot(), slotsync.c:364
Date: 2026-11-10 17:04:34
Message-ID: avNOopM6E7qLWpKf@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Nov 10, 2026 at 05:17:57PM +0800, Zhijie Hou wrote:
> Hi,
>
> On Tue, Nov10, 2026 at 04:04 AM Masahiko Sawada wrote:
>
> Thanks for reporting the issue.

+1

> I agree with your analysis, and I think we can fix it by preserving
> SS_SKIP_NO_CONSISTENT_SNAPSHOT in update_local_synced_slot() when the remote
> slot has not advanced since a previous cycle failed to build a consistent
> snapshot.
>
> Attached is a patch for the fix. I also tried to simplify and stabilize the
> test and merged it into 040_standby_failover_slots_sync.pl in case we want
> to include a test.

Thanks for the patch!

+ else if (slot->slotsync_skip_reason == SS_SKIP_NO_CONSISTENT_SNAPSHOT)

Could slotsync_skip_reason be SS_SKIP_WAL_OR_ROWS_REMOVED here even if the slot
is still inconsistent? This could happen if the local catalog_xmin gets ahead
and the remote one later catches up?

Regards,

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message David Geier 2026-11-10 16:57:48 Re: Keep TIDBitmap pagetable memory across bitmap scans