pgsql: Fix an ancient oversight in btree xlog replay. - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix an ancient oversight in btree xlog replay.
Date
Msg-id 20060413035305.DF45511F6067@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix an ancient oversight in btree xlog replay.  When trying to determine if an
upper-level insertion completes a previously-seen split, we cannot simply grab
the downlink block number out of the buffer, because the buffer could contain
a later state of the page --- or perhaps the page doesn't even exist at all
any more, due to relation truncation.  These possibilities have been masked up
to now because the use of full_page_writes effectively ensured that no xlog
replay routine ever actually saw a page state newer than its own change.
Since we're deprecating full_page_writes in 8.1.*, there's no need to fix this
in existing release branches, but we need a fix in HEAD if we want to have any
hope of re-allowing full_page_writes.  Accordingly, adjust the contents of
btree WAL records so that we can always get the downlink block number from the
WAL record rather than having to depend on buffer contents.  Per report from
Kevin Grittner and Peter Brant.

Improve a few comments in related code while at it.

Modified Files:
--------------
    pgsql/src/backend/access/nbtree:
        nbtinsert.c (r1.134 -> r1.135)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/nbtinsert.c.diff?r1=1.134&r2=1.135)
        nbtxlog.c (r1.31 -> r1.32)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/nbtxlog.c.diff?r1=1.31&r2=1.32)
    pgsql/src/include/access:
        nbtree.h (r1.95 -> r1.96)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/nbtree.h.diff?r1=1.95&r2=1.96)

pgsql-committers by date:

Previous
From: nwakefield@pgfoundry.org (User Nwakefield)
Date:
Subject: bizgres - bizgres: changed pause and resume server code
Next
From: momjian@postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Update: < multiple I/O channels simultaneously.