GetCurrentVirtualXIDs() - Mailing list pgsql-hackers

From Simon Riggs
Subject GetCurrentVirtualXIDs()
Date
Msg-id 1232124740.31669.58.camel@ebony.2ndQuadrant
Whole thread Raw
Responses Re: GetCurrentVirtualXIDs()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: GetCurrentVirtualXIDs()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: GetCurrentVirtualXIDs()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
No need to wait for idle-in-transaction sessions during index builds.

GetCurrentVirtualXIDs() specifically *includes* backends that have
proc->xmin == InvalidTransactionId (0), but I'm not sure why.

$SUBJECT is currently used by DefineIndex() to wait for all backends
that might be able to see index changes in phase 2 of concurrent index
build. The code comments say "we have to wait out any transactions that
might have older snapshots". If proc->xmin == 0 it is because they
haven't got any snapshots at all and therefore the index build does
*not* need to wait for them.

I'm using this routine for Hot Standby also, so patching this will allow
me to ignore idle-in-transaction sessions unless they are from
serializable transactions or have open cursors. But there's no need for
me to include this in the patch if its a general fix.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: SnapshotResetXmin
Next
From: David Fetter
Date:
Subject: Re: [GENERAL] Question regarding new windowing functions in 8.4devel