Fix forgot to switch status and errcode overwrite
This commit is contained in:
committed by
wangzelin.wzl
parent
8aa5f18458
commit
9875d0330c
@ -419,6 +419,7 @@ int ObColumnRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
|
|||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
ObRootService *root_service = GCTX.root_service_;
|
ObRootService *root_service = GCTX.root_service_;
|
||||||
int64_t finished_task_cnt = 0;
|
int64_t finished_task_cnt = 0;
|
||||||
|
bool state_finish = false;
|
||||||
ObSchemaGetterGuard schema_guard;
|
ObSchemaGetterGuard schema_guard;
|
||||||
if (OB_UNLIKELY(!is_inited_)) {
|
if (OB_UNLIKELY(!is_inited_)) {
|
||||||
ret = OB_NOT_INIT;
|
ret = OB_NOT_INIT;
|
||||||
@ -436,7 +437,11 @@ int ObColumnRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
|
|||||||
} else if (OB_FAIL(copy_table_foreign_keys())) {
|
} else if (OB_FAIL(copy_table_foreign_keys())) {
|
||||||
LOG_WARN("fail to copy table foreign keys", K(ret));
|
LOG_WARN("fail to copy table foreign keys", K(ret));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OB_FAIL(ret)) {
|
||||||
|
state_finish = true;
|
||||||
|
} else {
|
||||||
// wait copy dependent objects to be finished
|
// wait copy dependent objects to be finished
|
||||||
ObAddr unused_addr;
|
ObAddr unused_addr;
|
||||||
for (common::hash::ObHashMap<ObDDLTaskKey, DependTaskStatus>::const_iterator iter = dependent_task_result_map_.begin();
|
for (common::hash::ObHashMap<ObDDLTaskKey, DependTaskStatus>::const_iterator iter = dependent_task_result_map_.begin();
|
||||||
@ -471,8 +476,11 @@ int ObColumnRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (finished_task_cnt == dependent_task_result_map_.size()) {
|
if (finished_task_cnt == dependent_task_result_map_.size()) {
|
||||||
|
state_finish = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (state_finish) {
|
||||||
if (OB_FAIL(switch_status(next_task_status, ret))) {
|
if (OB_FAIL(switch_status(next_task_status, ret))) {
|
||||||
LOG_WARN("fail to switch status", K(ret));
|
LOG_WARN("fail to switch status", K(ret));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -524,6 +524,7 @@ int ObTableRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
|
|||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
ObRootService *root_service = GCTX.root_service_;
|
ObRootService *root_service = GCTX.root_service_;
|
||||||
int64_t finished_task_cnt = 0;
|
int64_t finished_task_cnt = 0;
|
||||||
|
bool state_finish = false;
|
||||||
if (OB_UNLIKELY(!is_inited_)) {
|
if (OB_UNLIKELY(!is_inited_)) {
|
||||||
ret = OB_NOT_INIT;
|
ret = OB_NOT_INIT;
|
||||||
LOG_WARN("ObTableRedefinitionTask has not been inited", K(ret));
|
LOG_WARN("ObTableRedefinitionTask has not been inited", K(ret));
|
||||||
@ -541,7 +542,12 @@ int ObTableRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
|
|||||||
LOG_WARN("copy table foreign keys failed", K(ret));
|
LOG_WARN("copy table foreign keys failed", K(ret));
|
||||||
} else {
|
} else {
|
||||||
// copy triggers(at current, not supported, skip it)
|
// copy triggers(at current, not supported, skip it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OB_FAIL(ret)) {
|
||||||
|
state_finish = true;
|
||||||
|
} else {
|
||||||
// wait copy dependent objects to be finished
|
// wait copy dependent objects to be finished
|
||||||
ObAddr unused_addr;
|
ObAddr unused_addr;
|
||||||
for (common::hash::ObHashMap<ObDDLTaskKey, DependTaskStatus>::const_iterator iter = dependent_task_result_map_.begin();
|
for (common::hash::ObHashMap<ObDDLTaskKey, DependTaskStatus>::const_iterator iter = dependent_task_result_map_.begin();
|
||||||
@ -577,12 +583,14 @@ int ObTableRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (finished_task_cnt == dependent_task_result_map_.size()) {
|
if (finished_task_cnt == dependent_task_result_map_.size()) {
|
||||||
|
state_finish = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (state_finish) {
|
||||||
if (OB_FAIL(switch_status(next_task_status, ret))) {
|
if (OB_FAIL(switch_status(next_task_status, ret))) {
|
||||||
LOG_WARN("fail to switch status", K(ret));
|
LOG_WARN("fail to switch status", K(ret));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user