add config _globle_enable_rich_vector_format

This commit is contained in:
obdev
2024-03-12 07:14:56 +00:00
committed by ob-robot
parent 8d56362278
commit dec494cf3f
7 changed files with 42 additions and 17 deletions

View File

@ -1891,3 +1891,6 @@ DEF_BOOL(_enable_choose_migration_source_policy, OB_TENANT_PARAMETER, "True",
"Control whether to use chose_migration_source_policy. " "Control whether to use chose_migration_source_policy. "
"If the value of configure is false, it will not use chose_migration_source_policy and choose replica with the largest checkpoint scn as the source.", "If the value of configure is false, it will not use chose_migration_source_policy and choose replica with the largest checkpoint scn as the source.",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE)); ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(_global_enable_rich_vector_format, OB_CLUSTER_PARAMETER, "True",
"Control whether use rich vector format in vectorization engine",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));

View File

@ -2323,6 +2323,7 @@ OB_INLINE int ObPlanCache::construct_plan_cache_key(ObSQLSessionInfo &session,
// added plan's key will be `true + other_info`, same as key constructed for getting plan. // added plan's key will be `true + other_info`, same as key constructed for getting plan.
// if `use_rich_format()` is used as part of key, added plan's key will be `false + other_info`. // if `use_rich_format()` is used as part of key, added plan's key will be `false + other_info`.
pc_key.use_rich_vector_format_ = session.initial_use_rich_format(); pc_key.use_rich_vector_format_ = session.initial_use_rich_format();
pc_key.config_use_rich_format_ = session.config_use_rich_format();
pc_key.is_weak_read_ = is_weak; pc_key.is_weak_read_ = is_weak;
return ret; return ret;
} }

View File

@ -166,7 +166,8 @@ struct ObPlanCacheKey : public ObILibCacheKey
{ {
uint16_t is_weak_read_ : 1; uint16_t is_weak_read_ : 1;
uint16_t use_rich_vector_format_ : 1; uint16_t use_rich_vector_format_ : 1;
uint16_t reserved_ : 14; // reserved uint16_t config_use_rich_format_ : 1;
uint16_t reserved_ : 13; // reserved
}; };
}; };
}; };

View File

@ -1250,6 +1250,9 @@ int ObResolver::resolve(IsPrepared if_prepared, const ParseNode &parse_tree, ObS
} }
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {
if (params_.session_info_->is_force_off_rich_format()) {
// do nothing
} else {
bool has_rich_format_hint = false; bool has_rich_format_hint = false;
bool enable_rich_format = false; bool enable_rich_format = false;
ObOptParamHint &opt_hint = params_.query_ctx_->query_hint_.global_hint_.opt_params_; ObOptParamHint &opt_hint = params_.query_ctx_->query_hint_.global_hint_.opt_params_;
@ -1264,6 +1267,7 @@ int ObResolver::resolve(IsPrepared if_prepared, const ParseNode &parse_tree, ObS
} }
} }
} }
}
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {
stmt::StmtType stmt_type = stmt->get_stmt_type(); stmt::StmtType stmt_type = stmt->get_stmt_type();
if (ObStmt::is_ddl_stmt(stmt_type, stmt->has_global_variable()) || ObStmt::is_dcl_stmt(stmt_type)) { if (ObStmt::is_ddl_stmt(stmt_type, stmt->has_global_variable()) || ObStmt::is_dcl_stmt(stmt_type)) {

View File

@ -157,7 +157,8 @@ ObBasicSessionInfo::ObBasicSessionInfo(const uint64_t tenant_id)
is_client_sessid_support_(false), is_client_sessid_support_(false),
use_rich_vector_format_(false), use_rich_vector_format_(false),
last_refresh_schema_version_(OB_INVALID_VERSION), last_refresh_schema_version_(OB_INVALID_VERSION),
force_rich_vector_format_(ForceRichFormatStatus::Disable) force_rich_vector_format_(ForceRichFormatStatus::Disable),
config_use_rich_format_(true)
{ {
thread_data_.reset(); thread_data_.reset();
MEMSET(sys_vars_, 0, sizeof(sys_vars_)); MEMSET(sys_vars_, 0, sizeof(sys_vars_));
@ -461,6 +462,7 @@ void ObBasicSessionInfo::reset(bool skip_sys_var)
client_identifier_.reset(); client_identifier_.reset();
last_refresh_schema_version_ = OB_INVALID_VERSION; last_refresh_schema_version_ = OB_INVALID_VERSION;
proxy_user_id_ = OB_INVALID_ID; proxy_user_id_ = OB_INVALID_ID;
config_use_rich_format_ = true;
} }
int ObBasicSessionInfo::reset_timezone() int ObBasicSessionInfo::reset_timezone()

View File

@ -484,10 +484,19 @@ public:
const bool need_check_valid /* true */); const bool need_check_valid /* true */);
void init_use_rich_format() void init_use_rich_format()
{ {
config_use_rich_format_ = GCONF._global_enable_rich_vector_format;
if (!config_use_rich_format_) {
use_rich_vector_format_ = false;
force_rich_vector_format_ = ForceRichFormatStatus::FORCE_OFF;
} else {
use_rich_vector_format_ = GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_4_3_0_0 use_rich_vector_format_ = GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_4_3_0_0
&& sys_vars_cache_.get_enable_rich_vector_format(); && sys_vars_cache_.get_enable_rich_vector_format();
force_rich_vector_format_ = ForceRichFormatStatus::Disable; force_rich_vector_format_ = ForceRichFormatStatus::Disable;
} }
}
bool is_force_off_rich_format() {
return force_rich_vector_format_ == ForceRichFormatStatus::FORCE_OFF;
}
bool use_rich_format() const { bool use_rich_format() const {
if (force_rich_vector_format_ != ForceRichFormatStatus::Disable) { if (force_rich_vector_format_ != ForceRichFormatStatus::Disable) {
return force_rich_vector_format_ == ForceRichFormatStatus::FORCE_ON; return force_rich_vector_format_ == ForceRichFormatStatus::FORCE_ON;
@ -496,6 +505,8 @@ public:
} }
} }
bool config_use_rich_format() { return config_use_rich_format_; }
bool initial_use_rich_format() const { bool initial_use_rich_format() const {
return use_rich_vector_format_; return use_rich_vector_format_;
} }
@ -2342,6 +2353,8 @@ private:
// force_rich_vector_format_ == FORCE_OFF => use_rich_format() returns false // force_rich_vector_format_ == FORCE_OFF => use_rich_format() returns false
// otherwise use_rich_format() returns use_rich_vector_format_ // otherwise use_rich_format() returns use_rich_vector_format_
ForceRichFormatStatus force_rich_vector_format_; ForceRichFormatStatus force_rich_vector_format_;
// just used to plan cache key
bool config_use_rich_format_;
}; };

View File

@ -325,6 +325,7 @@ _force_hash_groupby_dump
_force_hash_join_spill _force_hash_join_spill
_force_malloc_for_absent_tenant _force_malloc_for_absent_tenant
_force_skip_encoding_partition_id _force_skip_encoding_partition_id
_global_enable_rich_vector_format
_hash_area_size _hash_area_size
_hash_join_enabled _hash_join_enabled
_ha_rpc_timeout _ha_rpc_timeout