Fix unexpected EAGAIN yield from autoinc service
This commit is contained in:
@ -169,11 +169,15 @@ int ObTabletAutoincMgr::fetch_new_range(const ObTabletAutoincParam ¶m,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OB_SUCCESS == tmp_ret) {
|
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;
|
++retry_times;
|
||||||
ob_usleep<common::ObWaitEventIds::STORAGE_AUTOINC_FETCH_RETRY_SLEEP>(RETRY_INTERVAL);
|
ob_usleep<common::ObWaitEventIds::STORAGE_AUTOINC_FETCH_RETRY_SLEEP>(RETRY_INTERVAL);
|
||||||
res.reset();
|
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));
|
LOG_WARN("fail to fetch autoinc cache for tablets", K(ret), K(retry_times), K(arg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,7 +85,6 @@ private:
|
|||||||
private:
|
private:
|
||||||
static const int64_t PREFETCH_THRESHOLD = 4;
|
static const int64_t PREFETCH_THRESHOLD = 4;
|
||||||
static const int64_t RETRY_INTERVAL = 100 * 1000L; // 100ms
|
static const int64_t RETRY_INTERVAL = 100 * 1000L; // 100ms
|
||||||
static const int64_t RETRY_TIMES_LIMIT = 10;
|
|
||||||
lib::ObMutex mutex_;
|
lib::ObMutex mutex_;
|
||||||
common::ObTabletID tablet_id_;
|
common::ObTabletID tablet_id_;
|
||||||
uint64_t next_value_;
|
uint64_t next_value_;
|
||||||
|
|||||||
Reference in New Issue
Block a user