Skip to content

Commit fb47544

Browse files
committed
Minor fixes for WAL consistency checking.
Michael Paquier, reviewed and slightly revised by me. Discussion: http://postgr.es/m/CAB7nPqRzCQb=vdfHvMtP0HMLBHU6z1aGdo4GJsUP-HP8jx+Pkw@mail.gmail.com
1 parent e28b115 commit fb47544

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

src/backend/access/common/bufmask.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* in a page which can be different when the WAL is generated
66
* and when the WAL is applied.
77
*
8-
* Portions Copyright (c) 2016, PostgreSQL Global Development Group
8+
* Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
99
*
1010
* Contains common routines required for masking a page.
1111
*

src/backend/access/heap/heapam.c

-1
Original file line numberDiff line numberDiff line change
@@ -9167,7 +9167,6 @@ heap_mask(char *pagedata, BlockNumber blkno)
91679167

91689168
if (ItemIdIsNormal(iid))
91699169
{
9170-
91719170
HeapTupleHeader page_htup = (HeapTupleHeader) page_item;
91729171

91739172
/*

src/backend/access/transam/xlog.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,16 @@ checkXLogConsistency(XLogReaderState *record)
13601360

13611361
Assert(XLogRecHasBlockImage(record, block_id));
13621362

1363+
if (XLogRecBlockImageApply(record, block_id))
1364+
{
1365+
/*
1366+
* WAL record has already applied the page, so bypass the
1367+
* consistency check as that would result in comparing the full
1368+
* page stored in the record with itself.
1369+
*/
1370+
continue;
1371+
}
1372+
13631373
/*
13641374
* Read the contents from the current buffer and store it in a
13651375
* temporary page.
@@ -1390,7 +1400,7 @@ checkXLogConsistency(XLogReaderState *record)
13901400

13911401
/*
13921402
* Read the contents from the backup copy, stored in WAL record and
1393-
* store it in a temporary page. There is not need to allocate a new
1403+
* store it in a temporary page. There is no need to allocate a new
13941404
* page here, a local buffer is fine to hold its contents and a mask
13951405
* can be directly applied on it.
13961406
*/

src/include/access/bufmask.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* individual rmgr, but we make things easier by providing some
88
* common routines to handle cases which occur in multiple rmgrs.
99
*
10-
* Portions Copyright (c) 2016, PostgreSQL Global Development Group
10+
* Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
1111
*
1212
* src/include/access/bufmask.h
1313
*

0 commit comments

Comments
 (0)