diff --git a/pageserver/src/basebackup.rs b/pageserver/src/basebackup.rs index 36cb0e2ab5..8d32dd69eb 100644 --- a/pageserver/src/basebackup.rs +++ b/pageserver/src/basebackup.rs @@ -161,7 +161,7 @@ fn add_pgcontrol_file( // TODO: When we restart master there are no active transaction and oldestXid is // equal to nextXid if there are no prepared transactions. // Let's ignore them for a while... - checkpoint.oldestXid = checkpoint.nextXid.value as u32; + //checkpoint.oldestXid = checkpoint.nextXid.value as u32; pg_control.checkPointCopy = checkpoint; let pg_control_bytes = postgres_ffi::encode_pg_control(pg_control); let header = new_tar_header("global/pg_control", pg_control_bytes.len() as u64)?; diff --git a/pageserver/src/waldecoder.rs b/pageserver/src/waldecoder.rs index ac28bc2b6e..e5d92d29ad 100644 --- a/pageserver/src/waldecoder.rs +++ b/pageserver/src/waldecoder.rs @@ -803,6 +803,10 @@ pub fn decode_wal_record(checkpoint: &mut CheckPoint, record: Bytes) -> DecodedW } else { assert!(info == pg_constants::CLOG_TRUNCATE); blk.will_drop = true; + checkpoint.oldestXid = buf.get_u32_le(); + checkpoint.oldestXidDB = buf.get_u32_le(); + info!("RM_CLOG_ID truncate blkno {} oldestXid {} oldestXidDB {}", + blk.blkno, checkpoint.oldestXid, checkpoint.oldestXidDB); } trace!("RM_CLOG_ID updates block {}", blk.blkno); blocks.push(blk); @@ -1121,7 +1125,7 @@ pub fn decode_wal_record(checkpoint: &mut CheckPoint, record: Bytes) -> DecodedW }; } else if info == pg_constants::XLOG_MULTIXACT_TRUNCATE_ID { let xlrec = XlMultiXactTruncate::decode(&mut buf); - checkpoint.oldestXid = xlrec.end_trunc_off; + checkpoint.oldestMulti = xlrec.end_trunc_off; checkpoint.oldestMultiDB = xlrec.oldest_multi_db; let first_off_blkno = xlrec.start_trunc_off / pg_constants::MULTIXACT_OFFSETS_PER_PAGE as u32;