mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Repair problem exposed by Jan's new parallel-regression-test scaffold:
inval.c thought it could safely use the catcache to look up the OIDs of system relations. Not good, considering that inval.c could be called during catcache loading, if a shared-inval message arrives. Rip out the lookup logic and instead use the known OIDs from pg_class.h.
This commit is contained in:
16
src/backend/utils/cache/catcache.c
vendored
16
src/backend/utils/cache/catcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.52 1999/11/19 18:51:48 wieck Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.53 1999/11/21 01:58:22 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -819,7 +819,7 @@ InitSysCache(char *relname,
|
||||
* --------------------------------
|
||||
*/
|
||||
static HeapTuple
|
||||
SearchSelfReferences(const struct catcache * cache)
|
||||
SearchSelfReferences(struct catcache * cache)
|
||||
{
|
||||
HeapTuple ntp;
|
||||
Relation rel;
|
||||
@@ -983,23 +983,11 @@ SearchSysCache(struct catcache * cache,
|
||||
* ----------------
|
||||
*/
|
||||
|
||||
/* ----------
|
||||
* It is definitely insufficient. While modifying the regression
|
||||
* test to run independent tests concurrently it happened, that
|
||||
* this code fails VERY often. ISTM that 'cache' points into
|
||||
* shared memory, but that 'busy' means this backend is loading
|
||||
* a new entry. So when another backend has set busy, this one
|
||||
* think's it detected a recursion.
|
||||
*
|
||||
* Need's a smarter detection mechanism - Jan
|
||||
*
|
||||
if (cache->busy)
|
||||
{
|
||||
elog(ERROR, "SearchSysCache: recursive use of cache %d", cache->id);
|
||||
}
|
||||
cache->busy = true;
|
||||
* ----------
|
||||
*/
|
||||
|
||||
/* ----------------
|
||||
* open the relation associated with the cache
|
||||
|
||||
Reference in New Issue
Block a user