Commit 0b56be83 authored by Tom Lane's avatar Tom Lane

Found the problem with my operator-family changes: by fetching from

pg_opclass during LookupOpclassInfo(), I'd turned pg_opclass_oid_index
into a critical system index.  However the problem could only manifest
during a backend's first attempt to load opclass data, and then only
if it had successfully loaded pg_internal.init and subsequently received
a relcache flush; which made it impossible to reproduce in sequential
tests and darn hard even in parallel tests.  Memo to self: when
exercising cache flush scenarios, must disable LookupOpclassInfo's
internal cache too.
parent 5725b9d9
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.251 2006/12/23 00:43:11 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.252 2006/12/31 20:32:04 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -2402,8 +2402,8 @@ RelationCacheInitializePhase2(void) ...@@ -2402,8 +2402,8 @@ RelationCacheInitializePhase2(void)
/* /*
* If we didn't get the critical system indexes loaded into relcache, do * If we didn't get the critical system indexes loaded into relcache, do
* so now. These are critical because the catcache depends on them for * so now. These are critical because the catcache and/or opclass cache
* catcache fetches that are done during relcache load. Thus, we have an * depend on them for fetches done during relcache load. Thus, we have an
* infinite-recursion problem. We can break the recursion by doing * infinite-recursion problem. We can break the recursion by doing
* heapscans instead of indexscans at certain key spots. To avoid hobbling * heapscans instead of indexscans at certain key spots. To avoid hobbling
* performance, we only want to do that until we have the critical indexes * performance, we only want to do that until we have the critical indexes
...@@ -2439,13 +2439,14 @@ RelationCacheInitializePhase2(void) ...@@ -2439,13 +2439,14 @@ RelationCacheInitializePhase2(void)
LOAD_CRIT_INDEX(ClassOidIndexId); LOAD_CRIT_INDEX(ClassOidIndexId);
LOAD_CRIT_INDEX(AttributeRelidNumIndexId); LOAD_CRIT_INDEX(AttributeRelidNumIndexId);
LOAD_CRIT_INDEX(IndexRelidIndexId); LOAD_CRIT_INDEX(IndexRelidIndexId);
LOAD_CRIT_INDEX(OpclassOidIndexId);
LOAD_CRIT_INDEX(AccessMethodStrategyIndexId); LOAD_CRIT_INDEX(AccessMethodStrategyIndexId);
LOAD_CRIT_INDEX(AccessMethodProcedureIndexId); LOAD_CRIT_INDEX(AccessMethodProcedureIndexId);
LOAD_CRIT_INDEX(OperatorOidIndexId); LOAD_CRIT_INDEX(OperatorOidIndexId);
LOAD_CRIT_INDEX(RewriteRelRulenameIndexId); LOAD_CRIT_INDEX(RewriteRelRulenameIndexId);
LOAD_CRIT_INDEX(TriggerRelidNameIndexId); LOAD_CRIT_INDEX(TriggerRelidNameIndexId);
#define NUM_CRITICAL_INDEXES 8 /* fix if you change list above */ #define NUM_CRITICAL_INDEXES 9 /* fix if you change list above */
criticalRelcachesBuilt = true; criticalRelcachesBuilt = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment