cockroachdb / pebble

RocksDB/LevelDB inspired key-value database in Go
BSD 3-Clause "New" or "Revised" License
4.95k stars 458 forks source link

sstable: fix LazyFetcher lifetime #4137

Closed RaduBerinde closed 2 weeks ago

RaduBerinde commented 2 weeks ago

In #4123 we switched to allocating the fetcher lazily and restricting the valueBlockReader lifetime to that of the iterator. However, the lifetime of the *LazyFetcher stored in the value must outlive the iterator and it currently lives inside valueBlockReader.

This change fixes the bug by moving the LazyFetcher to valueBlockFetcher.

Fixes #4131

cockroach-teamcity commented 2 weeks ago

This change is Reviewable

RaduBerinde commented 2 weeks ago

TFTR!