Skip to content

Commit

Permalink
[fix](cloud) fix BlockFileCache::get_or_set crash (#44013)
Browse files Browse the repository at this point in the history
This is a Plan-B fix, the root cause is under study:

2# JVM_handle_linux_signal in
/usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so
 3# 0x00007F8CFE720520 in /lib/x86_64-linux-gnu/libc.so.6
4# std::_Rb_tree_decrement(std::_Rb_tree_node_base*) at
../../../../../libstdc++-v3/src/c++98/tree.cc:123
5#
doris::io::BlockFileCache::get_impl[abi:cxx11](doris::io::UInt128Wrapper
const&, doris::io::CacheContext const&, doris::io::FileBlock::Range
const&, std::lock_guard<std::mutex>&) at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/io/cache/block_file_cache.cpp:365
6# doris::io::BlockFileCache::get_or_set(doris::io::UInt128Wrapper
const&, unsigned long, unsigned long, doris::io::CacheContext&) at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/io/cache/block_file_cache.cpp:662
7# doris::io::CachedRemoteFileReader::read_at_impl(unsigned long,
doris::Slice, unsigned long*, doris::io::IOContext const*) at
/home/zcp/repo_center/doris_branch-3.0/doris/be/src/io/cache/cached_remote_file_reader.cpp:179


Signed-off-by: zhengyu <[email protected]>
  • Loading branch information
freemandealer authored Nov 18, 2024
1 parent 258dcee commit 56bf4b6
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 56bf4b6

Please sign in to comment.