This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 56bf4b663a1 [fix](cloud) fix BlockFileCache::get_or_set crash (#44013)
56bf4b663a1 is described below

commit 56bf4b663a17c46c78b7af4e5e307a6f85e206b9
Author: zhengyu <zhangzhen...@selectdb.com>
AuthorDate: Mon Nov 18 12:09:11 2024 +0800

    [fix](cloud) fix BlockFileCache::get_or_set crash (#44013)
    
    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 <zhangzhen...@selectdb.com>
---
 be/src/io/cache/block_file_cache.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/be/src/io/cache/block_file_cache.cpp 
b/be/src/io/cache/block_file_cache.cpp
index 596afb64232..ebcbe9135da 100644
--- a/be/src/io/cache/block_file_cache.cpp
+++ b/be/src/io/cache/block_file_cache.cpp
@@ -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) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to