diff options
| author | Michael Paquier <michael@paquier.xyz> | 2020-11-02 10:41:30 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2020-11-02 10:41:30 +0900 |
| commit | a8795445bc1bacc98d54ad746809bcb638700aca (patch) | |
| tree | e5520e0869e2a09c0204161923416ad661c08370 /src/include | |
| parent | 7d72fd9e6db686c9a499d4238d23525437adc132 (diff) | |
Extend PageIsVerified() to handle more custom options
This is useful for checks of relation pages without having to load the
pages into the shared buffers, and two cases can make use of that: page
verification in base backups and the online, lock-safe, flavor.
Compatibility is kept with past versions using a routine that calls the
new extended routine with the set of options compatible with the
original version. Contrary to d401c576, a macro cannot be used as there
may be external code relying on the presence of the original routine.
This is applied down to 11, where this will be used by a follow-up
commit addressing a set of issues with page verification in base
backups.
Extracted from a larger patch by the same author.
Author: Anastasia Lubennikova
Reviewed-by: Michael Paquier, Julien Rouhaud
Discussion: https://postgr.es/m/608f3476-0598-2514-2c03-e05c7d2b0cbd@postgrespro.ru
Backpatch-through: 11
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/storage/bufpage.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 34b68ad0e00..56ca6b6ce16 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -410,9 +410,15 @@ do { \ * extern declarations * ---------------------------------------------------------------- */ + +/* flags for PageAddItemExtended() */ #define PAI_OVERWRITE (1 << 0) #define PAI_IS_HEAP (1 << 1) +/* flags for PageIsVerifiedExtended() */ +#define PIV_LOG_WARNING (1 << 0) +#define PIV_REPORT_STAT (1 << 1) + #define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap) \ PageAddItemExtended(page, item, size, offsetNumber, \ ((overwrite) ? PAI_OVERWRITE : 0) | \ @@ -420,6 +426,7 @@ do { \ extern void PageInit(Page page, Size pageSize, Size specialSize); extern bool PageIsVerified(Page page, BlockNumber blkno); +extern bool PageIsVerifiedExtended(Page page, BlockNumber blkno, int flags); extern OffsetNumber PageAddItemExtended(Page page, Item item, Size size, OffsetNumber offsetNumber, int flags); extern Page PageGetTempPage(Page page); |
