Fix ddl task hang after tenant becomes standby

This commit is contained in:
Hongqin-Li
2023-02-09 16:14:30 +00:00
committed by ob-robot
parent c9954939c3
commit 39085cc4c1
2 changed files with 6 additions and 1 deletions

View File

@ -624,7 +624,7 @@ void ObDDLScheduler::run1()
ObCurTraceId::set(task->get_trace_id());
int task_ret = task->process();
task->calc_next_schedule_ts(task_ret, task_queue_.get_task_cnt() + thread_cnt);
if (task->need_retry() && !has_set_stop()) {
if (task->need_retry() && !has_set_stop() && !ObIDDLTask::is_ddl_force_no_more_process(task_ret)) {
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));
}
@ -1511,6 +1511,7 @@ int ObDDLScheduler::recover_task()
if (OB_SUCCESS != tmp_ret) {
ret = (OB_SUCCESS == ret) ? tmp_ret : ret;
}
ret = OB_SUCCESS; // ignore ret
}
}
return ret;

View File

@ -64,6 +64,10 @@ public:
{
return common::OB_SERVER_OUTOF_DISK_SPACE == ret_code || common::OB_DISK_ERROR == ret_code;
}
static bool is_ddl_force_no_more_process(const int ret_code)
{
return common::OB_STANDBY_READ_ONLY == ret_code;
}
private:
static bool is_timeout(const int ret_code) {
return common::OB_TIMEOUT == ret_code || common::OB_TRANS_STMT_TIMEOUT == ret_code || common::OB_CONNECT_ERROR == ret_code