2000-01-29:在适当的时候重建无效的relcache条目
今天,25 年前(PostgreSQL 7.0 开发周期),一项补丁被提交,确保具有正引用计数(refcount)的失效 relcache 条目被重建而不是被删除。
commit 04103e00f1f0ce12c29954d069e1d4437467f700 Author: Tom Lane <tgl@sss.pgh.pa.us> Date: Sat Jan 29 19:51:59 2000 +0000 Modify uses of RelationFlushRelation and RelationCacheInvalidate so that we *always* rebuild, rather than deleting, an invalidated relcache entry that has positive refcount. Otherwise an SI cache overrun leads to dangling Relation pointers all over the place!
这(大概)会导致内存泄漏。
几天后,在后续的提交(a152ebee)中,函数 RelationCacheInvalidate()
(src/backend/utils/cache/relcache.c)移除了其 "bool onlyFlushReferenceCountZero
" 参数。