Re: Lazy xid assignment V4 - Mailing list pgsql-patches

From Tom Lane
Subject Re: Lazy xid assignment V4
Date
Msg-id 20525.1189016202@sss.pgh.pa.us
Whole thread Raw
In response to Lazy xid assignment V4  ("Florian G. Pflug" <fgp@phlo.org>)
Responses Re: Lazy xid assignment V4  ("Florian G. Pflug" <fgp@phlo.org>)
List pgsql-patches
"Florian G. Pflug" <fgp@phlo.org> writes:
> Here is an updated patch, following the discussion.
> The patch can be found at: http://soc.phlo.org/lazyxidassign.v4.patch
> (I seems I still can't get attachments through to this list)

Applied with revisions --- mostly cosmetic, but there were a couple of
things that seemed really broken.  In particular, I didn't trust at all
your use of struct assignment to copy VXIDs into and out of PGPROC.
I believe that the C compiler is entitled to implement struct assignment
by bytewise memcpy, for instance, and so it wouldn't be atomic.  The
LocalTransactionId can be fetched or stored atomically, but you have to
write it as an integer assignment to be sure that that's what happens.
I also fixed sequence.c to not force XID assignment --- it can perfectly
well use the LocalTransactionId for what it's doing.

Also, I didn't add the proposed regression test, as it seems much too
fragile --- concurrent autovacuum activity would make it fail, for
instance.

There are a couple of loose ends, which I'll post about separately
on -hackers.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: HOT patch - version 15
Next
From: "Florian G. Pflug"
Date:
Subject: Re: Lazy xid assignment V4