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

Re: Hot Standby tuning for btree_xlog_vacuum()

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hot Standby tuning for btree_xlog_vacuum()
Date: 2010-09-28 03:06:29
Message-ID: AANLkTinic8+TWVNRi5bdP2eddShvS=tp5P5QZOayjbgz@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Apr 29, 2010 at 4:12 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> Simple tuning of btree_xlog_vacuum() using an idea I had a while back,
> just never implemented. XXX comments removed.
>
> Allows us to avoid reading in blocks during VACUUM replay that are only
> required for correctness of index scans.

Review:

1. The block comment in XLogConfirmBufferIsUnpinned appears to be
copied from somewhere else, and doesn't really seem appropriate for a
new function since it refers to "the original coding of this routine".
 I think you could just delete the parenthesized portion of the
comment.

2. This bit from ConfirmBufferIsUnpinned looks odd to me.

+ 		/*
+ 		 * Found it.  Now, pin/unpin the buffer to prove it's unpinned.
+ 		 */
+ 		if (PinBuffer(buf, NULL))
+ 			UnpinBuffer(buf, false);

I don't think pinning and unpinning the buffer is sufficient to
provide that it isn't otherwise pinned.  If the buffer isn't in shared
buffers at all, it seems clear that no one can have it pinned.  But if
it's present in shared buffers, it seems like you still need
LockBufferForCleanup().

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

In response to

Responses

pgsql-hackers by date

Next:From: Itagaki TakahiroDate: 2010-09-28 03:09:05
Subject: Re: Help with User-defined function in PostgreSQL with Visual C++
Previous:From: Robert HaasDate: 2010-09-28 02:52:40
Subject: Re: levenshtein_less_equal (was: multibyte charater set in levenshtein function)

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