Re: log_newpage header comment

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: log_newpage header comment
Date: 2012-06-08 00:06:44
Message-ID: 2849.1339114004@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> It seems that in implementing ginbuildempty(), I falsified the first
> "note" in the header comment for log_newpage():

> * Note: all current callers build pages in private memory and write them
> * directly to smgr, rather than using bufmgr. Therefore there is no need
> * to pass a buffer ID to XLogInsert, nor to perform MarkBufferDirty within
> * the critical section.

> 1. Considering that we're logging the entire page, is it necessary (or
> even desirable) to include the buffer ID in the rdata structure? If
> so, why? To put that another way, does my abuse of log_newpage
> constitute a bug in gistbuildempty()?

AFAICS, not passing the buffer ID to XLogInsert is not an issue, since
we are logging the whole page in any case. However, failing to perform
MarkBufferDirty within the critical section definitely is an issue.

> 2. Should we add a new function that does the same thing as
> log_newpage for a shared buffer? I'm imagining that the signature
> would be:

Either that or rethink building this data in shared buffers. What's the
point of that, exactly, for a page that we are most certainly not going
to use in normal operation?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jerry Sievers 2012-06-08 00:07:24 Re: pg_basebackup blocking all queries with horrible performance
Previous Message Simon Riggs 2012-06-07 23:45:40 Re: slow dropping of tables, DropRelFileNodeBuffers, tas