Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: vectored get returns incorrect result on inexact materialized pa…
…ge cache hit (#8050) # Problem Suppose our vectored get starts with an inexact materialized page cache hit ("cached lsn") that is shadowed by a newer image layer image layer. Like so: ``` <inmemory layers> +-+ < delta layer | | -|-|----- < image layer | | | | -|-|----- < cached lsn for requested key +_+ ``` The correct visitation order is 1. inmemory layers 2. delta layer records in LSN range `[image_layer.lsn, oldest_inmemory_layer.lsn_range.start)` 3. image layer However, the vectored get code, when it visits the delta layer, it (incorrectly!) returns with state `Complete`. The reason why it returns is that it calls `on_lsn_advanced` with `self.lsn_range.start`, i.e., the layer's LSN range. Instead, it should use `lsn_range.start`, i.e., the LSN range from the correct visitation order listed above. # Solution Use `lsn_range.start` instead of `self.lsn_range.start`. # Refs discovered by & fixes #6967 Co-authored-by: Vlad Lazar <vlad@neon.tech>
- Loading branch information
8271954
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3304 tests run: 3153 passed, 0 failed, 151 skipped (full report)
Code coverage* (full report)
functions
:31.5% (6632 of 21060 functions)
lines
:48.6% (51623 of 106254 lines)
* collected from Rust tests only
8271954 at 2024-06-13T19:43:31.774Z :recycle: