Re: Why is RegisterPredicateLockingXid called while holding XidGenLock? - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Why is RegisterPredicateLockingXid called while holding XidGenLock?
Date
Msg-id 4DC32F0B020000250003D35B@gw.wicourts.gov
Whole thread Raw
List 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


pgsql-hackers by date:

Previous
From: Dan Ports
Date:
Subject: Re: Why is RegisterPredicateLockingXid called while holding XidGenLock?
Next
From: Tom Lane
Date:
Subject: Re: Why is RegisterPredicateLockingXid called while holding XidGenLock?