You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-03 00:26:59 +02:00
Convert page checksum filter result to a pack.
The pack is both more compact and more efficient than a variant. Also aggregate the page error info in the main process rather than in the filter to allow additional LSN filtering, to be added in a future commit.
This commit is contained in:
@ -8,6 +8,8 @@ Test Common Functions and Definitions for Backup and Expire Commands
|
||||
#include "postgres/interface/static.vendor.h"
|
||||
#include "storage/posix/storage.h"
|
||||
|
||||
#include "common/harnessPack.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Test Run
|
||||
***********************************************************************************************************************************/
|
||||
@ -140,8 +142,8 @@ testRun(void)
|
||||
ioWriteClose(write);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
pckReadStrP(ioFilterGroupResultP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"{\"align\":true,\"valid\":true}", "all zero pages");
|
||||
hrnPackToStr(ioFilterGroupResultPackP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"2:bool:true, 3:bool:true", "all zero pages");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("single valid page");
|
||||
@ -174,8 +176,8 @@ testRun(void)
|
||||
ioWriteClose(write);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
pckReadStrP(ioFilterGroupResultP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"{\"align\":true,\"valid\":true}", "single valid page");
|
||||
hrnPackToStr(ioFilterGroupResultPackP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"2:bool:true, 3:bool:true", "single valid page");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("single checksum error");
|
||||
@ -205,8 +207,8 @@ testRun(void)
|
||||
ioWriteClose(write);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
pckReadStrP(ioFilterGroupResultP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"{\"align\":true,\"error\":[0],\"valid\":false}", "single checksum error");
|
||||
hrnPackToStr(ioFilterGroupResultPackP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"1:array:[1:obj:{1:u64:17361641481138401520}], 2:bool:false, 3:bool:true", "single checksum error");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("various checksum errors some of which will be skipped because of the LSN");
|
||||
@ -297,8 +299,10 @@ testRun(void)
|
||||
ioWriteClose(write);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
pckReadStrP(ioFilterGroupResultP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"{\"align\":false,\"error\":[0,[2,4],[6,7]],\"valid\":false}", "various checksum errors");
|
||||
hrnPackToStr(ioFilterGroupResultPackP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"1:array:[1:obj:{1:u64:17361641481138401520}, 3:obj:{1:u64:2}, 4:obj:{1:u64:3}, 5:obj:{1:u64:4}, 7:obj:{1:u64:6},"
|
||||
" 8:obj:{1:u64:7}], 2:bool:false, 3:bool:false",
|
||||
"various checksum errors");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("impossibly misaligned page");
|
||||
@ -316,8 +320,8 @@ testRun(void)
|
||||
ioWriteClose(write);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
pckReadStrP(ioFilterGroupResultP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"{\"align\":false,\"valid\":false}", "misalignment");
|
||||
hrnPackToStr(ioFilterGroupResultPackP(ioWriteFilterGroup(write), PAGE_CHECKSUM_FILTER_TYPE)),
|
||||
"2:bool:false, 3:bool:false", "misalignment");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("two misaligned buffers in a row");
|
||||
|
Reference in New Issue
Block a user