|
|
|
|
@ -97,7 +97,7 @@ |
|
|
|
|
#define MAYBE_RECOVER_RELATION_BUILD_MEMORY 1 |
|
|
|
|
#else |
|
|
|
|
#define RECOVER_RELATION_BUILD_MEMORY 0 |
|
|
|
|
#ifdef CLOBBER_CACHE_ENABLED |
|
|
|
|
#ifdef DISCARD_CACHES_ENABLED |
|
|
|
|
#define MAYBE_RECOVER_RELATION_BUILD_MEMORY 1 |
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
@ -1011,10 +1011,10 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) |
|
|
|
|
* data, reasoning that the caller's context is at worst of transaction |
|
|
|
|
* scope, and relcache loads shouldn't happen so often that it's essential |
|
|
|
|
* to recover transient data before end of statement/transaction. However |
|
|
|
|
* that's definitely not true in clobber-cache test builds, and perhaps |
|
|
|
|
* it's not true in other cases. |
|
|
|
|
* that's definitely not true when debug_discard_caches is active, and |
|
|
|
|
* perhaps it's not true in other cases. |
|
|
|
|
* |
|
|
|
|
* When cache clobbering is enabled or when forced to by |
|
|
|
|
* When debug_discard_caches is active or when forced to by |
|
|
|
|
* RECOVER_RELATION_BUILD_MEMORY=1, arrange to allocate the junk in a |
|
|
|
|
* temporary context that we'll free before returning. Make it a child of |
|
|
|
|
* caller's context so that it will get cleaned up appropriately if we |
|
|
|
|
@ -1024,7 +1024,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt) |
|
|
|
|
MemoryContext tmpcxt = NULL; |
|
|
|
|
MemoryContext oldcxt = NULL; |
|
|
|
|
|
|
|
|
|
if (RECOVER_RELATION_BUILD_MEMORY || debug_invalidate_system_caches_always > 0) |
|
|
|
|
if (RECOVER_RELATION_BUILD_MEMORY || debug_discard_caches > 0) |
|
|
|
|
{ |
|
|
|
|
tmpcxt = AllocSetContextCreate(CurrentMemoryContext, |
|
|
|
|
"RelationBuildDesc workspace", |
|
|
|
|
@ -1627,11 +1627,10 @@ LookupOpclassInfo(Oid operatorClassOid, |
|
|
|
|
* otherwise. However it can be helpful for detecting bugs in the cache |
|
|
|
|
* loading logic itself, such as reliance on a non-nailed index. Given |
|
|
|
|
* the limited use-case and the fact that this adds a great deal of |
|
|
|
|
* expense, we enable it only for high values of |
|
|
|
|
* debug_invalidate_system_caches_always. |
|
|
|
|
* expense, we enable it only for high values of debug_discard_caches. |
|
|
|
|
*/ |
|
|
|
|
#ifdef CLOBBER_CACHE_ENABLED |
|
|
|
|
if (debug_invalidate_system_caches_always > 2) |
|
|
|
|
#ifdef DISCARD_CACHES_ENABLED |
|
|
|
|
if (debug_discard_caches > 2) |
|
|
|
|
opcentry->valid = false; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|