fix plan cache core because tid not conisistent when alloc and free

This commit is contained in:
obdev
2023-05-23 03:17:15 +00:00
committed by ob-robot
parent 2876cc28d2
commit 3575e799d3

View File

@ -35,12 +35,14 @@ namespace sql
int ObCacheObjectFactory::alloc(ObCacheObjGuard& guard, ObLibCacheNameSpace ns, uint64_t tenant_id) int ObCacheObjectFactory::alloc(ObCacheObjGuard& guard, ObLibCacheNameSpace ns, uint64_t tenant_id)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
ObPlanCache *lib_cache = MTL(ObPlanCache*); MTL_SWITCH(tenant_id) {
if (OB_ISNULL(lib_cache)) { ObPlanCache *lib_cache = MTL(ObPlanCache*);
ret = OB_INVALID_ARGUMENT; if (OB_ISNULL(lib_cache)) {
LOG_WARN("invalid null plan cache", K(ret)); ret = OB_INVALID_ARGUMENT;
} else if (OB_FAIL(lib_cache->alloc_cache_obj(guard, ns, tenant_id))) { LOG_WARN("invalid null plan cache", K(ret));
LOG_WARN("failed to alloc cache obj", K(ret), K(ns)); } else if (OB_FAIL(lib_cache->alloc_cache_obj(guard, ns, tenant_id))) {
LOG_WARN("failed to alloc cache obj", K(ret), K(ns));
}
} }
return ret; return ret;
} }