allow schedule creating/deleting tablet to do restore

This commit is contained in:
hamstersox
2023-03-16 13:41:10 +00:00
committed by ob-robot
parent 842ac01444
commit 77f3afb799
3 changed files with 5 additions and 9 deletions

View File

@ -103,7 +103,7 @@ int ObPhysicalRestoreTenantExecutor::execute(
int ObPhysicalRestoreTenantExecutor::sync_wait_tenant_created_(ObExecContext &ctx, const ObString &tenant_name)
{
int ret = OB_SUCCESS;
const int64_t timeout = 3 * 60 * 1000 * 1000; // 3min
const int64_t timeout = 10 * 60 * 1000 * 1000; // 10min
const int64_t abs_timeout = ObTimeUtility::current_time() + timeout;
const int64_t cur_time_us = ObTimeUtility::current_time();
ObTimeoutCtx timeout_ctx;

View File

@ -1733,7 +1733,6 @@ int ObBackupTabletProvider::get_tablet_handle_(const uint64_t tenant_id, const s
ObLSHandle ls_handle;
ObLSService *ls_svr = NULL;
const int64_t timeout_us = ObTabletCommon::NO_CHECK_GET_TABLET_TIMEOUT_US;
ObTabletTxMultiSourceDataUnit tx_data;
if (OB_ISNULL(ls_svr = MTL(ObLSService *))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("MTL ObLSService is null", K(ret), K(tenant_id));
@ -1746,12 +1745,9 @@ int ObBackupTabletProvider::get_tablet_handle_(const uint64_t tenant_id, const s
LOG_WARN("failed to check ls valid for backup", K(ret), K(tenant_id), K(ls_id), K(rebuild_seq));
} else if (OB_FAIL(ls->get_tablet(tablet_id, tablet_handle, timeout_us))) {
LOG_WARN("failed to get tablet handle", K(ret), K(tenant_id), K(ls_id), K(tablet_id));
} else if (OB_FAIL(tablet_handle.get_obj()->get_tx_data(tx_data))) {
LOG_WARN("failed to get tx data", K(ret), K(tablet_handle));
} else if (ObTabletStatus::CREATING == tx_data.tablet_status_) {
} else if (ObTabletStatus::MAX == tablet_handle.get_obj()->get_tablet_meta().tx_data_.tablet_status_) {
ret = OB_EAGAIN;
// TODO(chongrong.th): open this later when fix support restore creating tablet
LOG_WARN("tablet still creating, try later", K(ret), K(tenant_id), K(ls_id), K(tablet_id), K(tx_data));
LOG_WARN("tablet meta still MAX, try later", K(ret), K(tenant_id), K(ls_id), K(tablet_id));
} else if (OB_FAIL(ObBackupUtils::check_ls_valid_for_backup(tenant_id, ls_id, rebuild_seq))) {
LOG_WARN("failed to check ls valid for backup", K(ret), K(tenant_id), K(ls_id), K(rebuild_seq));
}

View File

@ -977,7 +977,7 @@ int ObILSRestoreState::reload_tablet_()
ret = OB_INVALID_ARGUMENT;
LOG_WARN("ls_tablet_svr is nullptr", K(ret));
} else {
ObLSTabletIterator iterator(ObTabletCommon::DIRECT_GET_COMMITTED_TABLET_TIMEOUT_US);
ObLSTabletIterator iterator(ObTabletCommon::NO_CHECK_GET_TABLET_TIMEOUT_US);
if (OB_FAIL(ls_tablet_svr->build_tablet_iter(iterator))) {
LOG_WARN("fail to build tablet iterator", K(ret), KPC(ls_));
}
@ -1069,7 +1069,7 @@ int ObILSRestoreState::upload_wait_restore_tablet_()
int ret = OB_SUCCESS;
ObTabletHandle tablet_handle;
ObLSTabletService *ls_tablet_svr = nullptr;
ObLSTabletIterator iterator(ObTabletCommon::DIRECT_GET_COMMITTED_TABLET_TIMEOUT_US); // restore only needs to see the created tabelts
ObLSTabletIterator iterator(ObTabletCommon::NO_CHECK_GET_TABLET_TIMEOUT_US);
ObTablet *tablet = nullptr;
ObSArray<ObTabletID> tablet_ids;