Skip to content

Commit

Permalink
branch-3.0: [fix](cloud) fix BlockFileCache::get_or_set crash #44013 (#…
Browse files Browse the repository at this point in the history
…44146)

Cherry-picked from #44013

Signed-off-by: zhengyu <[email protected]>
Co-authored-by: zhengyu <[email protected]>
  • Loading branch information
github-actions[bot] and freemandealer authored Nov 20, 2024
1 parent 8277c51 commit 0b98983
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions be/src/io/cache/block_file_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,15 @@ FileBlocks BlockFileCache::get_impl(const UInt128Wrapper& hash, const CacheConte

auto& file_blocks = it->second;
DCHECK(!file_blocks.empty());
if (file_blocks.empty()) {
LOG(WARNING) << "file_blocks is empty for hash=" << hash.to_string()
<< " cache type=" << context.cache_type
<< " cache expiration time=" << context.expiration_time
<< " cache range=" << range.left << " " << range.right
<< " query id=" << context.query_id;
_files.erase(hash);
return {};
}
// change to ttl if the blocks aren't ttl
if (context.cache_type == FileCacheType::TTL && _key_to_time.find(hash) == _key_to_time.end()) {
for (auto& [_, cell] : file_blocks) {
Expand Down

0 comments on commit 0b98983

Please sign in to comment.