Possible premature SNAPBUILD_CONSISTENT with DB-specific running_xacts

From: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Antonin Houska <ah(at)cybertec(dot)at>
Subject: Possible premature SNAPBUILD_CONSISTENT with DB-specific running_xacts
Date: 2026-04-19 18:58:46
Message-ID: CAHg+QDcQak4jx_6X2_Ws98rzG=xBARLjqm_=56wTRUtNsY4DZQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

A cluster-wide decoder must never have its snapshot-builder state changed
by a database-specific running_xacts record. Adding a check to return it
early.
I think otherwise a cluster wide decoder can potentially go to
SNAPSHOT_CONSISTENT state immediately even though transactions older
than nextXid are still in progress on a different DB (not tracked by
running_xact
record). This race is now possible with cluster wide decoders and Repack
concurrently run.

Attached a patch to fix this. Thoughts?

Thanks
Satya

Attachment Content-Type Size
v1-snapbuild-only.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2026-04-19 19:00:00 Re: Typos in the code and README
Previous Message Paul A Jungwirth 2026-04-19 18:51:23 Re: SQL:2011 Application Time Update & Delete