提交 eaa9c2c1 编写于 作者: O obdev 提交者: wangzelin.wzl

[CP] fix backup clean status does not advance when error during DOING

上级 1ad2554d
......@@ -169,6 +169,11 @@ void ObBackupDataClean::run3()
}
set_inner_error(ret);
if (OB_SUCCESS != inner_error_) {
if (OB_FAIL(update_sys_clean_info())) {
LOG_WARN("failed to update sys clean info", K(ret), K(inner_error_));
}
}
cleanup_prepared_infos();
if (OB_FAIL(idle())) {
......@@ -181,6 +186,22 @@ void ObBackupDataClean::run3()
is_working_ = false;
}
int ObBackupDataClean::update_sys_clean_info()
{
int ret = OB_SUCCESS;
ObBackupCleanInfo sys_clean_info;
if (OB_FAIL(get_backup_clean_info(OB_SYS_TENANT_ID, sys_clean_info))) {
LOG_WARN("failed to get sys clean info", K(ret), K(sys_clean_info));
} else if (ObBackupCleanInfoStatus::DOING != sys_clean_info.status_) {
// do nothing
} else if (FALSE_IT(sys_clean_info.result_ = inner_error_)) {
} else if (OB_FAIL(
ObTenantBackupCleanInfoOperator::update_clean_info(OB_SYS_TENANT_ID, sys_clean_info, *sql_proxy_))) {
LOG_WARN("failed to update sys clean info result", K(ret), K(sys_clean_info));
}
return ret;
}
int ObBackupDataClean::get_need_clean_tenants(ObIArray<ObBackupDataCleanTenant> &clean_tenants)
{
int ret = OB_SUCCESS;
......
......@@ -259,6 +259,7 @@ private:
int touch_extern_tenant_name(const ObBackupDataCleanTenant &clean_tenant);
int touch_extern_clog_info(const ObBackupDataCleanTenant &clean_tenant);
void set_inner_error(const int32_t result);
int update_sys_clean_info();
int add_log_archive_infos(
const common::ObIArray<ObLogArchiveBackupInfo> &log_archive_infos, ObBackupDataCleanTenant &clean_tenant);
int add_log_archive_info(const ObLogArchiveBackupInfo &log_archive_info, ObBackupDataCleanTenant &clean_tenant);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册