Add SIZE_OF_XLOG_RECORD_DATA_HEADER_SHORT

This commit is contained in:
Konstantin Knizhnik
2024-10-11 17:50:14 +03:00
parent f4196983d2
commit 8782018438
2 changed files with 8 additions and 2 deletions

View File

@@ -211,6 +211,8 @@ pub const BKPBLOCK_HAS_DATA: u8 = 0x20;
pub const BKPBLOCK_WILL_INIT: u8 = 0x40; /* redo will re-init the page */
pub const BKPBLOCK_SAME_REL: u8 = 0x80; /* RelFileNode omitted, same as previous */
pub const SIZE_OF_XLOG_RECORD_DATA_HEADER_SHORT: usize = 2;
/* Information stored in bimg_info */
pub const BKPIMAGE_HAS_HOLE: u8 = 0x01; /* page image has "hole" */

View File

@@ -29,7 +29,9 @@ use crate::tenant::Timeline;
use pageserver_api::reltag::{RelTag, SlruKind};
use postgres_ffi::pg_constants::{DEFAULTTABLESPACE_OID, GLOBALTABLESPACE_OID};
use postgres_ffi::pg_constants::{PGDATA_SPECIAL_FILES, PG_HBA};
use postgres_ffi::pg_constants::{
PGDATA_SPECIAL_FILES, PG_HBA, SIZE_OF_XLOG_RECORD_DATA_HEADER_SHORT,
};
use postgres_ffi::relfile_utils::{INIT_FORKNUM, MAIN_FORKNUM};
use postgres_ffi::XLogFileName;
use postgres_ffi::PG_TLI;
@@ -264,7 +266,9 @@ where
CheckPoint::decode(&checkpoint_bytes).context("deserialize checkpoint")?;
let checkpoint_end_lsn = calculate_walrecord_end_lsn(
Lsn(checkpoint.redo),
XLOG_SIZE_OF_XLOG_RECORD + 8 + SIZEOF_CHECKPOINT,
XLOG_SIZE_OF_XLOG_RECORD
+ SIZE_OF_XLOG_RECORD_DATA_HEADER_SHORT
+ SIZEOF_CHECKPOINT,
);
checkpoint_end_lsn == self.lsn
} else {