Re: BUG #19441: Backend waits for serializable snapshot indefinitely on removing temp relations - Mailing list pgsql-bugs

From Andrey Borodin
Subject Re: BUG #19441: Backend waits for serializable snapshot indefinitely on removing temp relations
Date
Msg-id 5573BAE8-02EF-4503-80AA-80944BD8A50B@yandex-team.ru
Whole thread
In response to Re: BUG #19441: Backend waits for serializable snapshot indefinitely on removing temp relations  (Andrey Rachitskiy <pl0h0yp1@gmail.com>)
List 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.




pgsql-bugs by date:

Previous
From: surya poondla
Date:
Subject: Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work
Next
From: Andrey Rachitskiy
Date:
Subject: Re: to_char() on integer with V format silently wraps on overflow