aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/common/bufmask.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-09-22 14:28:22 -0400
committerRobert Haas <rhaas@postgresql.org>2017-09-22 14:33:18 -0400
commit1a44df007c9b9adc5e6082fc90fe68e615d38ecd (patch)
tree16c5bc54d5370cd0a14537718ffe77d3ecabb670 /src/backend/access/common/bufmask.c
parentc08c98df3d30c0d773d5624860145fb4215b84fb (diff)
downloadpostgresql-1a44df007c9b9adc5e6082fc90fe68e615d38ecd.tar.gz
postgresql-1a44df007c9b9adc5e6082fc90fe68e615d38ecd.zip
For wal_consistency_checking, mask page checksum as well as page LSN.
If the LSN is different, the checksum will be different, too. Ashwin Agrawal, reviewed by Michael Paquier and Kuntal Ghosh Discussion: http://postgr.es/m/CALfoeis5iqrAU-+JAN+ZzXkpPr7+-0OAGv7QUHwFn=-wDy4o4Q@mail.gmail.com
Diffstat (limited to 'src/backend/access/common/bufmask.c')
-rw-r--r--src/backend/access/common/bufmask.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/access/common/bufmask.c b/src/backend/access/common/bufmask.c
index 10253d33545..d880aef7bad 100644
--- a/src/backend/access/common/bufmask.c
+++ b/src/backend/access/common/bufmask.c
@@ -23,15 +23,17 @@
* mask_page_lsn
*
* In consistency checks, the LSN of the two pages compared will likely be
- * different because of concurrent operations when the WAL is generated
- * and the state of the page when WAL is applied.
+ * different because of concurrent operations when the WAL is generated and
+ * the state of the page when WAL is applied. Also, mask out checksum as
+ * masking anything else on page means checksum is not going to match as well.
*/
void
-mask_page_lsn(Page page)
+mask_page_lsn_and_checksum(Page page)
{
PageHeader phdr = (PageHeader) page;
PageXLogRecPtrSet(phdr->pd_lsn, (uint64) MASK_MARKER);
+ phdr->pd_checksum = MASK_MARKER;
}
/*