Skip to content

Commit 3484673

Browse files
committed
revert the PR changes
1 parent 3221d6d commit 3484673

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

pageserver/src/page_service.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,26 +1068,21 @@ impl PageServerHandler {
10681068
));
10691069
}
10701070

1071-
// Check explicitly for INVALID just to get a less scary error message if the request is obviously bogus
1072-
if request_lsn == Lsn::INVALID {
1073-
return Err(PageStreamError::BadRequest(
1074-
"invalid LSN(0) in request".into(),
1075-
));
1076-
}
1077-
1078-
// Clients should only read from recent LSNs on their timeline, or from locations holding an LSN lease.
1079-
//
1080-
// We may have older data available, but we make a best effort to detect this case and return an error,
1081-
// to distinguish a misbehaving client (asking for old LSN) from a storage issue (data missing at a legitimate LSN).
1082-
if request_lsn < **latest_gc_cutoff_lsn && !timeline.is_gc_blocked_by_lsn_lease_deadline() {
1071+
if request_lsn < **latest_gc_cutoff_lsn {
10831072
let gc_info = &timeline.gc_info.read().unwrap();
10841073
if !gc_info.leases.contains_key(&request_lsn) {
1085-
return Err(
1074+
// The requested LSN is below gc cutoff and is not guarded by a lease.
1075+
1076+
// Check explicitly for INVALID just to get a less scary error message if the
1077+
// request is obviously bogus
1078+
return Err(if request_lsn == Lsn::INVALID {
1079+
PageStreamError::BadRequest("invalid LSN(0) in request".into())
1080+
} else {
10861081
PageStreamError::BadRequest(format!(
10871082
"tried to request a page version that was garbage collected. requested at {} gc cutoff {}",
10881083
request_lsn, **latest_gc_cutoff_lsn
10891084
).into())
1090-
);
1085+
});
10911086
}
10921087
}
10931088

pageserver/src/tenant/timeline.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,11 +2085,6 @@ impl Timeline {
20852085
.unwrap_or(self.conf.default_tenant_conf.lsn_lease_length_for_ts)
20862086
}
20872087

2088-
pub(crate) fn is_gc_blocked_by_lsn_lease_deadline(&self) -> bool {
2089-
let tenant_conf = self.tenant_conf.load();
2090-
tenant_conf.is_gc_blocked_by_lsn_lease_deadline()
2091-
}
2092-
20932088
pub(crate) fn get_lazy_slru_download(&self) -> bool {
20942089
let tenant_conf = self.tenant_conf.load();
20952090
tenant_conf

0 commit comments

Comments
 (0)