Re: [pgsql-patches] Phantom Command IDs, updated patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: [pgsql-patches] Phantom Command IDs, updated patch
Date
Msg-id 21374.1170978338@sss.pgh.pa.us
Whole thread Raw
In response to Phantom Command IDs, updated patch  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-patches
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> I found one more subtle safety issue. The array and hash table for
> phantom command ids is dynamically grown when HeapTupleHeaderSetCmax is
> called. Unfortunately, since HeapTupleHeaderSetCmax is used inside a
> critical sections, running out of memory while trying to grow them would
> cause a PANIC. That's why I moved the SetXmax/SetCmax calls outside
> critical sections in heapam.c. I believe that's safe; if a backend
> aborts after setting the xmax/cmax, no-one is going to care about the
> xid of an aborted transaction in there.

I don't like that one bit; I think a saner solution is to refactor the
API of combocid.c so that we can obtain the required CID before
modifying the page.  It'll mean it's not a drop-in replacement for
HeapTupleSetCmax, but all callers of that are going to need a close look
anyway.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] plpgsql, return can contains any expression
Next
From: Alvaro Herrera
Date:
Subject: Re: Have psql show current sequnce values - (Resubmission)