Skip to content

Commit

Permalink
Revert get latest lsn change
Browse files Browse the repository at this point in the history
  • Loading branch information
ctring committed Oct 31, 2023
1 parent 3723b23 commit 9eb5035
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions pageserver/src/page_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,21 +956,8 @@ impl PageServerHandler {
ctx: &RequestContext,
) -> anyhow::Result<PagestreamBeMessage> {
let latest_gc_cutoff_lsn = timeline.get_latest_gc_cutoff_lsn();
let lsn = {
let last_received_lsn = timeline
.last_received_wal
.read()
.unwrap()
.as_ref()
.map(|wal| wal.last_received_msg_lsn);
if let Some(lsn) = last_received_lsn {
lsn
} else {
// No WAL has been received yet. Fall back to getting the latest processed lsn
Self::wait_or_get_last_lsn(timeline, Lsn(0), true, &latest_gc_cutoff_lsn, ctx)
.await?
}
};
let lsn =
Self::wait_or_get_last_lsn(timeline, Lsn(0), true, &latest_gc_cutoff_lsn, ctx).await?;

Ok(PagestreamBeMessage::GetLatestLsn(
PagestreamGetLatestLsnResponse { lsn },
Expand Down

0 comments on commit 9eb5035

Please sign in to comment.