mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-23 18:10:39 +00:00
ensure_population_lower_bound() guarantees that _last_row is valid or null. However, it fails to provide this guarantee in the special rare case when `_population_range_starts_before_all_rows == true` and _last_row is non-null. (This can happen in practice if there is a dummy at before_all_clustering_rows and eviction makes the `(before_all_clustering_rows, ...)` interval discontinous. When the interval is read in this state, _last_row will point to the dummy, while _population_range_starts_before_all_rows will still be true.) In this special case, `ensure_population_lower_bound()` does not refresh `_last_row`, so it can be non-null but invalid after the call. If it is accessed in this state, undefined behaviour occurs. This was observed to happen in a test, in the `read_from_underlying() -- maybe_drop_last_entry()` codepath. The proposed fix is to make the meaning of _population_range_starts_before_all_rows closer to its real intention. Namely: it's supposed to handle the special case of a left-open interval, not the case of an interval starting at -inf.
52 KiB
52 KiB