add retry when tablet autoinc seq -4023

This commit is contained in:
YoungYang0820 2022-11-07 05:08:01 +00:00 committed by wangzelin.wzl
parent a1f368d6b9
commit 304544f46f
2 changed files with 3 additions and 1 deletions

View File

@ -252,6 +252,8 @@ int ObTabletAutoincrementService::get_autoinc_seq(const uint64_t tenant_id, cons
}
if (OB_SUCC(ret)) {
ObTabletCacheInterval interval(tablet_id, 1/*cache size*/);
lib::ObMutex &mutex = init_node_mutexs_[tablet_id.id() % INIT_NODE_MUTEX_NUM];
lib::ObMutexGuard guard(mutex);
if (OB_ISNULL(autoinc_mgr)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("autoinc mgr is unexpected null", K(ret));

View File

@ -110,7 +110,7 @@ private:
private:
typedef common::ObLinkHashMap<ObTabletAutoincKey, ObTabletAutoincMgr> TabletAutoincMgrMap;
const static int INIT_NODE_MUTEX_NUM = 1024;
const static int INIT_NODE_MUTEX_NUM = 10243L;
bool is_inited_;
common::ObSmallAllocator node_allocator_;
TabletAutoincMgrMap tablet_autoinc_mgr_map_;