[CP] fix recover table when create tmp table failed

This commit is contained in:
obdev
2023-09-18 07:48:19 +00:00
committed by ob-robot
parent 36b219a97f
commit fe06884eaa
8 changed files with 32 additions and 5 deletions

View File

@ -260,7 +260,8 @@ DEF_TO_STRING(ObPhysicalRestoreJob)
K_(concurrency),
K_(passwd_array),
K_(multi_restore_path_list),
K_(white_list)
K_(white_list),
K_(recover_table)
);
J_OBJ_END();
return pos;
@ -288,6 +289,7 @@ int ObPhysicalRestoreJob::assign(const ObPhysicalRestoreJob &other)
compatible_ = other.compatible_;
kms_encrypt_ = other.kms_encrypt_;
concurrency_ = other.concurrency_;
recover_table_ = other.recover_table_;
if (FAILEDx(deep_copy_ob_string(allocator_, other.comment_, comment_))) {
LOG_WARN("failed to copy string", KR(ret), K(other));
@ -362,6 +364,7 @@ void ObPhysicalRestoreJob::reset()
kms_dest_.reset();
kms_encrypt_key_.reset();
concurrency_ = 0;
recover_table_ = false;
passwd_array_.reset();

View File

@ -186,6 +186,7 @@ public:
Property_declare_ObString(kms_encrypt_key)
Property_declare_ObString(passwd_array)
Property_declare_int(int64_t, concurrency)
Property_declare_int(bool, recover_table)
private:
//job_id and tenant_id in __all_restore_job primary_key

View File

@ -262,6 +262,7 @@ int ObPhysicalRestoreTableOperator::fill_dml_splicer(
ADD_COLUMN_MACRO_IN_TABLE_OPERATOR(job_info, compatible);
ADD_COLUMN_MACRO_IN_TABLE_OPERATOR(job_info, passwd_array);
ADD_COLUMN_MACRO_IN_TABLE_OPERATOR(job_info, concurrency);
ADD_COLUMN_MACRO_IN_TABLE_OPERATOR(job_info, recover_table);
// source_cluster_version
if (OB_SUCC(ret)) {
@ -538,6 +539,18 @@ int ObPhysicalRestoreTableOperator::retrieve_restore_option(
}
}
}
if (OB_SUCC(ret)) {
if (name == "recover_table") {
int64_t recover_table = 0;
if (OB_FAIL(retrieve_int_value(result, recover_table))) {
LOG_WARN("fail to retrive int value", K(ret), "column_name", "recover_table");
} else {
job.set_recover_table(recover_table != 0);
}
}
}
if (OB_SUCC(ret)) {
if (name == "restore_type") {
uint64_t restore_type = 0;