fix config not init when init sys_vars
This commit is contained in:
@ -352,6 +352,8 @@ int ObInnerSQLConnection::init_session(sql::ObSQLSessionInfo* extern_session, co
|
|||||||
} else if (OB_FAIL(inner_session_.update_sys_variable(SYS_VAR_NLS_TIMESTAMP_TZ_FORMAT,
|
} else if (OB_FAIL(inner_session_.update_sys_variable(SYS_VAR_NLS_TIMESTAMP_TZ_FORMAT,
|
||||||
ObTimeConverter::COMPAT_OLD_NLS_TIMESTAMP_TZ_FORMAT))) {
|
ObTimeConverter::COMPAT_OLD_NLS_TIMESTAMP_TZ_FORMAT))) {
|
||||||
LOG_WARN("update sys variables failed", K(ret));
|
LOG_WARN("update sys variables failed", K(ret));
|
||||||
|
} else if (OB_FAIL(inner_session_.gen_configs_in_pc_str())) {
|
||||||
|
LOG_WARN("fail to generate configuration strings that can influence execution plan", K(ret));
|
||||||
} else {
|
} else {
|
||||||
ObString database_name(OB_SYS_DATABASE_NAME);
|
ObString database_name(OB_SYS_DATABASE_NAME);
|
||||||
if (OB_FAIL(inner_session_.set_default_database(database_name))) {
|
if (OB_FAIL(inner_session_.set_default_database(database_name))) {
|
||||||
|
|||||||
@ -104,6 +104,7 @@ public:
|
|||||||
bool in_major_version_upgrade_mode() const { return in_upgrade_mode() && is_major_version_upgrade(); }
|
bool in_major_version_upgrade_mode() const { return in_upgrade_mode() && is_major_version_upgrade(); }
|
||||||
bool enable_new_major() const { return true; }
|
bool enable_new_major() const { return true; }
|
||||||
bool in_upgrade_mode() const;
|
bool in_upgrade_mode() const;
|
||||||
|
bool is_valid() const { return system_config_!= NULL; };
|
||||||
int64_t get_current_version() { return system_config_->get_version(); }
|
int64_t get_current_version() { return system_config_->get_version(); }
|
||||||
|
|
||||||
// 兼容性需求,兼容老的SPFILE格式
|
// 兼容性需求,兼容老的SPFILE格式
|
||||||
|
|||||||
@ -980,6 +980,8 @@ int ObBasicSessionInfo::init_system_variables(const bool print_info_log, const b
|
|||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret)) {
|
||||||
if (OB_FAIL(gen_sys_var_in_pc_str())) { //将影响plan的系统变量序列化并缓存
|
if (OB_FAIL(gen_sys_var_in_pc_str())) { //将影响plan的系统变量序列化并缓存
|
||||||
LOG_INFO("fail to generate system variables in pc str");
|
LOG_INFO("fail to generate system variables in pc str");
|
||||||
|
} else if (OB_FAIL(gen_configs_in_pc_str())) {
|
||||||
|
LOG_INFO("fail to generate system config in pc str");
|
||||||
} else {
|
} else {
|
||||||
global_vars_version_ = 0;
|
global_vars_version_ = 0;
|
||||||
}
|
}
|
||||||
@ -1637,10 +1639,14 @@ int ObBasicSessionInfo::gen_configs_in_pc_str()
|
|||||||
const int64_t MAX_CONFIG_STR_SIZE = 512;
|
const int64_t MAX_CONFIG_STR_SIZE = 512;
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
int64_t pos = 0;
|
int64_t pos = 0;
|
||||||
|
if (!GCONF.is_valid()) {
|
||||||
|
// do nothing
|
||||||
|
} else {
|
||||||
int64_t cluster_config_version = GCONF.get_current_version();
|
int64_t cluster_config_version = GCONF.get_current_version();
|
||||||
int64_t tenant_config_version = (::oceanbase::omt::ObTenantConfigMgr::get_instance()).get_tenant_config_version(tenant_id_);
|
int64_t tenant_config_version = (::oceanbase::omt::ObTenantConfigMgr::get_instance()).get_tenant_config_version(tenant_id_);
|
||||||
|
|
||||||
if (!inf_pc_configs_.is_out_of_date(cluster_config_version, tenant_config_version)) {
|
if (!config_in_pc_str_.empty() &&
|
||||||
|
!inf_pc_configs_.is_out_of_date(cluster_config_version, tenant_config_version)) {
|
||||||
// unupdated configs do nothing
|
// unupdated configs do nothing
|
||||||
} else {
|
} else {
|
||||||
// update out-dated cached configs
|
// update out-dated cached configs
|
||||||
@ -1670,6 +1676,7 @@ int ObBasicSessionInfo::gen_configs_in_pc_str()
|
|||||||
inf_pc_configs_.update_version(cluster_config_version, tenant_config_version);
|
inf_pc_configs_.update_version(cluster_config_version, tenant_config_version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4113,6 +4120,7 @@ int ObBasicSessionInfo::load_all_sys_vars(const ObSysVariableSchema &sys_var_sch
|
|||||||
release_to_pool_ = OB_SUCC(ret);
|
release_to_pool_ = OB_SUCC(ret);
|
||||||
if (!is_deserialized_) {
|
if (!is_deserialized_) {
|
||||||
OZ (gen_sys_var_in_pc_str());
|
OZ (gen_sys_var_in_pc_str());
|
||||||
|
OZ (gen_configs_in_pc_str());
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user