This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new f17111a6fdc [fix](cloud) fix FDCache::get_file_reader crash pick#47893
#47909 (#47910)
f17111a6fdc is described below
commit f17111a6fdcd541d30f7d4f9cd0d1b5080b23668
Author: zhengyu <[email protected]>
AuthorDate: Fri Feb 14 19:50:13 2025 +0800
[fix](cloud) fix FDCache::get_file_reader crash pick#47893 #47909 (#47910)
init order cause this crash: file cache init first, while fd cache is
uninitialized. so if file cache evict data file in advance, reference to
fd cache is uninit. pick #47893
---
be/src/io/cache/fs_file_cache_storage.cpp | 2 ++
be/src/runtime/exec_env_init.cpp | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/be/src/io/cache/fs_file_cache_storage.cpp
b/be/src/io/cache/fs_file_cache_storage.cpp
index ce02c2a101d..43a4a541cb0 100644
--- a/be/src/io/cache/fs_file_cache_storage.cpp
+++ b/be/src/io/cache/fs_file_cache_storage.cpp
@@ -53,6 +53,7 @@ std::shared_ptr<FileReader> FDCache::get_file_reader(const
AccessKeyAndOffset& k
if (config::file_cache_max_file_reader_cache_size == 0) [[unlikely]] {
return nullptr;
}
+ DCHECK(ExecEnv::GetInstance());
std::shared_lock rlock(_mtx);
if (auto iter = _file_name_to_reader.find(key); iter !=
_file_name_to_reader.end()) {
return iter->second->second;
@@ -81,6 +82,7 @@ void FDCache::remove_file_reader(const AccessKeyAndOffset&
key) {
if (config::file_cache_max_file_reader_cache_size == 0) [[unlikely]] {
return;
}
+ DCHECK(ExecEnv::GetInstance());
std::lock_guard wlock(_mtx);
if (auto iter = _file_name_to_reader.find(key); iter !=
_file_name_to_reader.end()) {
_file_reader_list.erase(iter->second);
diff --git a/be/src/runtime/exec_env_init.cpp b/be/src/runtime/exec_env_init.cpp
index 12065de767f..d912807b2e1 100644
--- a/be/src/runtime/exec_env_init.cpp
+++ b/be/src/runtime/exec_env_init.cpp
@@ -243,6 +243,7 @@ Status ExecEnv::_init(const std::vector<StorePath>&
store_paths,
// so it should be created before all query begin and deleted after all
query and daemon thread stoppped
_runtime_query_statistics_mgr = new RuntimeQueryStatisticsMgr();
CgroupCpuCtl::init_doris_cgroup_path();
+ _file_cache_open_fd_cache = std::make_unique<io::FDCache>();
_file_cache_factory = new io::FileCacheFactory();
std::vector<doris::CachePath> cache_paths;
init_file_cache_factory(cache_paths);
@@ -282,7 +283,6 @@ Status ExecEnv::_init(const std::vector<StorePath>&
store_paths,
_memtable_memory_limiter = std::make_unique<MemTableMemoryLimiter>();
_load_stream_map_pool = std::make_unique<LoadStreamMapPool>();
_delta_writer_v2_pool = std::make_unique<vectorized::DeltaWriterV2Pool>();
- _file_cache_open_fd_cache = std::make_unique<io::FDCache>();
_wal_manager = WalManager::create_shared(this,
config::group_commit_wal_path);
_dns_cache = new DNSCache();
_write_cooldown_meta_executors =
std::make_unique<WriteCooldownMetaExecutors>();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]