mirror of
https://github.com/neondatabase/neon.git
synced 2026-06-04 22:10:39 +00:00
Fix lsn bound
This commit is contained in:
@@ -263,7 +263,9 @@ where
|
||||
key_range: &Range<Key>,
|
||||
lsn: Lsn,
|
||||
) -> Result<Vec<(Range<Key>, Option<Arc<L>>)>> {
|
||||
let version = match self.historic.get().unwrap().get_version(lsn.0 - 1) {
|
||||
// TODO I'm 80% sure the lsn bound is inclusive. Double-check that
|
||||
// and document it. Do the same for image_layer_exists and count_deltas
|
||||
let version = match self.historic.get().unwrap().get_version(lsn.0) {
|
||||
Some(v) => v,
|
||||
None => return Ok(vec![]),
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ impl<Value: Clone> HistoricLayerCoverage<Value> {
|
||||
self.historic.insert(lsn.start, self.head.clone());
|
||||
}
|
||||
|
||||
/// Query at a particular LSN
|
||||
/// Query at a particular LSN, inclusive
|
||||
pub fn get_version(self: &Self, lsn: u64) -> Option<&LayerCoverageTuple<Value>> {
|
||||
match self.historic.range(..=lsn).rev().next() {
|
||||
Some((_, v)) => Some(v),
|
||||
|
||||
Reference in New Issue
Block a user