diff --git a/libs/postgres_ffi/src/pg_constants.rs b/libs/postgres_ffi/src/pg_constants.rs index 6ce855c78ef5..f2d4f37d2bc2 100644 --- a/libs/postgres_ffi/src/pg_constants.rs +++ b/libs/postgres_ffi/src/pg_constants.rs @@ -203,8 +203,9 @@ pub const XLR_BLOCK_ID_DATA_LONG: u8 = 254; pub const XLR_BLOCK_ID_ORIGIN: u8 = 253; pub const XLR_BLOCK_ID_TOPLEVEL_XID: u8 = 252; -pub const BKPBLOCK_FORK_MASK: u8 = 0x0F; -pub const _BKPBLOCK_FLAG_MASK: u8 = 0xF0; +pub const BKPBLOCK_FORK_MASK: u8 = 0x07; +pub const BKPBLOCK_FLAG_MASK: u8 = 0xF8; +pub const BKPBLOCK_OPAQUE: u8 = 0x08; /* page has no page header */ pub const BKPBLOCK_HAS_IMAGE: u8 = 0x10; /* block data is an XLogRecordBlockImage */ pub const BKPBLOCK_HAS_DATA: u8 = 0x20; pub const BKPBLOCK_WILL_INIT: u8 = 0x40; /* redo will re-init the page */ diff --git a/pageserver/src/walingest.rs b/pageserver/src/walingest.rs index 804c7fca97c9..77d2d8f520e7 100644 --- a/pageserver/src/walingest.rs +++ b/pageserver/src/walingest.rs @@ -535,7 +535,7 @@ impl WalIngest { // The page may be uninitialized. If so, we can't set the LSN because // that would corrupt the page. // - if !page_is_new(&image) { + if !blk.opaque && !page_is_new(&image) { page_set_lsn(&mut image, lsn) } assert_eq!(image.len(), BLCKSZ as usize); diff --git a/pageserver/src/walrecord.rs b/pageserver/src/walrecord.rs index 62a3a91b0be6..a811040eb51b 100644 --- a/pageserver/src/walrecord.rs +++ b/pageserver/src/walrecord.rs @@ -129,6 +129,7 @@ pub struct DecodedBkpBlock { pub apply_image: bool, /* has image that should be restored */ pub will_init: bool, + pub opaque: bool, /* record doesn't need previous page version to apply */ //char *bkp_image; pub hole_offset: u16, @@ -1000,6 +1001,7 @@ pub fn decode_wal_record( blk.has_image = (fork_flags & pg_constants::BKPBLOCK_HAS_IMAGE) != 0; blk.has_data = (fork_flags & pg_constants::BKPBLOCK_HAS_DATA) != 0; blk.will_init = (fork_flags & pg_constants::BKPBLOCK_WILL_INIT) != 0; + blk.opaque = (fork_flags & pg_constants::BKPBLOCK_OPAQUE) != 0; blk.data_len = buf.get_u16_le(); /* TODO cross-check that the HAS_DATA flag is set iff data_length > 0 */ diff --git a/vendor/postgres-v16 b/vendor/postgres-v16 index 5377f5ed7290..60fab0e62ca0 160000 --- a/vendor/postgres-v16 +++ b/vendor/postgres-v16 @@ -1 +1 @@ -Subproject commit 5377f5ed7290af45b7cb6b0d98d43cbf4a4e77f3 +Subproject commit 60fab0e62ca0150276bf03231cc1339b29d3465c diff --git a/vendor/revisions.json b/vendor/revisions.json index 570dfc155056..7e5857981cb5 100644 --- a/vendor/revisions.json +++ b/vendor/revisions.json @@ -1,5 +1,5 @@ { - "v16": ["16.3", "5377f5ed7290af45b7cb6b0d98d43cbf4a4e77f3"], + "v16": ["16.3", "60fab0e62ca0150276bf03231cc1339b29d3465c"], "v15": ["15.7", "9eba7dd382606ffca43aca865f337ec21bcdac73"], "v14": ["14.12", "7bbe834c8c2dc37802eca8484311599bc47341f6"] }