1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Allow page header checks to be skipped.

These checks cause false negatives for page checksum verification when the page is encrypted because pd_upper might end up as 0 in the encrypted data. This issue is rare but reproducible given a large enough cluster.

Make these checks optional, but leave them enabled by default.
This commit is contained in:
David Steele
2023-04-20 13:24:12 +03:00
committed by GitHub
parent 8240eb5da5
commit f5e6bc2698
14 changed files with 173 additions and 82 deletions

View File

@ -12,6 +12,7 @@ Modifications need to be made after copying:
1) Remove `#include "storage/bufpage.h"`.
2) Make pg_checksum_page() static.
3) Remove Assert(!PageIsNew(&cpage->phdr)).
***********************************************************************************************************************************/
/*-------------------------------------------------------------------------
@ -204,9 +205,6 @@ pg_checksum_page(char *page, BlockNumber blkno)
uint16 save_checksum;
uint32 checksum;
/* We only calculate the checksum for properly-initialized pages */
Assert(!PageIsNew(&cpage->phdr));
/*
* Save pd_checksum and temporarily set it to zero, so that the checksum
* calculation isn't affected by the old checksum stored on the page.

View File

@ -205,14 +205,6 @@ typedef struct PageHeaderData
// ---------------------------------------------------------------------------------------------------------------------------------
typedef PageHeaderData *PageHeader;
// PageIsNew macro
// ---------------------------------------------------------------------------------------------------------------------------------
/*
* PageIsNew
* returns true iff page has not been initialized (by PageInit)
*/
#define PageIsNew(page) (((PageHeader) (page))->pd_upper == 0)
/***********************************************************************************************************************************
Types from src/include/access/transam.h
***********************************************************************************************************************************/