Fix unexpected EAGAIN yield from autoinc service

This commit is contained in:
Hongqin-Li
2022-12-12 07:11:36 +00:00
committed by ob-robot
parent b00f22171f
commit 8445ee9e28
2 changed files with 6 additions and 3 deletions

View File

@ -169,11 +169,15 @@ int ObTabletAutoincMgr::fetch_new_range(const ObTabletAutoincParam &param,
}
}
if (OB_SUCCESS == tmp_ret) {
while (OB_FAIL(ret) && is_retryable(ret) && retry_times < RETRY_TIMES_LIMIT) {
bool worker_err = false;
while (OB_FAIL(ret) && !worker_err && is_retryable(ret)) {
++retry_times;
ob_usleep<common::ObWaitEventIds::STORAGE_AUTOINC_FETCH_RETRY_SLEEP>(RETRY_INTERVAL);
res.reset();
if (OB_FAIL(srv_rpc_proxy->to(leader_addr).fetch_tablet_autoinc_seq_cache(arg, res))) {
if (OB_FAIL(THIS_WORKER.check_status())) {
worker_err = true;
LOG_WARN("failed to check status", K(ret));
} else if (OB_FAIL(srv_rpc_proxy->to(leader_addr).fetch_tablet_autoinc_seq_cache(arg, res))) {
LOG_WARN("fail to fetch autoinc cache for tablets", K(ret), K(retry_times), K(arg));
}
}

View File

@ -85,7 +85,6 @@ private:
private:
static const int64_t PREFETCH_THRESHOLD = 4;
static const int64_t RETRY_INTERVAL = 100 * 1000L; // 100ms
static const int64_t RETRY_TIMES_LIMIT = 10;
lib::ObMutex mutex_;
common::ObTabletID tablet_id_;
uint64_t next_value_;