Re: GetCurrentVirtualXIDs() - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: GetCurrentVirtualXIDs()
Date
Msg-id 1232128020.31669.71.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: GetCurrentVirtualXIDs()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 2009-01-16 at 12:15 -0500, Tom Lane wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
> > 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.
> 
> Because they might be about to change xmin to something real?

True, they might.

GetSnapshotData() involuntarily sets xmin in their proc, so they would
have to be doing some strange footwork: they would have to have started
GetSnapshotData() *before* the index build and not finished it until
*after* we check GetCurrentVirtualXIDs() (after the index build).

If you think that is a serious possibility, then grabbing ProcArrayLock
in exclusive mode should close that gap.

I can't see a reason for idle-in-transaction sessions to block index
builds.

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



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: FWD: Re: Updated backslash consistency patch
Next
From: David Fetter
Date:
Subject: Re: [GENERAL] Question regarding new windowing functions in 8.4devel