Re: Bugs in TOAST handling, OID assignment and redo recovery - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bugs in TOAST handling, OID assignment and redo recovery
Date
Msg-id 15348.1523478513@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bugs in TOAST handling, OID assignment and redo recovery  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bugs in TOAST handling, OID assignment and redo recovery
Re: Bugs in TOAST handling, OID assignment and redo recovery
List pgsql-hackers
So while looking at this, it suddenly occurred to me that probing with
SnapshotDirty isn't that safe for regular (non-TOAST) Oid assignment
either.  SnapshotDirty will consider a row dead the instant the
deleting transaction has committed, but it may remain visible to other
transactions for awhile after that --- and now that we use MVCC for
catalog scans, that applies to them too.  Hence, the existing logic
is capable of creating objects with transiently-conflicting OIDs.
I don't think this could create a conflict that's visible outside
our own transaction, since anyone who can see our commit would also
see the commit of the deleting transaction.  But there's definitely
a hazard inside the transaction that creates a new object.

I propose therefore that the right fix does not require an API change
for GetNewOidWithIndex: we can just make it use SnapshotAny all the
time.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Problem while setting the fpw with SIGHUP
Next
From: Alvaro Herrera
Date:
Subject: Re: relispartition for index partitions