mirror of
https://github.com/postgres/postgres.git
synced 2025-05-09 18:21:05 +03:00
Remove obsolete nbtree split REDO routine comment.
Commit dd299df8189, which added suffix truncation to nbtree, simplified the WAL record format used by page splits. It became necessary to explicitly WAL-log the new high key for the left half of a split in all cases, which relieved the REDO routine from having to reconstruct a new high key for the left page by copying the first item from the right page. Remove a comment that referred to the previous practice.
This commit is contained in:
parent
61639816b8
commit
d95e36dc38
@ -248,8 +248,6 @@ btree_xlog_split(bool onleft, XLogReaderState *record)
|
|||||||
PageSetLSN(rpage, lsn);
|
PageSetLSN(rpage, lsn);
|
||||||
MarkBufferDirty(rbuf);
|
MarkBufferDirty(rbuf);
|
||||||
|
|
||||||
/* don't release the buffer yet; we touch right page's first item below */
|
|
||||||
|
|
||||||
/* Now reconstruct left (original) sibling page */
|
/* Now reconstruct left (original) sibling page */
|
||||||
if (XLogReadBufferForRedo(record, 0, &lbuf) == BLK_NEEDS_REDO)
|
if (XLogReadBufferForRedo(record, 0, &lbuf) == BLK_NEEDS_REDO)
|
||||||
{
|
{
|
||||||
@ -257,10 +255,9 @@ btree_xlog_split(bool onleft, XLogReaderState *record)
|
|||||||
* To retain the same physical order of the tuples that they had, we
|
* To retain the same physical order of the tuples that they had, we
|
||||||
* initialize a temporary empty page for the left page and add all the
|
* initialize a temporary empty page for the left page and add all the
|
||||||
* items to that in item number order. This mirrors how _bt_split()
|
* items to that in item number order. This mirrors how _bt_split()
|
||||||
* works. It's not strictly required to retain the same physical
|
* works. Retaining the same physical order makes WAL consistency
|
||||||
* order, as long as the items are in the correct item number order,
|
* checking possible. See also _bt_restore_page(), which does the
|
||||||
* but it helps debugging. See also _bt_restore_page(), which does
|
* same for the right page.
|
||||||
* the same for the right page.
|
|
||||||
*/
|
*/
|
||||||
Page lpage = (Page) BufferGetPage(lbuf);
|
Page lpage = (Page) BufferGetPage(lbuf);
|
||||||
BTPageOpaque lopaque = (BTPageOpaque) PageGetSpecialPointer(lpage);
|
BTPageOpaque lopaque = (BTPageOpaque) PageGetSpecialPointer(lpage);
|
||||||
@ -345,7 +342,10 @@ btree_xlog_split(bool onleft, XLogReaderState *record)
|
|||||||
MarkBufferDirty(lbuf);
|
MarkBufferDirty(lbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We no longer need the buffers */
|
/*
|
||||||
|
* We no longer need the buffers. They must be released together, so that
|
||||||
|
* readers cannot observe two inconsistent halves.
|
||||||
|
*/
|
||||||
if (BufferIsValid(lbuf))
|
if (BufferIsValid(lbuf))
|
||||||
UnlockReleaseBuffer(lbuf);
|
UnlockReleaseBuffer(lbuf);
|
||||||
UnlockReleaseBuffer(rbuf);
|
UnlockReleaseBuffer(rbuf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user