This commit is contained in:
Vlad Lazar
2024-11-06 19:41:22 +01:00
parent f0044b8651
commit b3ef315041
5 changed files with 97 additions and 14 deletions

View File

@@ -562,7 +562,7 @@ pub enum BeMessage<'a> {
options: &'a [&'a str],
},
KeepAlive(WalSndKeepAlive),
InterpretedWalRecord(&'a [u8]),
InterpretedWalRecord(InterpretedWalRecordBody<'a>),
}
/// Common shorthands.
@@ -666,6 +666,12 @@ pub struct XLogDataBody<'a> {
pub data: &'a [u8],
}
#[derive(Debug)]
pub struct InterpretedWalRecordBody<'a> {
pub wal_end: u64,
pub data: &'a [u8],
}
#[derive(Debug)]
pub struct WalSndKeepAlive {
pub wal_end: u64, // current end of WAL on the server
@@ -1002,7 +1008,8 @@ impl BeMessage<'_> {
buf.put_u8(b'd'); // arbitrary?
write_body(buf, |buf| {
buf.put_u8(b'0');
buf.put_slice(rec);
buf.put_u64(rec.wal_end);
buf.put_slice(rec.data);
});
}
}