change restore concurrency to ha high thread score
This commit is contained in:
@ -7863,6 +7863,15 @@ int ObRootService::physical_restore_tenant(const obrpc::ObPhysicalRestoreTenantA
|
|||||||
int64_t job_id = OB_INVALID_ID;
|
int64_t job_id = OB_INVALID_ID;
|
||||||
int64_t refreshed_schema_version = OB_INVALID_VERSION;
|
int64_t refreshed_schema_version = OB_INVALID_VERSION;
|
||||||
ObSchemaGetterGuard schema_guard;
|
ObSchemaGetterGuard schema_guard;
|
||||||
|
int64_t restore_concurrency = 0;
|
||||||
|
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(MTL_ID()));
|
||||||
|
if (tenant_config.is_valid()) {
|
||||||
|
restore_concurrency = tenant_config->ha_high_thread_score;
|
||||||
|
}
|
||||||
|
if (0 == restore_concurrency) {
|
||||||
|
restore_concurrency = OB_DEFAULT_RESTORE_CONCURRENCY;
|
||||||
|
}
|
||||||
|
|
||||||
if (!inited_) {
|
if (!inited_) {
|
||||||
ret = OB_NOT_INIT;
|
ret = OB_NOT_INIT;
|
||||||
LOG_WARN("not init", K(ret));
|
LOG_WARN("not init", K(ret));
|
||||||
@ -7875,7 +7884,7 @@ int ObRootService::physical_restore_tenant(const obrpc::ObPhysicalRestoreTenantA
|
|||||||
"in upgrade mode is not allowed", KR(ret));
|
"in upgrade mode is not allowed", KR(ret));
|
||||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW,
|
LOG_USER_ERROR(OB_OP_NOT_ALLOW,
|
||||||
"restore tenant while in standby cluster or in upgrade mode");
|
"restore tenant while in standby cluster or in upgrade mode");
|
||||||
} else if (0 == GCONF.restore_concurrency) {
|
} else if (0 == restore_concurrency) {
|
||||||
ret = OB_OP_NOT_ALLOW;
|
ret = OB_OP_NOT_ALLOW;
|
||||||
LOG_WARN("restore tenant when restore_concurrency is 0 not allowed", KR(ret));
|
LOG_WARN("restore tenant when restore_concurrency is 0 not allowed", KR(ret));
|
||||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "restore tenant when restore_concurrency is 0");
|
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "restore tenant when restore_concurrency is 0");
|
||||||
|
|||||||
@ -93,6 +93,7 @@ const int64_t OB_BACKUP_INVALID_JOB_ID = 0;
|
|||||||
const int64_t OB_ARCHIVE_INVALID_ROUND_ID = 0;
|
const int64_t OB_ARCHIVE_INVALID_ROUND_ID = 0;
|
||||||
const int64_t OB_INVALID_DEST_ID = -1;
|
const int64_t OB_INVALID_DEST_ID = -1;
|
||||||
const int64_t OB_MAX_BACKUP_QUERY_TIMEOUT = 60 * 1000 * 1000; // 60s
|
const int64_t OB_MAX_BACKUP_QUERY_TIMEOUT = 60 * 1000 * 1000; // 60s
|
||||||
|
const int64_t OB_DEFAULT_RESTORE_CONCURRENCY = 8;
|
||||||
|
|
||||||
// TODO add tenant BACKUP_META_TIMEOUT parameters in 4.1
|
// TODO add tenant BACKUP_META_TIMEOUT parameters in 4.1
|
||||||
static const int64_t OB_MAX_BACKUP_META_TIMEOUT = 30 * 60 * 1000 * 1000; // 30 min
|
static const int64_t OB_MAX_BACKUP_META_TIMEOUT = 30 * 60 * 1000 * 1000; // 30 min
|
||||||
|
|||||||
@ -774,9 +774,6 @@ DEF_INT(ha_mid_thread_score, OB_TENANT_PARAMETER, "0", "[0,100]",
|
|||||||
DEF_INT(ha_low_thread_score, OB_TENANT_PARAMETER, "0", "[0,100]",
|
DEF_INT(ha_low_thread_score, OB_TENANT_PARAMETER, "0", "[0,100]",
|
||||||
"the current work thread score of high availability low thread. Range: [0,100] in integer. Especially, 0 means default value",
|
"the current work thread score of high availability low thread. Range: [0,100] in integer. Especially, 0 means default value",
|
||||||
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
||||||
DEF_INT(restore_concurrency, OB_CLUSTER_PARAMETER, "0", "[0,512]",
|
|
||||||
"the current work thread num of restore macro block. Range: [0,512] in integer",
|
|
||||||
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
|
||||||
DEF_INT(minor_compact_trigger, OB_TENANT_PARAMETER, "2", "[0,16]",
|
DEF_INT(minor_compact_trigger, OB_TENANT_PARAMETER, "2", "[0,16]",
|
||||||
"minor_compact_trigger, Range: [0,16] in integer",
|
"minor_compact_trigger, Range: [0,16] in integer",
|
||||||
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
||||||
|
|||||||
@ -1337,7 +1337,14 @@ int ObILSRestoreState::check_restore_concurrency_limit_()
|
|||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
const ObDagNetType::ObDagNetTypeEnum restore_type = ObDagNetType::DAG_NET_TYPE_RESTORE;
|
const ObDagNetType::ObDagNetTypeEnum restore_type = ObDagNetType::DAG_NET_TYPE_RESTORE;
|
||||||
ObTenantDagScheduler *scheduler = nullptr;
|
ObTenantDagScheduler *scheduler = nullptr;
|
||||||
const int64_t restore_concurrency = GCONF.restore_concurrency;
|
int64_t restore_concurrency = 0;
|
||||||
|
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(MTL_ID()));
|
||||||
|
if (tenant_config.is_valid()) {
|
||||||
|
restore_concurrency = tenant_config->ha_high_thread_score;
|
||||||
|
}
|
||||||
|
if (0 == restore_concurrency) {
|
||||||
|
restore_concurrency = OB_DEFAULT_RESTORE_CONCURRENCY;
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_inited_) {
|
if (!is_inited_) {
|
||||||
ret = OB_NOT_INIT;
|
ret = OB_NOT_INIT;
|
||||||
@ -1352,7 +1359,6 @@ int ObILSRestoreState::check_restore_concurrency_limit_()
|
|||||||
const int64_t restore_dag_net_count = scheduler->get_dag_net_count(restore_type);
|
const int64_t restore_dag_net_count = scheduler->get_dag_net_count(restore_type);
|
||||||
|
|
||||||
if (restore_dag_net_count > restore_concurrency) {
|
if (restore_dag_net_count > restore_concurrency) {
|
||||||
//TODO(yanfeng) Here need same value with ObLSRestoreHandler to control limit in 4.1.
|
|
||||||
ret = OB_REACH_SERVER_DATA_COPY_IN_CONCURRENCY_LIMIT;
|
ret = OB_REACH_SERVER_DATA_COPY_IN_CONCURRENCY_LIMIT;
|
||||||
LOG_WARN("ls restore reach limit", K(ret), K(restore_concurrency), K(restore_dag_net_count));
|
LOG_WARN("ls restore reach limit", K(ret), K(restore_concurrency), K(restore_dag_net_count));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -161,7 +161,6 @@ rdma_io_thread_count
|
|||||||
recyclebin_object_expire_time
|
recyclebin_object_expire_time
|
||||||
redundancy_level
|
redundancy_level
|
||||||
resource_hard_limit
|
resource_hard_limit
|
||||||
restore_concurrency
|
|
||||||
rootservice_async_task_queue_size
|
rootservice_async_task_queue_size
|
||||||
rootservice_async_task_thread_count
|
rootservice_async_task_thread_count
|
||||||
rootservice_list
|
rootservice_list
|
||||||
|
|||||||
Reference in New Issue
Block a user