From 90fb40cafd11f98a51eccd3ea9473eda8b39aeb4 Mon Sep 17 00:00:00 2001 From: laassaaser-dev Date: Mon, 16 Nov 2026 13:58:55 +0800 Subject: [PATCH] fix(bootstrap): use internal SQL timeout for global stat initialization --- src/rootserver/ob_bootstrap.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rootserver/ob_bootstrap.cpp b/src/rootserver/ob_bootstrap.cpp index 7c50cd9fee..4ac18f5e73 100644 --- a/src/rootserver/ob_bootstrap.cpp +++ b/src/rootserver/ob_bootstrap.cpp @@ -16,15 +16,15 @@ #define USING_LOG_PREFIX BOOTSTRAP -#if defined(__EMSCRIPTEN__) #include "common/ob_timeout_ctx.h" -#endif #include "lib/stat/ob_diagnostic_info_guard.h" #include "rootserver/ob_bootstrap.h" #include "rootserver/ob_runtime_ddl_service.h" +#include "share/config/ob_config_helper.h" #include "share/rc/ob_server_runtime.h" #include "share/ob_global_stat_proxy.h" +#include "share/ob_share_util.h" #include "rootserver/ob_table_creator.h" #include "rootserver/ob_local_management_service.h" #include "share/inner_table/ob_load_inner_table_schema.h" @@ -672,7 +672,12 @@ int ObBootstrap::init_global_stat() int ret = OB_SUCCESS; ObMySQLProxy &sql_proxy = ddl_service_.get_sql_proxy(); ObMySQLTransaction trans; + ObTimeoutCtx timeout_ctx; + // The core table is cold during bootstrap; its global-stat update needs the + // internal SQL budget rather than the short default RPC timeout. if (OB_FAIL(check_inner_stat())) { + } else if (OB_FAIL(ObShareUtil::set_default_timeout_ctx( + timeout_ctx, config::internal_sql_execute_timeout()))) { } else { const int64_t baseline_schema_version = OB_INVALID_VERSION; // OB_INVALID_VERSION == -1 const SCN snapshot_gc_scn = SCN::min_scn();