Re: Not HOT enough - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Not HOT enough
Date
Msg-id CA+U5nM+gk2DEXGmTJtjpFtBuH8BGz3MTk1YL+GHEsCXqsXZQ_Q@mail.gmail.com
Whole thread Raw
In response to Re: Not HOT enough  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Not HOT enough
List pgsql-hackers
On Tue, Nov 22, 2011 at 9:21 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, Nov 22, 2011 at 3:23 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> Some time ago, I changed GetOldestXmin() to ignore procs in other
>> databases resulting in a potentially later xmin.
>>
>> GetSnapshotData() was not touched when that happened, even though the
>> comments say "...This is the same computation done by
>> GetOldestXmin(true, true)." The transam/README file says it stronger
>> "GetSnapshotData also performs an oldest-xmin calculation (which had
>> better
>> match GetOldestXmin's)". Doh.
>>
>> As a result, VACUUM ignores procs in other databases, whereas HOT does
>> not. That means we aren't cleaning up as much as we could do when
>> running multiple databases. If its OK for VACUUM, then it must be OK
>> for HOT cleanup also.
>>
>> Attached patch ignores procs in other databases during
>> GetSnapshotData() when IsMVCCSnapshot(), using similar coding to
>> GetOldestXmin().
>>
>> Any doubters?
>
> I think this is unsafe for shared catalogs.

I think so too. Thats why it uses IsMVCCSnapshot() to confirm when it
is safe to do so.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Permissions checks for range-type support functions
Next
From: Oliver Jowett
Date:
Subject: Re: [JDBC] Optimize postgres protocol for fixed size arrays