Skip to content

Commit

Permalink
fixup: check against the last last record LSN
Browse files Browse the repository at this point in the history
  • Loading branch information
VladLazar committed Feb 19, 2025
1 parent 198efb6 commit c57227c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ pub(super) async fn handle_walreceiver_connection(
// This is valid, but check that we received records
// that we haven't seen before.
if let Some(first_rec) = batch.records.first() {
if first_rec.next_record_lsn > expected_wal_start {
if first_rec.next_record_lsn > last_rec_lsn {
let msg = format!(
"Received record with next_record_lsn {} multiple times",
first_rec.next_record_lsn
"Received record with next_record_lsn multiple times ({} <= {})",
first_rec.next_record_lsn, expected_wal_start
);
critical!("{msg}");
return Err(WalReceiverError::Other(anyhow!(msg)));
Expand Down

0 comments on commit c57227c

Please sign in to comment.