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

Commitfdf2885

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 parentb48ecf8 commitfdf2885

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
@@ -864,9 +864,10 @@ btree_xlog_unlink_page(uint8 info, XLogReaderState *record)
864864

865865
buffer=XLogInitBufferForRedo(record,3);
866866
page= (Page)BufferGetPage(buffer);
867-
pageop= (BTPageOpaque)PageGetSpecialPointer(page);
868867

869868
_bt_pageinit(page,BufferGetPageSize(buffer));
869+
pageop= (BTPageOpaque)PageGetSpecialPointer(page);
870+
870871
pageop->btpo_flags=BTP_HALF_DEAD |BTP_LEAF;
871872
pageop->btpo_prev=xlrec->leafleftsib;
872873
pageop->btpo_next=xlrec->leafrightsib;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp