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

From Heikki Linnakangas
Subject Re: Lazy xid assignment V4
Date
Msg-id 46DE8298.90103@enterprisedb.com
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 wrote:
> 1) 2PC was broken in V3. I added code that skips
> LOCKTYPE_VIRTUALTRANSACTION
> locks when writing the locks to the 2PC state file, but I didn't
> add the same exception to the code that reassigns the locks to
> a dummy PGROC afterwards. So the locks weren't released at PREPARE
> time. Fixed now.

Let me check if I got this right:

We only use the lock on virtual transaction id in CREATE INDEX
CONCURRENTLY, to wait until everyone that might insert to the table sees
the new index. Releasing the virtual transaction id right away at
PREPARE TRANSACTION, instead of reassigning it to the dummy PGPROC, is
ok because the transaction can't insert anything to the table after
PREPARE TRANSACTION.

Sounds valid to me, but better add some comments to note that the lock
is released early, in case it's going to be used for some other purpose
in the future.

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

pgsql-patches by date:

Previous
From: Kris Jurka
Date:
Subject: GSS warnings
Next
From: "Florian G. Pflug"
Date:
Subject: Re: Lazy xid assignment V4