[CP] fix high cpu usage of backup service during restart

This commit is contained in:
wxhwang
2023-11-28 14:41:57 +00:00
committed by ob-robot
parent 3038a7794c
commit 41fb7a667b
2 changed files with 7 additions and 2 deletions

View File

@ -61,10 +61,11 @@ int ObBackupBaseService::create(const char* thread_name, ObBackupBaseService &te
} else if (OB_FAIL(thread_cond_.init(event_no))) {
LOG_WARN("fail to init thread cond", K(ret), K(event_no));
} else {
stop();
thread_name_ = thread_name;
wakeup_cnt_ = 0;
is_created_ = true;
stop();
LOG_INFO("[BACKUP_SERVICE] thread create", K(tg_id_), K(thread_name_));
}
return ret;
}

View File

@ -88,8 +88,8 @@ void ObBackupService::run2()
if (can_schedule()) {
process(last_trigger_ts);
} else {
LOG_INFO("backup service is disable, need wait.");
task_scheduler_->wakeup();
wakeup();
}
}
idle();
@ -147,6 +147,8 @@ int ObBackupDataService::sub_init(
LOG_WARN("fail to init backup data scheduler", K(ret));
} else if (OB_FAIL(create("BackupDataSrv", *this, ObWaitEventIds::BACKUP_DATA_SERVICE_COND_WAIT))) {
LOG_WARN("failed to create backup data service", K(ret));
} else {
LOG_INFO("ObBackupDataService init", K(tenant_id));
}
return ret;
}
@ -248,6 +250,8 @@ int ObBackupCleanService::sub_init(
LOG_WARN("fail to regist job", K(ret), "job_type", backup_auto_obsolete_delete_trigger_.get_trigger_type());
} else if (OB_FAIL(create("BackupCleanSrv", *this, ObWaitEventIds::BACKUP_CLEAN_SERVICE_COND_WAIT))) {
LOG_WARN("create BackupService thread failed", K(ret));
} else {
LOG_INFO("ObBackupCleanService init", K(tenant_id));
}
return ret;
}