Skip site navigation (1) Skip section navigation (2)

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-23 14:00:12
Message-ID: CA+Tgmobf4mAmedvC=tuFuE2yNuzakLy0t8UHQknfjPcuEEXAPA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Nov 22, 2011 at 7:25 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On Tue, Nov 22, 2011 at 11:40 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>>> 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.
> Ah, you mean access to shared catalogs using MVCC snapshots.

Yeah.  This change would have the disadvantage of disabling HOT
cleanup for shared catalogs; I'm not sure whether that's a good
decision.

But now that you mention it, something seems funky about the other bit
you mention, too:

+			/* MVCC snapshots ignore other databases */
+			if (!allDbs &&
+				proc->databaseId != MyDatabaseId &&
+				proc->databaseId != 0)		/* always include WalSender */
+				continue;
+

It doesn't make sense for the RecentGlobalXmin calculation to depend
on whether or not the current snapshot is an MVCC snapshot, because
RecentGlobalXmin is a global variable not related to any particular
snapshot.  I don't believe it's safe to assume that RecentGlobalXmin
will only ever be used in conjunction with the most-recently-taken
snapshot.

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

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2011-11-23 14:01:50
Subject: Re: Permissions checks for range-type support functions
Previous:From: Florian WeimerDate: 2011-11-23 11:04:47
Subject: Re: Notes on implementing URI syntax for libpq

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group