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

From Heikki Linnakangas
Subject Re: Lazy xid assignment V3
Date
Msg-id 46DC05AD.4010101@enterprisedb.com
Whole thread Raw
In response to Lazy xid assignment V3  ("Florian G. Pflug" <fgp@phlo.org>)
Responses Re: Lazy xid assignment V3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Florian G. Pflug wrote:
> Here is an updated version of my patch. This is pretty much equivalent
> to the version V2, apart from the few minor things Tom criticized. The
> changes are.

Should there be new a log_line_prefix percent code for virtual
transaction ids? Or should we change the meaning of %x to be virtual
transaction id instead of the real one. As the patch stands, %x will
just print 0 for all transactions with no xid assigned, and the prefix
will change when one is assigned. I believe the main use case for %x is
to distinguish which messages are coming from which transaction, and the
patch as it is makes it mostly useless for that purpose.

The function comment in GetLockConflicts should probably be updated;
it's not returning a linked list anymore, but an array terminated by an
InvalidVirtualTransactionId.

What the worst thing that happens if two sessions are assigned the same
session id? Should be infrequent, but not impossible if you have some
very long-lived connections and other clients connecting/disconnecting
all the time.

A few comment typos:
asigned -> assigned
transcation -> transaction

> .) elog(ERROR) instead of Assert if there are to-be-deleted files, but
> no XID assigned on commit
>
> .) ResourceOwnerId is renamed to VirtualTransactionId.
>
> .) GetOldestXmin() checks GetTopTransactionIdIfAny() first, and only
>     reverts to ReadNewTransactionId() if the former returns
>     InvalidTransactionId.
>
> Since we didn't really reach an agreement on how xid_age should behave,
> I've reverted it back to the original version. So with this patch,
> xid_age will just force assignment of a xid.

Sounds OK to me. It's not going to consume any more xids than it does
now, and I don't think xid_age is called very often. What's it for
anyway? To write scripts to run VACUUM before xid wrap-around?

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

pgsql-patches by date:

Previous
From: "Marko Kreen"
Date:
Subject: Re: Lazy xid assignment V3
Next
From: Alvaro Herrera
Date:
Subject: Re: Lazy xid assignment V3