Re: BUG #19441: Backend waits for serializable snapshot indefinitely on removing temp relations

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: BUG #19441: Backend waits for serializable snapshot indefinitely on removing temp relations
Date: 2026-08-27 08:16:22
Message-ID: 5573BAE8-02EF-4503-80AA-80944BD8A50B@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Andrey, Alexander,

I think using GetCatalogSnapshot() here is correct. It is an ordinary
MVCC snapshot, so it pins xmin, while get_toast_snapshot() still returns
SnapshotToast. PushActiveSnapshot() copies it, so later catalog
invalidations do not remove that protection.

This does not make uncommitted catalog changes from a prepared
transaction visible: its XID remains in progress to the catalog
snapshot.
A transaction that accessed temporary objects cannot be prepared, and
the cleanup only writes temporary and system relations, which do not
participate in predicate locking. I additionally tried the reproducer
with a prepared CREATE TABLE.

The existing temp-schema-cleanup isolation test, including its toasted
catalog object, passes with the change. The new test fails without the
fix and passes with it.

The only issue I found is that the new TAP test is missing from the
test_misc list in meson.build.

With that fixed, this looks ready for committer to me.

Thank you!

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Zsolt Parragi 2026-08-27 08:37:25 Re: autovacuum: automatically propagate updated parameters
Previous Message Andrey Borodin 2026-08-27 06:56:44 Re: Possible G2-item at SERIALIZABLE