[4_2_x_release -> master] get tenant config opt

This commit is contained in:
dimstars 2024-12-13 15:14:45 +00:00 committed by ob-robot
parent 90326cca94
commit 37f0dedd11
2 changed files with 13 additions and 9 deletions

View File

@ -683,17 +683,12 @@ bool ObSQLSessionInfo::is_enable_new_query_range() const
return bret;
}
bool ObSQLSessionInfo::is_sqlstat_enabled() const
bool ObSQLSessionInfo::is_sqlstat_enabled()
{
bool bret = false;
if (lib::is_diagnose_info_enabled()) {
int64_t tenant_id = get_effective_tenant_id();
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id));
if (tenant_config.is_valid()) {
bret = tenant_config->_ob_sqlstat_enable;
// sqlstat has a dependency on the statistics mechanism, so turning off perf event will turn off sqlstat at the same time.
}
bret = get_tenant_ob_sqlstat_enable();
// sqlstat has a dependency on the statistics mechanism, so turning off perf event will turn off sqlstat at the same time.
}
return bret;
}
@ -3047,6 +3042,7 @@ void ObSQLSessionInfo::ObCachedTenantConfigInfo::refresh()
ATOMIC_STORE(&enable_insertup_replace_gts_opt_, tenant_config->_enable_insertup_replace_gts_opt);
ATOMIC_STORE(&range_optimizer_max_mem_size_, tenant_config->range_optimizer_max_mem_size);
ATOMIC_STORE(&_query_record_size_limit_, tenant_config->_query_record_size_limit);
ATOMIC_STORE(&_ob_sqlstat_enable_, tenant_config->_ob_sqlstat_enable);
// 5.allow security audit
if (OB_SUCCESS != (tmp_ret = ObSecurityAuditUtils::check_allow_audit(*session_, at_type_))) {
LOG_WARN_RET(tmp_ret, "fail get tenant_config", "ret", tmp_ret,

View File

@ -728,6 +728,7 @@ public:
sql_plan_management_mode_(0),
enable_enhanced_cursor_validation_(false),
enable_enum_set_subschema_(false),
_ob_sqlstat_enable_(true),
session_(session)
{
}
@ -756,6 +757,7 @@ public:
int64_t get_sql_plan_management_mode() const { return sql_plan_management_mode_; }
bool enable_enhanced_cursor_validation() const { return enable_enhanced_cursor_validation_; }
bool enable_enum_set_subschema() const { return enable_enum_set_subschema_; }
bool get_ob_sqlstat_enable() const { return _ob_sqlstat_enable_; }
private:
//租户级别配置项缓存session 上,避免每次获取都需要刷新
bool is_external_consistent_;
@ -784,6 +786,7 @@ public:
int64_t sql_plan_management_mode_;
bool enable_enhanced_cursor_validation_;
bool enable_enum_set_subschema_;
bool _ob_sqlstat_enable_;
ObSQLSessionInfo *session_;
};
@ -1314,12 +1317,12 @@ public:
bool is_var_assign_use_das_enabled() const;
bool is_nlj_spf_use_rich_format_enabled() const;
int is_adj_index_cost_enabled(bool &enabled, int64_t &stats_cost_percent) const;
bool is_sqlstat_enabled() const;
bool is_spf_mlj_group_rescan_enabled() const;
bool enable_parallel_das_dml() const;
int is_preserve_order_for_pagination_enabled(bool &enabled) const;
int get_spm_mode(int64_t &spm_mode);
bool is_enable_new_query_range() const;
bool is_sqlstat_enabled();
ObSessionDDLInfo &get_ddl_info() { return ddl_info_; }
const ObSessionDDLInfo &get_ddl_info() const { return ddl_info_; }
@ -1465,6 +1468,11 @@ public:
cached_tenant_config_info_.refresh();
return cached_tenant_config_info_.enable_enum_set_subschema();
}
bool get_tenant_ob_sqlstat_enable()
{
cached_tenant_config_info_.refresh();
return cached_tenant_config_info_.get_ob_sqlstat_enable();
}
int get_tmp_table_size(uint64_t &size);
int ps_use_stream_result_set(bool &use_stream);
void set_proxy_version(uint64_t v) { proxy_version_ = v; }