Обсуждение: Re: [COMMITTERS] pgsql: Properly access a buffer's LSN using existing access macros

Поиск
Список
Период
Сортировка

Re: [COMMITTERS] pgsql: Properly access a buffer's LSN using existing access macros

От
Alvaro Herrera
Дата:
Alvaro Herrera wrote:
> Log Message:
> -----------
> Properly access a buffer's LSN using existing access macros instead of abusing
> knowledge of page layout.

Hmm, I just noticed this comment in bufpage.h (which was also in Jonah's
patch) :-(

typedef struct PageHeaderData
{   /* XXX LSN is member of *any* block, not only page-organized ones */   ...


So I'm now wondering if the above patch is really correct.  It'll of
course work, but is it appropriate?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: Re: [COMMITTERS] pgsql: Properly access a buffer's LSN using existing access macros

От
"Jonah H. Harris"
Дата:
On Mon, Oct 20, 2008 at 5:23 PM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> Hmm, I just noticed this comment in bufpage.h (which was also in Jonah's
> patch) :-(
>
> typedef struct PageHeaderData
> {
>    /* XXX LSN is member of *any* block, not only page-organized ones */

Passed regressions and several benchmarks for me.

-- 
Jonah H. Harris, Senior DBA
myYearbook.com


Re: Re: [COMMITTERS] pgsql: Properly access a buffer's LSN using existing access macros

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Hmm, I just noticed this comment in bufpage.h (which was also in Jonah's
> patch) :-(

> typedef struct PageHeaderData
> {
>     /* XXX LSN is member of *any* block, not only page-organized ones */
>     ...

We don't have any non-page-organized blocks ;-)

Seriously, if the issue ever became significant I'd expect that we'd add
a buffer flag to tell whether the buffer had a LSN or not, and set this
appropriately at buffer readin time depending on where we got the page
from.  That would then cue the write logic to know what to do.  (In
particular, I suppose we'd need to do this if we try to migrate clog and
friends into the main buffer arena.)
        regards, tom lane