Re: advancing snapshot's xmin - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: advancing snapshot's xmin
Date
Msg-id 20080328152503.GQ7464@alvh.no-ip.org
Whole thread Raw
In response to Re: advancing snapshot's xmin  (Heikki Linnakangas <heikki@enterprisedb.com>)
Responses Re: advancing snapshot's xmin
List pgsql-hackers
Heikki Linnakangas wrote:
> Alvaro Herrera wrote:
>> Tom Lane wrote:
>>> Alvaro Herrera <alvherre@commandprompt.com> writes:
>>>> As far as I can see, for the purposes of VACUUM we can remove any tuple
>>>> that was deleted after the old transaction's Xid but before that
>>>> transaction's Xmin (i.e. all of its live snapshots).  This means we get
>>>> to ignore Xid in GetOldestXmin and in the TransactionXmin calculations
>>>> in GetSnapshotData.  It would not surprise me, however, to find out that
>>>> I am overlooking something and this is incorrect.
>>> This seems entirely off-base to me.  In particular, if a transaction
>>> has an XID then its XMIN will never be greater than that, so I don't
>>> even see how you figure the case will arise.
>>
>> My point exactly -- can we let the Xmin go past its Xid?  You imply we
>> can't, but why?
>
> Everything < xmin is considered to be not running anymore. Other  
> transactions would consider the still-alive transaction as aborted, and  
> start setting hint bits etc.

Okay.  So let's say we invent another TransactionId counter -- we keep
Xmin for the current purposes, and the other counter keeps track of
snapshots ignoring Xid.  This new counter could be used by VACUUM to
trim dead tuples.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Prereading using posix_fadvise (was Re: Commitfest patches)
Next
From: Bruce Momjian
Date:
Subject: Re: Prereading using posix_fadvise (was Re: Commitfest patches)