Don't call PageGetSpecialPointer() on page until it's been initialized.

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: fdf28853ae6a397497b79fea69f89f4f7b9aa991
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2015-06-30T10:41:30Z
Releases: 9.5.0
Don't call PageGetSpecialPointer() on page until it's been initialized.

After calling XLogInitBufferForRedo(), the page might be all-zeros if it was
not in page cache already. btree_xlog_unlink_page initialized the page
correctly, but it called PageGetSpecialPointer before initializing it, which
would lead to a corrupt page at WAL replay, if the unlinked page is not in
page cache.

Backpatch to 9.4, the bug came with the rewrite of B-tree page deletion.

Files

PathChange+/−
src/backend/access/nbtree/nbtxlog.c modified +2 −1