mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-19 06:00:38 +00:00
Request disk consistent LSN through safekeeper
This commit is contained in:
@@ -357,6 +357,7 @@ pub enum BeMessage<'a> {
|
||||
RowDescription(&'a [RowDescriptor<'a>]),
|
||||
XLogData(XLogDataBody<'a>),
|
||||
NoticeResponse(String),
|
||||
KeepAlive(WalSndKeepAlive),
|
||||
}
|
||||
|
||||
// One row desciption in RowDescription packet.
|
||||
@@ -408,6 +409,13 @@ pub struct XLogDataBody<'a> {
|
||||
pub data: &'a [u8],
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct WalSndKeepAlive {
|
||||
pub sent_ptr: u64,
|
||||
pub timestamp: i64,
|
||||
pub request_reply: bool,
|
||||
}
|
||||
|
||||
pub static HELLO_WORLD_ROW: BeMessage = BeMessage::DataRow(&[Some(b"hello world")]);
|
||||
|
||||
// single text column
|
||||
@@ -720,6 +728,17 @@ impl<'a> BeMessage<'a> {
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
BeMessage::KeepAlive(req) => {
|
||||
buf.put_u8(b'k');
|
||||
write_body(buf, |buf| {
|
||||
buf.put_u64(req.sent_ptr);
|
||||
buf.put_i64(req.timestamp);
|
||||
buf.put_u8(if req.request_reply { 1u8 } else { 0u8 });
|
||||
Ok::<_, io::Error>(())
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user