From 1a44df007c9b9adc5e6082fc90fe68e615d38ecd Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 22 Sep 2017 14:28:22 -0400 Subject: 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 --- src/backend/access/common/bufmask.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/backend/access/common/bufmask.c') 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; } /* -- cgit v1.2.3