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

Commit7dc7218

Browse files
committed
Don't call PageGetSpecialPointer() on page until it's been initialized.
After calling XLogInitBufferForRedo(), the page might be all-zeros if it wasnot in page cache already. btree_xlog_unlink_page initialized the pagecorrectly, but it called PageGetSpecialPointer before initializing it, whichwould lead to a corrupt page at WAL replay, if the unlinked page is not inpage cache.Backpatch to 9.4, the bug came with the rewrite of B-tree page deletion.
1 parent1afc1fe commit7dc7218

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,9 +997,10 @@ btree_xlog_unlink_page(uint8 info, XLogRecPtr lsn, XLogRecord *record)
997997
buffer=XLogReadBuffer(xlrec->node,xlrec->leafblk, true);
998998
Assert(BufferIsValid(buffer));
999999
page= (Page)BufferGetPage(buffer);
1000-
pageop= (BTPageOpaque)PageGetSpecialPointer(page);
10011000

10021001
_bt_pageinit(page,BufferGetPageSize(buffer));
1002+
pageop= (BTPageOpaque)PageGetSpecialPointer(page);
1003+
10031004
pageop->btpo_flags=BTP_HALF_DEAD |BTP_LEAF;
10041005
pageop->btpo_prev=xlrec->leafleftsib;
10051006
pageop->btpo_next=xlrec->leafrightsib;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp