You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BLUF
Vectored read might skip image layers when faced with certain layer map layouts.
No risk of corruption: the bug doesn't impact the correctness of images returned,
but may cause us to do more work or return an error instead.
Root cause
This issue requires an image layer nested inside a delta layer and a vectored read on a keyspace that includes both keys not covered by the image and keys covered by the image (in that order). Like the picture below.
A B
+--------------+ l1
| | ^ LSN
| ===== l2 | |
| C E D | |
+--------------+ l3 +-----> Key
Let's assume that we are reading the [A, E) key range and the current search LSN (or cont LSN) for this range is greater than l1. We will perform a ranged search to see which layers to visit next. It will yield two results (both pointing to the same layer):
delta layer [A, B): key_range=[A, C) lsn_floor=l3
delta layer [A, B): key_range=[C, E) lsn_floor=l2
Now as Christian pointed out, the fringe makes the incorrect assumption that all reads within a layer will be at the same LSN. Note how we don't use the lsn_range argument if the layer was already in the fringe.
Hence, we use the first LSN range for both key ranges. This skips the image layer for the [C, E) range.
Risk Assesment
There is no risk of corruption since this bug doesn't make us return an incorrect page. Let's consider two cases:
The skipped image is the last image for the key range in question. This will result in the read failing with a missing key error.
The skipped image is not the last image. We will descend further and stop at the next image. This is extra work that we shouldn't be doing and we don't know how often we end up in this case, but we know that it cannot happen for get page requests.
Initial investigation was done by @problamehere.
I verified it independently and reached the same conclusions.
The text was updated successfully, but these errors were encountered:
BLUF
Vectored read might skip image layers when faced with certain layer map layouts.
No risk of corruption: the bug doesn't impact the correctness of images returned,
but may cause us to do more work or return an error instead.
Root cause
This issue requires an image layer nested inside a delta layer and a vectored read on a keyspace that includes both keys not covered by the image and keys covered by the image (in that order). Like the picture below.
Let's assume that we are reading the [A, E) key range and the current search LSN (or cont LSN) for this range is greater than l1. We will perform a ranged search to see which layers to visit next. It will yield two results (both pointing to the same layer):
Now as Christian pointed out, the fringe makes the incorrect assumption that all reads within a layer will be at the same LSN. Note how we don't use the lsn_range argument if the layer was already in the fringe.
Hence, we use the first LSN range for both key ranges. This skips the image layer for the [C, E) range.
Risk Assesment
There is no risk of corruption since this bug doesn't make us return an incorrect page. Let's consider two cases:
Initial investigation was done by @problame here.
I verified it independently and reached the same conclusions.
The text was updated successfully, but these errors were encountered: