fix drop index task continually reports 4007 when cancelling it.

This commit is contained in:
obdev
2022-11-08 07:35:36 +00:00
committed by wangzelin.wzl
parent 5a7d53fa60
commit e7d1b14fca
9 changed files with 24 additions and 13 deletions

View File

@ -685,6 +685,8 @@ int ObAlterTableExecutor::alter_table_rpc_v2(
const bool is_sync_ddl_user)
{
int ret = OB_SUCCESS;
// do not support cancel drop_index_task.
bool is_support_cancel = true;
const ObSArray<obrpc::ObIndexArg *> index_arg_list = alter_table_arg.index_arg_list_;
ObSArray<obrpc::ObIndexArg *> add_index_arg_list;
ObSArray<obrpc::ObIndexArg *> drop_index_args;
@ -714,6 +716,7 @@ int ObAlterTableExecutor::alter_table_rpc_v2(
} else {
ObDropIndexArg *drop_index_arg = static_cast<ObDropIndexArg *>(index_arg);
drop_index_arg->is_add_to_scheduler_ = true;
is_support_cancel = false;
}
} else { // for rename/drop index action
if (OB_FAIL(alter_table_arg.index_arg_list_.push_back(index_arg))) {
@ -744,7 +747,7 @@ int ObAlterTableExecutor::alter_table_rpc_v2(
ObIArray<obrpc::ObDDLRes> &ddl_ress = res.ddl_res_array_;
for (int64_t i = 0; OB_SUCC(ret) && i < ddl_ress.count(); ++i) {
ObDDLRes &ddl_res = ddl_ress.at(i);
if (OB_FAIL(ObDDLExecutorUtil::wait_ddl_finish(ddl_res.tenant_id_, ddl_res.task_id_, *my_session, common_rpc_proxy))) {
if (OB_FAIL(ObDDLExecutorUtil::wait_ddl_finish(ddl_res.tenant_id_, ddl_res.task_id_, *my_session, common_rpc_proxy, is_support_cancel))) {
LOG_WARN("wait drop index finish", K(ret));
}
}