# Rocksdb Change Log
+## 7.9.2 (12/21/2022)
+### Bug Fixes
+* Fixed a heap use after free bug in async scan prefetching when the scan thread and another thread try to read and load the same seek block into cache.
+
## 7.9.1 (12/8/2022)
### Bug Fixes
* Fixed a regression in iterator where range tombstones after `iterate_upper_bound` is processed.
// Release io_handles.
if (bufs_[curr_].io_handle_ != nullptr && bufs_[curr_].del_fn_ != nullptr) {
DestroyAndClearIOHandle(curr_);
+ } else {
+ bufs_[curr_].async_read_in_progress_ = false;
}
if (bufs_[second].io_handle_ != nullptr && bufs_[second].del_fn_ != nullptr) {
DestroyAndClearIOHandle(second);
+ } else {
+ bufs_[second].async_read_in_progress_ = false;
}
}
uint64_t& tmp_offset, size_t& tmp_length) {
Status s;
size_t alignment = reader->file()->GetRequiredBufferAlignment();
- uint32_t second = curr_ ^ 1;
+ uint32_t second;
+
+ // Check if the first buffer has the required offset and the async read is
+ // still in progress. This should only happen if a prefetch was initiated
+ // by Seek, but the next access is at another offset.
+ if (bufs_[curr_].async_read_in_progress_ &&
+ IsOffsetInBufferWithAsyncProgress(offset, curr_)) {
+ PollAndUpdateBuffersIfNeeded(offset);
+ }
+ second = curr_ ^ 1;
// If data is overlapping over two buffers, copy the data from curr_ and
// call ReadAsync on curr_.