[SCN] fix farm failure

This commit is contained in:
obdev
2022-11-28 02:58:33 +00:00
committed by ob-robot
parent 87a9357186
commit 51de5b5911
594 changed files with 9722 additions and 7770 deletions

View File

@ -328,15 +328,16 @@ void ObDDLScheduler::run1()
} else if (OB_ISNULL(task)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("error unexpected, task must not be NULL", K(ret));
} else if (task == first_retry_task) {
} else if (task == first_retry_task || !task->need_schedule()) {
// add the task back to the queue
if (OB_FAIL(task_queue_.add_task_to_last(task))) {
STORAGE_LOG(ERROR, "fail to add task to last, which should not happen", K(ret), K(*task));
STORAGE_LOG(ERROR, "fail to add task to last", K(ret), K(*task));
}
break;
} else {
ObCurTraceId::set(task->get_trace_id());
task->process();
int task_ret = task->process();
task->calc_next_schedule_ts(task_ret);
if (task->need_retry() && !has_set_stop()) {
if (OB_FAIL(task_queue_.add_task_to_last(task))) {
STORAGE_LOG(ERROR, "fail to add task to last, which should not happen", K(ret), K(*task));
@ -901,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));
@ -911,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));