Skip to content

Commit fd4e51b

Browse files
mergify[bot]wyb
andauthored
[BugFix] Fix cache env init order (backport #62700) (#62714)
Co-authored-by: wyb <[email protected]>
1 parent 0800081 commit fd4e51b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

be/src/service/service_be/starrocks_be.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,18 @@ void start_be(const std::vector<StorePath>& paths, bool as_cn) {
103103
CHECK(global_vars->is_init()) << "global variables not initialized";
104104
LOG(INFO) << process_name << " start step " << start_step++ << ": global variables init successfully";
105105

106-
auto* storage_engine = init_storage_engine(global_env, paths, as_cn);
107-
LOG(INFO) << process_name << " start step " << start_step++ << ": storage engine init successfully";
108-
106+
// cache env should be initialized before init_storage_engine,
107+
// because apply task is triggered in init_storage_engine and needs cache env.
109108
auto* cache_env = CacheEnv::GetInstance();
110109
EXIT_IF_ERROR(cache_env->init(paths));
111110
LOG(INFO) << process_name << " start step " << start_step++ << ": cache env init successfully";
112111

112+
auto* storage_engine = init_storage_engine(global_env, paths, as_cn);
113+
LOG(INFO) << process_name << " start step " << start_step++ << ": storage engine init successfully";
114+
113115
auto* exec_env = ExecEnv::GetInstance();
114116
EXIT_IF_ERROR(exec_env->init(paths, as_cn));
115-
LOG(INFO) << process_name << " start step " << start_step++ << ": exec engine init successfully";
117+
LOG(INFO) << process_name << " start step " << start_step++ << ": exec env init successfully";
116118

117119
// Start all background threads of storage engine.
118120
// SHOULD be called after exec env is initialized.

0 commit comments

Comments
 (0)