Re: Snapshot export on a standby corrupts hint bits on subxact overflow

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, scott(at)scottray(dot)io
Subject: Re: Snapshot export on a standby corrupts hint bits on subxact overflow
Date: 2026-07-29 09:36:06
Message-ID: amnJhkudengxKX+Y@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Jul 28, 2026 at 06:07:34AM +0000, Bertrand Drouvot wrote:
> So, I think filtering is appropriate in both places:
>
> 1/ In ExportSnapshot(), do not include recovery subxip entries and committed
> child XIDs at or above xmax when counting and serializing them, so unnecessary
> entries do not consume the limited recovery subxip capacity.
>
> 2/ In pg_current_snapshot(), do not include source XIDs outside [xmin, xmax),
> so that it enforces the rule regardless of how the source snapshot was produced.
>

Following our off-list discussion, PFA v2 that addresses the comments above.
It adds xmax filtering, updates the documentation, and adds a few tests.

Regards,

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

Attachment Content-Type Size
v2-0001-Don-t-discard-subxip-when-exporting-a-snapshot-ta.patch text/x-diff 18.1 KB
v2-0002-Read-the-in-progress-set-from-subxip-in-pg_curren.patch text/x-diff 11.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nishant Sharma 2026-07-29 09:58:45 Re: PSQL schema "describe" \dn is not escaping quotes
Previous Message shveta malik 2026-07-29 09:17:52 Re: A new C function `get_partition_root`.