pub struct WalRecord<'a> {
pub offset: usize,
pub type_byte: u8,
pub commit_lsn: Option<u64>,
pub commit_unix_us: Option<i64>,
pub prev_lsn: Option<u64>,
pub sql: &'a [u8],
}Expand description
v7.18 PITR — parsed WAL record, surfaced for restore / verify
tooling. The replay loop above doesn’t expose LSN/timestamp;
spgctl restore --to <timestamp> and spgctl verify need them.
Returned offsets are byte-positions inside the WAL buffer.
Fields§
§offset: usizeByte offset in the WAL buffer where this record starts.
type_byte: u8Type byte (0x01 = v3 auto-commit, 0x10 = v4 auto-commit, 0x02 = durability checkpoint marker).
commit_lsn: Option<u64>Some(lsn) for v4 records, None for v3.
commit_unix_us: Option<i64>Some(unix_us) for v4 records carrying a clock-set timestamp,
None for v3 or for v4 records explicitly written with
WAL_V4_NO_CLOCK (sentinel for “no ClockFn at commit time”).
prev_lsn: Option<u64>v7.37.13 (A1.3) — Some(prev_lsn) for v6 records (xl_prev
equivalent — the commit_lsn of the previous v6 record in
this chunk). None for v3 / v4 / v5 records, which do not
carry a prev-link.
sql: &'a [u8]SQL payload as borrowed bytes. Empty for durability markers.