Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd95e36d

Browse files
Remove obsolete nbtree split REDO routine comment.
Commitdd299df, which added suffix truncation to nbtree, simplifiedthe WAL record format used by page splits. It became necessary toexplicitly WAL-log the new high key for the left half of a split in allcases, which relieved the REDO routine from having to reconstruct a newhigh key for the left page by copying the first item from the rightpage. Remove a comment that referred to the previous practice.
1 parent6163981 commitd95e36d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/backend/access/nbtree/nbtxlog.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,19 +248,16 @@ btree_xlog_split(bool onleft, XLogReaderState *record)
248248
PageSetLSN(rpage,lsn);
249249
MarkBufferDirty(rbuf);
250250

251-
/* don't release the buffer yet; we touch right page's first item below */
252-
253251
/* Now reconstruct left (original) sibling page */
254252
if (XLogReadBufferForRedo(record,0,&lbuf)==BLK_NEEDS_REDO)
255253
{
256254
/*
257255
* To retain the same physical order of the tuples that they had, we
258256
* initialize a temporary empty page for the left page and add all the
259257
* items to that in item number order. This mirrors how _bt_split()
260-
* works. It's not strictly required to retain the same physical
261-
* order, as long as the items are in the correct item number order,
262-
* but it helps debugging. See also _bt_restore_page(), which does
263-
* the same for the right page.
258+
* works. Retaining the same physical order makes WAL consistency
259+
* checking possible. See also _bt_restore_page(), which does the
260+
* same for the right page.
264261
*/
265262
Pagelpage= (Page)BufferGetPage(lbuf);
266263
BTPageOpaquelopaque= (BTPageOpaque)PageGetSpecialPointer(lpage);
@@ -345,7 +342,10 @@ btree_xlog_split(bool onleft, XLogReaderState *record)
345342
MarkBufferDirty(lbuf);
346343
}
347344

348-
/* We no longer need the buffers */
345+
/*
346+
* We no longer need the buffers. They must be released together, so that
347+
* readers cannot observe two inconsistent halves.
348+
*/
349349
if (BufferIsValid(lbuf))
350350
UnlockReleaseBuffer(lbuf);
351351
UnlockReleaseBuffer(rbuf);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp