Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0b56be8

Browse files
committed
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.
1 parent 5725b9d commit 0b56be8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/backend/utils/cache/relcache.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.251 2006/12/23 00:43:11 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.252 2006/12/31 20:32:04 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2402,8 +2402,8 @@ RelationCacheInitializePhase2(void)
24022402

24032403
/*
24042404
* If we didn't get the critical system indexes loaded into relcache, do
2405-
* so now. These are critical because the catcache depends on them for
2406-
* catcache fetches that are done during relcache load. Thus, we have an
2405+
* so now. These are critical because the catcache and/or opclass cache
2406+
* depend on them for fetches done during relcache load. Thus, we have an
24072407
* infinite-recursion problem. We can break the recursion by doing
24082408
* heapscans instead of indexscans at certain key spots. To avoid hobbling
24092409
* performance, we only want to do that until we have the critical indexes
@@ -2439,13 +2439,14 @@ RelationCacheInitializePhase2(void)
24392439
LOAD_CRIT_INDEX(ClassOidIndexId);
24402440
LOAD_CRIT_INDEX(AttributeRelidNumIndexId);
24412441
LOAD_CRIT_INDEX(IndexRelidIndexId);
2442+
LOAD_CRIT_INDEX(OpclassOidIndexId);
24422443
LOAD_CRIT_INDEX(AccessMethodStrategyIndexId);
24432444
LOAD_CRIT_INDEX(AccessMethodProcedureIndexId);
24442445
LOAD_CRIT_INDEX(OperatorOidIndexId);
24452446
LOAD_CRIT_INDEX(RewriteRelRulenameIndexId);
24462447
LOAD_CRIT_INDEX(TriggerRelidNameIndexId);
24472448

2448-
#define NUM_CRITICAL_INDEXES 8 /* fix if you change list above */
2449+
#define NUM_CRITICAL_INDEXES 9 /* fix if you change list above */
24492450

24502451
criticalRelcachesBuilt = true;
24512452
}

0 commit comments

Comments
 (0)