File tree Expand file tree Collapse file tree 2 files changed +9
-19
lines changed Expand file tree Collapse file tree 2 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -1068,26 +1068,21 @@ impl PageServerHandler {
1068
1068
) ) ;
1069
1069
}
1070
1070
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 {
1083
1072
let gc_info = & timeline. gc_info . read ( ) . unwrap ( ) ;
1084
1073
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 {
1086
1081
PageStreamError :: BadRequest ( format ! (
1087
1082
"tried to request a page version that was garbage collected. requested at {} gc cutoff {}" ,
1088
1083
request_lsn, * * latest_gc_cutoff_lsn
1089
1084
) . into ( ) )
1090
- ) ;
1085
+ } ) ;
1091
1086
}
1092
1087
}
1093
1088
Original file line number Diff line number Diff line change @@ -2085,11 +2085,6 @@ impl Timeline {
2085
2085
. unwrap_or ( self . conf . default_tenant_conf . lsn_lease_length_for_ts )
2086
2086
}
2087
2087
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
-
2093
2088
pub ( crate ) fn get_lazy_slru_download ( & self ) -> bool {
2094
2089
let tenant_conf = self . tenant_conf . load ( ) ;
2095
2090
tenant_conf
You can’t perform that action at this time.
0 commit comments