Re: HOT - whats next ?

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "Pavan Deolasee" <pavan(dot)deolasee(at)enterprisedb(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HOT - whats next ?
Date: 2007-03-05 16:54:17
Message-ID: 1173113657.3760.1972.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2007-03-05 at 11:39 -0500, Tom Lane wrote:
> "Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
> > The first function reads a single block from a file, returning the
> > complete page as a bytea of length BLCKSZ.
> > CREATE OR REPLACE FUNCTION bufpage_get_raw_page(text, int4)
> > RETURNS bytea ...
>
> Directly from the file? What if the version in buffers is completely
> different?

No, I was doing from shared buffers.

> OTOH, if you try to pull from shared buffers then you won't
> be able to deal with corrupted pages, so I think you are claiming that
> the function can serve purposes that it can't really fulfill
> simultaneously.

Here's the code I was using...
Is there validation in this path? I thought not, maybe I'm wrong.

buf = ReadBuffer(rel, blkno);
{
bufpage = BufferGetPage(buf);

raw_page = (bytea *) palloc(BLCKSZ + VARHDRSZ);
SET_VARSIZE(raw_page, BLCKSZ + VARHDRSZ);
raw_page_data = VARDATA(raw_page);

LockBuffer(buf, BUFFER_LOCK_SHARE);

/* SnapshotEverything */
{
memcpy(raw_page_data, bufpage, BLCKSZ);
}
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
}
ReleaseBuffer(buf);

> As for putting it in core, we already had that discussion w.r.t. the
> adminpack functions, and you have not provided any argument adequate
> to override the concerns expressed about those.

The main point is to get a set of functions that can be used directly in
additional regression tests as well as diagnostics. ISTM we need to
*prove* HOT works, not just claim it. I'm very open to different
approaches as to how we might do this.

If we say these functions can't be used for block corruptions, thats
fine - that was just an additional point, not the main thought. I'll
still want a good way to produce regression tests that show HOT working
correctly.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2007-03-05 16:55:18 Re: Latest plans for Utilities with HOT
Previous Message Tom Lane 2007-03-05 16:53:36 Re: Bug: Buffer cache is not scan resistant