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 ret = OB_SUCCESS;
ObPlanCache *lib_cache = MTL(ObPlanCache*);
if (OB_ISNULL(lib_cache)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid null plan cache", K(ret));
} else if (OB_FAIL(lib_cache->alloc_cache_obj(guard, ns, tenant_id))) {
LOG_WARN("failed to alloc cache obj", K(ret), K(ns));
MTL_SWITCH(tenant_id) {
ObPlanCache *lib_cache = MTL(ObPlanCache*);
if (OB_ISNULL(lib_cache)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid null plan cache", K(ret));
} 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;
}