From ce1e09fc17e2562a240825df3d8694e4e8dbfcd5 Mon Sep 17 00:00:00 2001 From: liuzhanfeng2 Date: Tue, 17 Oct 2023 09:31:31 +0800 Subject: [PATCH] =?UTF-8?q?gs=5Fprobackup=E5=B7=A5=E5=85=B7=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=B1=A0=E5=8C=96=E6=A8=A1=E5=BC=8F=E4=B8=8B=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/pg_probackup/data.cpp | 12 +++++++----- src/bin/pg_probackup/validate.cpp | 3 --- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/bin/pg_probackup/data.cpp b/src/bin/pg_probackup/data.cpp index bd1e6a970..117a639a6 100644 --- a/src/bin/pg_probackup/data.cpp +++ b/src/bin/pg_probackup/data.cpp @@ -30,6 +30,7 @@ #include "lz4.h" #include "zstd.h" #include "storage/file/fio_device.h" +#include "storage/buf/bufmgr.h" typedef struct PreReadBuf { @@ -569,11 +570,7 @@ prepare_page(ConnectionArgs *conn_arg, blknum, from_fullpath, read_len, BLCKSZ); } else - { - /* If it is in DSS mode, the validation is skipped */ - if (IsDssMode()) - return PageIsOk; - + { /* We have BLCKSZ of raw data, validate it */ rc = validate_one_page(page, absolute_blknum, InvalidXLogRecPtr, page_st, @@ -1735,6 +1732,11 @@ validate_one_page(Page page, BlockNumber absolute_blkno, XLogRecPtr stop_lsn, PageState *page_st, uint32 checksum_version) { + // if page is new page , skip validate + if (PageIsNew(page) && PageIsEmpty(page)) + { + return PAGE_IS_VALID; + } page_st->lsn = InvalidXLogRecPtr; page_st->checksum = 0; diff --git a/src/bin/pg_probackup/validate.cpp b/src/bin/pg_probackup/validate.cpp index 37b3c028b..c250a0a14 100644 --- a/src/bin/pg_probackup/validate.cpp +++ b/src/bin/pg_probackup/validate.cpp @@ -292,9 +292,6 @@ void check_crc(pgFile *file, char *file_fullpath, validate_files_arg *arguments) * check page headers, checksums (if enabled) * and compute checksum of the file */ - if (IsDssMode()) { - return; - } if (!validate_file_pages(file, file_fullpath, arguments->stop_lsn, arguments->checksum_version, arguments->backup_version,