Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend: pack next record LSN into the encoded message #33

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions postgres-protocol/src/message/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,10 @@ impl ReplicationMessage<Bytes> {
INTERPRETED_WAL_RECORD_TAG => {
let streaming_lsn = buf.read_u64::<BigEndian>()?;
let commit_lsn = buf.read_u64::<BigEndian>()?;
let next_record_lsn = match buf.read_u64::<BigEndian>()? {
0 => None,
lsn => Some(lsn),
};

ReplicationMessage::RawInterpretedWalRecords(RawInterpretedWalRecordsBody {
streaming_lsn,
commit_lsn,
next_record_lsn,
data: buf.read_all(),
})
}
Expand Down Expand Up @@ -971,7 +966,6 @@ impl<D> XLogDataBody<D> {
pub struct RawInterpretedWalRecordsBody<D> {
streaming_lsn: u64,
commit_lsn: u64,
next_record_lsn: Option<u64>,
data: D,
}

Expand All @@ -986,11 +980,6 @@ impl<D> RawInterpretedWalRecordsBody<D> {
self.commit_lsn
}

#[inline]
pub fn next_record_lsn(&self) -> Option<u64> {
self.next_record_lsn
}

#[inline]
pub fn data(&self) -> &D {
&self.data
Expand Down
Loading