!2675 【轻量级 PR】:修复删除数据库后,backend id被复用导致的lsc资源清理时的core问题

Merge pull request !2675 from pengjiong/N/A
This commit is contained in:
opengauss-bot
2022-12-23 01:34:47 +00:00
committed by Gitee

View File

@ -121,7 +121,7 @@ void GlobalSysDBCache::FreeDeadDBs()
GlobalSysDBCacheEntry *dbEntry = (GlobalSysDBCacheEntry *)DLE_VAL(elt);
Assert(dbEntry->m_dbOid != InvalidOid);
/* refcount means ref may leak */
if (dbEntry->m_refcount != 0 && m_dbstat_manager.IsDBUsedByProc(dbEntry)) {
if (dbEntry->m_refcount != 0) {
GSC_CACHE1_elog("GlobalSysDBCacheEntry used can not be freed");
/* clear memory, this proc may exit, and forget to call releasedb */
dbEntry->ResetDBCache<false>();