[FEAT MERGE] ELR & WeakRead feature enhancement
This commit is contained in:
@ -241,6 +241,7 @@ enum ObSysVarClassType
|
||||
SYS_VAR_OB_ENABLE_RICH_ERROR_MSG = 10134,
|
||||
SYS_VAR_OB_SQL_PLAN_MEMORY_PERCENTAGE = 10135,
|
||||
SYS_VAR_LOG_ROW_VALUE_OPTIONS = 10136,
|
||||
SYS_VAR_OB_MAX_READ_STALE_TIME = 10137,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -236,6 +236,7 @@ namespace share
|
||||
static const char* const OB_SV_ENABLE_RICH_ERROR_MSG = "ob_enable_rich_error_msg";
|
||||
static const char* const OB_SV_SQL_PLAN_MEMORY_PERCENTAGE = "ob_sql_plan_memory_percentage";
|
||||
static const char* const OB_SV_LOG_ROW_VALUE_OPTIONS = "log_row_value_options";
|
||||
static const char* const OB_SV_MAX_READ_STALE_TIME = "ob_max_read_stale_time";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,6 +244,7 @@ const char *ObSysVarFactory::SYS_VAR_NAMES_SORTED_BY_NAME[] = {
|
||||
"ob_interm_result_mem_limit",
|
||||
"ob_last_schema_version",
|
||||
"ob_log_level",
|
||||
"ob_max_read_stale_time",
|
||||
"ob_org_cluster_id",
|
||||
"ob_pl_block_timeout",
|
||||
"ob_plan_cache_evict_high_percentage",
|
||||
@ -467,6 +468,7 @@ const ObSysVarClassType ObSysVarFactory::SYS_VAR_IDS_SORTED_BY_NAME[] = {
|
||||
SYS_VAR_OB_INTERM_RESULT_MEM_LIMIT,
|
||||
SYS_VAR_OB_LAST_SCHEMA_VERSION,
|
||||
SYS_VAR_OB_LOG_LEVEL,
|
||||
SYS_VAR_OB_MAX_READ_STALE_TIME,
|
||||
SYS_VAR_OB_ORG_CLUSTER_ID,
|
||||
SYS_VAR_OB_PL_BLOCK_TIMEOUT,
|
||||
SYS_VAR_OB_PLAN_CACHE_EVICT_HIGH_PERCENTAGE,
|
||||
@ -783,7 +785,8 @@ const char *ObSysVarFactory::SYS_VAR_NAMES_SORTED_BY_ID[] = {
|
||||
"_windowfunc_optimization_settings",
|
||||
"ob_enable_rich_error_msg",
|
||||
"ob_sql_plan_memory_percentage",
|
||||
"log_row_value_options"
|
||||
"log_row_value_options",
|
||||
"ob_max_read_stale_time"
|
||||
};
|
||||
|
||||
bool ObSysVarFactory::sys_var_name_case_cmp(const char *name1, const ObString &name2)
|
||||
@ -1171,6 +1174,7 @@ int ObSysVarFactory::create_all_sys_vars()
|
||||
+ sizeof(ObSysVarObEnableRichErrorMsg)
|
||||
+ sizeof(ObSysVarObSqlPlanMemoryPercentage)
|
||||
+ sizeof(ObSysVarLogRowValueOptions)
|
||||
+ sizeof(ObSysVarObMaxReadStaleTime)
|
||||
;
|
||||
void *ptr = NULL;
|
||||
if (OB_ISNULL(ptr = allocator_.alloc(total_mem_size))) {
|
||||
@ -3159,6 +3163,15 @@ int ObSysVarFactory::create_all_sys_vars()
|
||||
ptr = (void *)((char *)ptr + sizeof(ObSysVarLogRowValueOptions));
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_ISNULL(sys_var_ptr = new (ptr)ObSysVarObMaxReadStaleTime())) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
LOG_ERROR("fail to new ObSysVarObMaxReadStaleTime", K(ret));
|
||||
} else {
|
||||
store_buf_[ObSysVarsToIdxMap::get_store_idx(static_cast<int64_t>(SYS_VAR_OB_MAX_READ_STALE_TIME))] = sys_var_ptr;
|
||||
ptr = (void *)((char *)ptr + sizeof(ObSysVarObMaxReadStaleTime));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return ret;
|
||||
@ -5605,6 +5618,17 @@ int ObSysVarFactory::create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SYS_VAR_OB_MAX_READ_STALE_TIME: {
|
||||
void *ptr = NULL;
|
||||
if (OB_ISNULL(ptr = allocator_.alloc(sizeof(ObSysVarObMaxReadStaleTime)))) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
LOG_ERROR("fail to alloc memory", K(ret), K(sizeof(ObSysVarObMaxReadStaleTime)));
|
||||
} else if (OB_ISNULL(sys_var_ptr = new (ptr)ObSysVarObMaxReadStaleTime())) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
LOG_ERROR("fail to new ObSysVarObMaxReadStaleTime", K(ret));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
|
||||
@ -1591,6 +1591,13 @@ public:
|
||||
inline virtual ObSysVarClassType get_type() const { return SYS_VAR_LOG_ROW_VALUE_OPTIONS; }
|
||||
inline virtual const common::ObObj &get_global_default_value() const { return ObSysVariables::get_default_value(219); }
|
||||
};
|
||||
class ObSysVarObMaxReadStaleTime : public ObIntSysVar
|
||||
{
|
||||
public:
|
||||
ObSysVarObMaxReadStaleTime() : ObIntSysVar(ObSysVarOnCheckFuncs::check_and_convert_timeout_too_large, NULL, NULL, NULL, NULL) {}
|
||||
inline virtual ObSysVarClassType get_type() const { return SYS_VAR_OB_MAX_READ_STALE_TIME; }
|
||||
inline virtual const common::ObObj &get_global_default_value() const { return ObSysVariables::get_default_value(220); }
|
||||
};
|
||||
|
||||
|
||||
class ObSysVarFactory
|
||||
@ -1610,7 +1617,7 @@ public:
|
||||
static const common::ObString get_sys_var_name_by_id(ObSysVarClassType sys_var_id);
|
||||
|
||||
const static int64_t MYSQL_SYS_VARS_COUNT = 97;
|
||||
const static int64_t OB_SYS_VARS_COUNT = 123;
|
||||
const static int64_t OB_SYS_VARS_COUNT = 124;
|
||||
const static int64_t ALL_SYS_VARS_COUNT = MYSQL_SYS_VARS_COUNT + OB_SYS_VARS_COUNT;
|
||||
|
||||
const static int16_t OB_SPECIFIC_SYS_VAR_ID_OFFSET = 10000;
|
||||
|
||||
@ -2892,13 +2892,26 @@ static struct VarsInit{
|
||||
ObSysVars[219].alias_ = "OB_SV_LOG_ROW_VALUE_OPTIONS" ;
|
||||
}();
|
||||
|
||||
[&] (){
|
||||
ObSysVars[220].info_ = "max stale time(us) for weak read query " ;
|
||||
ObSysVars[220].name_ = "ob_max_read_stale_time" ;
|
||||
ObSysVars[220].data_type_ = ObIntType ;
|
||||
ObSysVars[220].value_ = "5000000" ;
|
||||
ObSysVars[220].flags_ = ObSysVarFlag::GLOBAL_SCOPE | ObSysVarFlag::SESSION_SCOPE | ObSysVarFlag::NEED_SERIALIZE ;
|
||||
ObSysVars[220].on_check_and_convert_func_ = "ObSysVarOnCheckFuncs::check_and_convert_timeout_too_large" ;
|
||||
ObSysVars[220].id_ = SYS_VAR_OB_MAX_READ_STALE_TIME ;
|
||||
cur_max_var_id = MAX(cur_max_var_id, static_cast<int64_t>(SYS_VAR_OB_MAX_READ_STALE_TIME)) ;
|
||||
ObSysVarsIdToArrayIdx[SYS_VAR_OB_MAX_READ_STALE_TIME] = 220 ;
|
||||
ObSysVars[220].alias_ = "OB_SV_MAX_READ_STALE_TIME" ;
|
||||
}();
|
||||
|
||||
if (cur_max_var_id >= ObSysVarFactory::OB_MAX_SYS_VAR_ID) {
|
||||
HasInvalidSysVar = true;
|
||||
}
|
||||
}
|
||||
}vars_init;
|
||||
|
||||
static int64_t var_amount = 220;
|
||||
static int64_t var_amount = 221;
|
||||
|
||||
int64_t ObSysVariables::get_all_sys_var_count(){ return ObSysVarFactory::ALL_SYS_VARS_COUNT;}
|
||||
ObSysVarClassType ObSysVariables::get_sys_var_id(int64_t i){ return ObSysVars[i].id_;}
|
||||
|
||||
@ -2921,5 +2921,18 @@
|
||||
"info_cn": "",
|
||||
"background_cn": "",
|
||||
"ref_url": "https://yuque.antfin-inc.com/ob/product_functionality_review/wan7iw4mox8vgkfm"
|
||||
},
|
||||
"ob_max_read_stale_time": {
|
||||
"id": 10137,
|
||||
"name": "ob_max_read_stale_time",
|
||||
"value": "5000000",
|
||||
"data_type": "int",
|
||||
"info": "max stale time(us) for weak read query ",
|
||||
"flags": "GLOBAL | SESSION | NEED_SERIALIZE",
|
||||
"on_check_and_convert_func": "ObSysVarOnCheckFuncs::check_and_convert_timeout_too_large",
|
||||
"publish_version": "410",
|
||||
"info_cn": "",
|
||||
"background_cn": "",
|
||||
"ref_url": "https://yuque.antfin.com/ob/product_functionality_review/ns7okery0azyvlnp"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user