GetCurrentVirtualXIDs()

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: GetCurrentVirtualXIDs()
Date: 2009-01-16 16:52:20
Message-ID: 1232124740.31669.58.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
GetCurrVXIDs.v1.patch text/x-patch 2.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2009-01-16 17:07:32 Re: Question regarding new windowing functions in 8.4devel
Previous Message Alvaro Herrera 2009-01-16 16:37:14 Re: SnapshotResetXmin