Re: Why is RegisterPredicateLockingXid called while holding XidGenLock?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <drkp(at)csail(dot)mit(dot)edu>,<tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Why is RegisterPredicateLockingXid called while holding XidGenLock?
Date: 2011-05-06 04:13:15
Message-ID: 4DC32F0B020000250003D35B@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> This seems like a pretty lousy place to do it, first because of the
> contention hit from holding that high-traffic lock any longer than
> necessary, and second because every added chance for error between
> ExtendCLOG() and TransactionIdAdvance(ShmemVariableCache->nextXid)
> gives us another way to fail in the way recently mentioned by Joe
> Conway:
>
http://archives.postgresql.org/message-id/4DBE4E7D.80501@joeconway.com

> Even if it's actually necessary to set up that data structure while
> holding XidGenLock, I would *really* like the call to not be
> exactly where it is.

On a quick scan, I can't see any reason this couldn't be moved down
to just above the return. I think the reason I dropped it where I
did was simply that it was where we seemed to be letting other parts
of the system know about the new xid, so I was going for consistency.

I want to double-check this when I'm a little more awake, but my I
don't think that anything will be doing anything in the predicate
locking area where xid would matter until after the return from this
function.

-Kevin

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-05-06 04:18:03 Re: Why is RegisterPredicateLockingXid called while holding XidGenLock?
Previous Message Dan Ports 2011-05-06 04:11:33 Re: Why is RegisterPredicateLockingXid called while holding XidGenLock?