Re: XID wraparound and busy databases - Mailing list pgsql-hackers

From Tom Lane
Subject Re: XID wraparound and busy databases
Date
Msg-id 14760.1187231219@sss.pgh.pa.us
Whole thread Raw
In response to Re: XID wraparound and busy databases  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> You wouldn't take a new snapshot.  The thought that occurs to me is that
>> there's no reason that a transaction has to have an XID for itself
>> before it takes a snapshot.  We always special-case our own XID anyway.

> I'm having trouble picturing how that would work with a transaction using
> the SERIALIZABLE transaction isolation level,

Why?  You take a snapshot, you use it.  If you later need to allocate an
XID for yourself, you do that --- your own XID is surely uncommitted in
any case, so this doesn't affect the validity of the snapshot.

The bottom line here is that we need own-XID-if-any to be >= snapshot
xmin, but there's no obvious reason why it has to be < snapshot xmax.
This is, in fact, *not* the case for subtransaction XIDs, and I see
no fundamental reason why it need be true for the top transaction XID.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: XID wraparound and busy databases
Next
From: Decibel!
Date:
Subject: Re: Another idea for index-only scans