Retry for OB_LS_NOT_EXIST and OB_TABLET_NOT_EXIST when fetching tablet autoinc

This commit is contained in:
Hongqin-Li 2023-08-14 10:12:33 +00:00 committed by ob-robot
parent fa890b6e50
commit 0c22a02c2b
2 changed files with 2 additions and 2 deletions

View File

@ -160,7 +160,7 @@ int ObTabletAutoincMgr::fetch_new_range(const ObTabletAutoincParam &param,
finish = true;
}
if (OB_FAIL(ret) && is_retryable(ret)) {
const bool need_refresh_leader = OB_NOT_MASTER == ret;
const bool need_refresh_leader = OB_NOT_MASTER == ret || OB_LS_NOT_EXIST == ret || OB_TABLET_NOT_EXIST == ret;
ob_usleep<common::ObWaitEventIds::STORAGE_AUTOINC_FETCH_RETRY_SLEEP>(RETRY_INTERVAL);
res.reset();
if (OB_FAIL(THIS_WORKER.check_status())) { // overwrite ret

View File

@ -80,7 +80,7 @@ private:
}
bool is_retryable(int ret)
{
return OB_NOT_MASTER == ret || OB_NOT_INIT == ret || OB_TIMEOUT == ret || OB_EAGAIN == ret;
return OB_NOT_MASTER == ret || OB_NOT_INIT == ret || OB_TIMEOUT == ret || OB_EAGAIN == ret || OB_LS_NOT_EXIST == ret || OB_TABLET_NOT_EXIST == ret;
}
private:
static const int64_t PREFETCH_THRESHOLD = 4;