1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-12 15:23:02 +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

@@ -182,7 +182,7 @@ static int numSharedInvalidMessagesArray;
static int maxSharedInvalidMessagesArray;
/* GUC storage */
int debug_invalidate_system_caches_always = 0;
int debug_discard_caches = 0;
/*
* Dynamically-registered callback functions. Current implementation
@@ -690,7 +690,7 @@ AcceptInvalidationMessages(void)
ReceiveSharedInvalidMessages(LocalExecuteInvalidationMessage,
InvalidateSystemCaches);
/*
/*----------
* Test code to force cache flushes anytime a flush could happen.
*
* This helps detect intermittent faults caused by code that reads a cache
@@ -698,28 +698,28 @@ AcceptInvalidationMessages(void)
* rarely actually does so. This can spot issues that would otherwise
* only arise with badly timed concurrent DDL, for example.
*
* The default debug_invalidate_system_caches_always = 0 does no forced
* cache flushes.
* The default debug_discard_caches = 0 does no forced cache flushes.
*
* If used with CLOBBER_FREED_MEMORY,
* debug_invalidate_system_caches_always = 1 (CLOBBER_CACHE_ALWAYS)
* debug_discard_caches = 1 (formerly known as CLOBBER_CACHE_ALWAYS)
* provides a fairly thorough test that the system contains no cache-flush
* hazards. However, it also makes the system unbelievably slow --- the
* regression tests take about 100 times longer than normal.
*
* If you're a glutton for punishment, try
* debug_invalidate_system_caches_always = 3 (CLOBBER_CACHE_RECURSIVELY).
* debug_discard_caches = 3 (formerly known as CLOBBER_CACHE_RECURSIVELY).
* This slows things by at least a factor of 10000, so I wouldn't suggest
* trying to run the entire regression tests that way. It's useful to try
* a few simple tests, to make sure that cache reload isn't subject to
* internal cache-flush hazards, but after you've done a few thousand
* recursive reloads it's unlikely you'll learn more.
*----------
*/
#ifdef CLOBBER_CACHE_ENABLED
#ifdef DISCARD_CACHES_ENABLED
{
static int recursion_depth = 0;
if (recursion_depth < debug_invalidate_system_caches_always)
if (recursion_depth < debug_discard_caches)
{
recursion_depth++;
InvalidateSystemCaches();