Re: GetCurrentVirtualXIDs()

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GetCurrentVirtualXIDs()
Date: 2009-01-16 17:47:00
Message-ID: 1232128020.31669.71.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Fri, 2009-01-16 at 12:15 -0500, Tom Lane wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)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.com
PostgreSQL Training, Services and Support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2009-01-16 17:52:08 Re: [HACKERS] Question regarding new windowing functions in 8.4devel
Previous Message Joshua D. Drake 2009-01-16 17:44:18 Re: FWD: Re: Updated backslash consistency patch