This commit is contained in:
kssenii 2023-06-29 13:11:22 +02:00
parent 15f64a7cb9
commit 306ca66eb4

View File

@ -757,12 +757,14 @@ bool FileCache::tryReserve(FileSegment & file_segment, const size_t size)
chassert(candidate->releasable()); chassert(candidate->releasable());
const auto * segment = candidate->file_segment.get(); const auto * segment = candidate->file_segment.get();
auto queue_it = segment->getQueueIterator();
chassert(queue_it);
ProfileEvents::increment(ProfileEvents::FilesystemCacheEvictedFileSegments); ProfileEvents::increment(ProfileEvents::FilesystemCacheEvictedFileSegments);
ProfileEvents::increment(ProfileEvents::FilesystemCacheEvictedBytes, segment->range().size()); ProfileEvents::increment(ProfileEvents::FilesystemCacheEvictedBytes, segment->range().size());
locked_key->removeFileSegment(segment->offset(), segment->lock()); locked_key->removeFileSegment(segment->offset(), segment->lock());
segment->getQueueIterator()->remove(cache_lock); queue_it->remove(cache_lock);
if (query_context) if (query_context)
query_context->remove(current_key, segment->offset(), cache_lock); query_context->remove(current_key, segment->offset(), cache_lock);