Re: Not HOT enough

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Not HOT enough
Date: 2011-11-22 21:21:50
Message-ID: CA+TgmobO1Xp_7=935maSpMQHkRuQdH4dJjv126=rES-LtNj5ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 22, 2011 at 3:23 PM, Simon Riggs <simon(at)2ndquadrant(dot)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 suggest this is backpatched a few releases.

-1.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikko Tiihonen 2011-11-22 21:47:22 Optimize postgres protocol for fixed size arrays
Previous Message Robert Haas 2011-11-22 21:17:20 Re: Review for "Add permission check on SELECT INTO"