Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions be/src/io/cache/block_file_cache.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -636,7 +636,9 @@ std::string BlockFileCache::clear_file_cache_async() {
++num_cells_to_delete;
}
}
clear_need_update_lru_blocks();
}

std::stringstream ss;
ss << "finish clear_file_cache_async, path=" << _cache_base_path
<< " num_files_all=" << num_files_all << " num_cells_all=" << num_cells_all
Expand DownExpand Up@@ -2211,6 +2213,13 @@ bool BlockFileCache::try_reserve_during_async_load(size_t size,
return !_disk_resource_limit_mode || removed_size >= size;
}

void BlockFileCache::clear_need_update_lru_blocks() {
std::vector<FileBlockSPtr> buffer;
buffer.reserve(1024);
while (_need_update_lru_blocks.try_dequeue_bulk(buffer.data(), buffer.capacity())) {
}
}

std::string BlockFileCache::clear_file_cache_directly() {
_lru_dumper->remove_lru_dump_files();
using namespace std::chrono;
Expand DownExpand Up@@ -2253,6 +2262,9 @@ std::string BlockFileCache::clear_file_cache_directly() {
_normal_queue.clear(cache_lock);
_disposable_queue.clear(cache_lock);
_ttl_queue.clear(cache_lock);

clear_need_update_lru_blocks();

ss << "finish clear_file_cache_directly"
<< " path=" << _cache_base_path
<< " time_elapsed_ms=" << duration_cast<milliseconds>(steady_clock::now() - start).count()
Expand Down
2 changes: 2 additions & 0 deletions be/src/io/cache/block_file_cache.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -453,6 +453,8 @@ class BlockFileCache {
size_t& offset, size_t& size);
void remove_lru_dump_files();

void clear_need_update_lru_blocks();

// info
std::string _cache_base_path;
size_t _capacity = 0;
Expand Down
Loading