persist execution id and protect ddl start using execution id

This commit is contained in:
YoungYang0820
2022-11-17 06:35:42 +00:00
committed by wangzelin.wzl
parent 798d3f50d6
commit 6fc4bc4a26
24 changed files with 377 additions and 141 deletions

View File

@ -902,6 +902,7 @@ int ObDDLScheduler::recover_task()
const ObDDLTaskRecord &cur_record = task_records.at(i);
int64_t tenant_schema_version = 0;
int64_t table_task_status = 0;
int64_t execution_id = 0;
ObMySQLTransaction trans;
if (OB_FAIL(schema_service.get_tenant_schema_version(cur_record.tenant_id_, tenant_schema_version))) {
LOG_WARN("failed to get tenant schema version", K(ret), K(cur_record));
@ -912,7 +913,8 @@ int ObDDLScheduler::recover_task()
} else if (OB_FAIL(ObDDLTaskRecordOperator::select_for_update(trans,
cur_record.tenant_id_,
cur_record.task_id_,
table_task_status))) {
table_task_status,
execution_id))) {
LOG_WARN("select for update failed", K(ret), K(cur_record));
} else if (OB_FAIL(schedule_ddl_task(cur_record))) {
LOG_WARN("failed to schedule ddl task", K(ret), K(cur_record));
@ -1111,6 +1113,8 @@ int ObDDLScheduler::schedule_column_redefinition_task(const ObDDLTaskRecord &tas
if (OB_ENTRY_EXIST != ret) {
LOG_WARN("inner schedule task failed", K(ret), K(*redefinition_task));
}
} else if (OB_FAIL(redefinition_task->push_execution_id())) {
LOG_WARN("failed to push execution id", K(ret));
}
if (OB_FAIL(ret) && nullptr != redefinition_task) {
redefinition_task->~ObColumnRedefinitionTask();