pgsql: Don't call PageGetSpecialPointer() on page until it's been initi

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't call PageGetSpecialPointer() on page until it's been initi
Date: 2015-06-30 10:49:17
Message-ID: E1Z9t6L-0006ts-IA@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fdf28853ae6a397497b79fea69f89f4f7b9aa991

Modified Files
--------------
src/backend/access/nbtree/nbtxlog.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-06-30 16:54:02 pgsql: Remove useless check for NULL subexpression.
Previous Message Robert Haas 2015-06-30 03:54:26 pgsql: In bttext_abbrev_convert, move pfree to the right place.