1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Rename debug_invalidate_system_caches_always to debug_discard_caches.

The name introduced by commit 4656e3d66 was agreed to be unreasonably
long.  To match this change, rename initdb's recently-added
--clobber-cache option to --discard-caches.

Discussion: https://postgr.es/m/1374320.1625430433@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2021-07-13 15:01:01 -04:00
parent e0271d5f1e
commit d68a003912
19 changed files with 94 additions and 96 deletions

View File

@ -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