From 3f311a0f55f1574e17196f26760c4cf13cb4cae4 Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 3 Apr 2023 21:49:39 +0000 Subject: [PATCH] fix abort_redef_table() did not handle the -4018 error code bug --- src/rootserver/ddl_task/ob_ddl_scheduler.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/rootserver/ddl_task/ob_ddl_scheduler.cpp b/src/rootserver/ddl_task/ob_ddl_scheduler.cpp index 3aa74b47d2..079a3bc048 100644 --- a/src/rootserver/ddl_task/ob_ddl_scheduler.cpp +++ b/src/rootserver/ddl_task/ob_ddl_scheduler.cpp @@ -978,6 +978,17 @@ int ObDDLScheduler::abort_redef_table(const ObDDLTaskID &task_id) return ret; }))) { LOG_WARN("failed to modify task", K(ret)); + if (OB_ENTRY_NOT_EXIST == ret) { + int tmp_ret = OB_SUCCESS; + ObSqlString sql_string; + if (OB_TMP_FAIL(ObDDLTaskRecordOperator::get_ddl_task_record(task_id.task_id_, root_service_->get_sql_proxy(), allocator, task_record))) { + LOG_WARN("get single ddl task failed", K(tmp_ret), K(task_id.task_id_)); + } else if (OB_TMP_FAIL(schedule_ddl_task(task_record))) { + LOG_WARN("failed to schedule ddl task", K(tmp_ret), K(task_record)); + } else { + ret = OB_SUCCESS; + } + } } else { redefinition_task.set_is_abort(true); if (OB_FAIL(update_task_info(task_id, trans, task_record, @@ -2022,6 +2033,9 @@ int ObDDLScheduler::inner_schedule_ddl_task(ObDDLTask *ddl_task) if (OB_ISNULL(ddl_task)) { ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid argument", K(ret), KP(ddl_task)); + } else if (!is_started_) { + ret = OB_NOT_RUNNING; + LOG_WARN("ddl schedule is not start", K(ret)); } else { int tmp_ret = OB_SUCCESS; bool longops_added = true;