Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd68a003

Browse files
committed
Rename debug_invalidate_system_caches_always to debug_discard_caches.
The name introduced by commit4656e3d was agreed to be unreasonablylong. 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
1 parente0271d5 commitd68a003

File tree

19 files changed

+94
-96
lines changed

19 files changed

+94
-96
lines changed

‎contrib/postgres_fdw/expected/postgres_fdw.out‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9340,11 +9340,11 @@ WARNING: there is no transaction in progress
93409340
-- Change application_name of remote connection to special one
93419341
-- so that we can easily terminate the connection later.
93429342
ALTER SERVER loopback OPTIONS (application_name 'fdw_retry_check');
9343-
-- Ifdebug_invalidate_system_caches_always is active, it results in
9343+
-- Ifdebug_discard_caches is active, it results in
93449344
-- dropping remote connections after every transaction, making it
93459345
-- impossible to test termination meaningfully. So turn that off
93469346
-- for this test.
9347-
SETdebug_invalidate_system_caches_always = 0;
9347+
SETdebug_discard_caches = 0;
93489348
-- Make sure we have a remote connection.
93499349
SELECT 1 FROM ft1 LIMIT 1;
93509350
?column?
@@ -9386,7 +9386,7 @@ SELECT 1 FROM ft1 LIMIT 1; -- should fail
93869386
ERROR: 08006
93879387
\set VERBOSITY default
93889388
COMMIT;
9389-
RESETdebug_invalidate_system_caches_always;
9389+
RESETdebug_discard_caches;
93909390
-- =============================================================================
93919391
-- test connection invalidation cases and postgres_fdw_get_connections function
93929392
-- =============================================================================

‎contrib/postgres_fdw/sql/postgres_fdw.sql‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,11 +2831,11 @@ ROLLBACK;
28312831
-- so that we can easily terminate the connection later.
28322832
ALTER SERVER loopback OPTIONS (application_name'fdw_retry_check');
28332833

2834-
-- Ifdebug_invalidate_system_caches_always is active, it results in
2834+
-- Ifdebug_discard_caches is active, it results in
28352835
-- dropping remote connections after every transaction, making it
28362836
-- impossible to test termination meaningfully. So turn that off
28372837
-- for this test.
2838-
SETdebug_invalidate_system_caches_always=0;
2838+
SETdebug_discard_caches=0;
28392839

28402840
-- Make sure we have a remote connection.
28412841
SELECT1FROM ft1LIMIT1;
@@ -2861,7 +2861,7 @@ SELECT 1 FROM ft1 LIMIT 1; -- should fail
28612861
\set VERBOSITY default
28622862
COMMIT;
28632863

2864-
RESETdebug_invalidate_system_caches_always;
2864+
RESETdebug_discard_caches;
28652865

28662866
-- =============================================================================
28672867
-- test connection invalidation cases and postgres_fdw_get_connections function

‎doc/src/sgml/config.sgml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10341,10 +10341,10 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
1034110341
</listitem>
1034210342
</varlistentry>
1034310343

10344-
<varlistentry id="guc-debug-invalidate-system-caches-always" xreflabel="debug_invalidate_system_caches_always">
10345-
<term><varname>debug_invalidate_system_caches_always</varname> (<type>integer</type>)
10344+
<varlistentry id="guc-debug-discard-caches" xreflabel="debug_discard_caches">
10345+
<term><varname>debug_discard_caches</varname> (<type>integer</type>)
1034610346
<indexterm>
10347-
<primary><varname>debug_invalidate_system_caches_always</varname> configuration parameter</primary>
10347+
<primary><varname>debug_discard_caches</varname> configuration parameter</primary>
1034810348
</indexterm>
1034910349
</term>
1035010350
<listitem>
@@ -10369,7 +10369,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
1036910369

1037010370
<para>
1037110371
This parameter is supported when
10372-
<symbol>CLOBBER_CACHE_ENABLED</symbol> was defined at compile time
10372+
<symbol>DISCARD_CACHES_ENABLED</symbol> was defined at compile time
1037310373
(which happens automatically when using the
1037410374
<application>configure</application> option
1037510375
<option>--enable-cassert</option>). In production builds, its value

‎doc/src/sgml/ref/initdb.sgml‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -388,17 +388,6 @@ PostgreSQL documentation
388388
Other, less commonly used, options are also available:
389389

390390
<variablelist>
391-
<varlistentry>
392-
<term><option>--clobber-cache</option></term>
393-
<listitem>
394-
<para>
395-
Run the bootstrap backend with the
396-
<literal>debug_invalidate_system_caches_always=1</literal> option.
397-
This takes a very long time and is only of use for deep debugging.
398-
</para>
399-
</listitem>
400-
</varlistentry>
401-
402391
<varlistentry>
403392
<term><option>-d</option></term>
404393
<term><option>--debug</option></term>
@@ -413,6 +402,17 @@ PostgreSQL documentation
413402
</listitem>
414403
</varlistentry>
415404

405+
<varlistentry>
406+
<term><option>--discard-caches</option></term>
407+
<listitem>
408+
<para>
409+
Run the bootstrap backend with the
410+
<literal>debug_discard_caches=1</literal> option.
411+
This takes a very long time and is only of use for deep debugging.
412+
</para>
413+
</listitem>
414+
</varlistentry>
415+
416416
<varlistentry>
417417
<term><option>-L <replaceable class="parameter">directory</replaceable></option></term>
418418
<listitem>

‎doc/src/sgml/regress.sgml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ make check EXTRA_REGRESS_OPTS="--temp-config=test_postgresql.conf"
373373
<para>
374374
This can be useful to enable additional logging, adjust resource limits,
375375
or enable extra run-time checks such as <xref
376-
linkend="guc-debug-invalidate-system-caches-always"/>.
376+
linkend="guc-debug-discard-caches"/>.
377377
</para>
378378
</sect2>
379379

‎src/backend/utils/adt/lockfuncs.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,10 @@ pg_isolation_test_session_is_blocked(PG_FUNCTION_ARGS)
636636
* Check if any of these are in the list of interesting PIDs, that being
637637
* the sessions that the isolation tester is running. We don't use
638638
* "arrayoverlaps" here, because it would lead to cache lookups and one of
639-
* our goals is to run quickly withdebug_invalidate_system_caches_always
640-
*> 0. We expectblocking_pids to be usually empty and otherwise a very
641-
*small number inisolation tester cases, so make that the outer loop of
642-
*a naive searchfor a match.
639+
* our goals is to run quickly withdebug_discard_caches > 0. We expect
640+
* blocking_pids to be usually empty and otherwise a very small number in
641+
* isolation tester cases, so make that the outer loop of a naive search
642+
* for a match.
643643
*/
644644
for (i=0;i<num_blocking_pids;i++)
645645
for (j=0;j<num_interesting_pids;j++)

‎src/backend/utils/cache/inval.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static intnumSharedInvalidMessagesArray;
182182
staticintmaxSharedInvalidMessagesArray;
183183

184184
/* GUC storage */
185-
intdebug_invalidate_system_caches_always=0;
185+
intdebug_discard_caches=0;
186186

187187
/*
188188
* Dynamically-registered callback functions. Current implementation
@@ -690,36 +690,36 @@ AcceptInvalidationMessages(void)
690690
ReceiveSharedInvalidMessages(LocalExecuteInvalidationMessage,
691691
InvalidateSystemCaches);
692692

693-
/*
693+
/*----------
694694
* Test code to force cache flushes anytime a flush could happen.
695695
*
696696
* This helps detect intermittent faults caused by code that reads a cache
697697
* entry and then performs an action that could invalidate the entry, but
698698
* rarely actually does so. This can spot issues that would otherwise
699699
* only arise with badly timed concurrent DDL, for example.
700700
*
701-
* The default debug_invalidate_system_caches_always = 0 does no forced
702-
* cache flushes.
701+
* The default debug_discard_caches = 0 does no forced cache flushes.
703702
*
704703
* If used with CLOBBER_FREED_MEMORY,
705-
*debug_invalidate_system_caches_always = 1 (CLOBBER_CACHE_ALWAYS)
704+
*debug_discard_caches = 1 (formerly known asCLOBBER_CACHE_ALWAYS)
706705
* provides a fairly thorough test that the system contains no cache-flush
707706
* hazards. However, it also makes the system unbelievably slow --- the
708707
* regression tests take about 100 times longer than normal.
709708
*
710709
* If you're a glutton for punishment, try
711-
*debug_invalidate_system_caches_always = 3 (CLOBBER_CACHE_RECURSIVELY).
710+
*debug_discard_caches = 3 (formerly known asCLOBBER_CACHE_RECURSIVELY).
712711
* This slows things by at least a factor of 10000, so I wouldn't suggest
713712
* trying to run the entire regression tests that way. It's useful to try
714713
* a few simple tests, to make sure that cache reload isn't subject to
715714
* internal cache-flush hazards, but after you've done a few thousand
716715
* recursive reloads it's unlikely you'll learn more.
716+
*----------
717717
*/
718-
#ifdefCLOBBER_CACHE_ENABLED
718+
#ifdefDISCARD_CACHES_ENABLED
719719
{
720720
staticintrecursion_depth=0;
721721

722-
if (recursion_depth<debug_invalidate_system_caches_always)
722+
if (recursion_depth<debug_discard_caches)
723723
{
724724
recursion_depth++;
725725
InvalidateSystemCaches();

‎src/backend/utils/cache/plancache.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -897,9 +897,8 @@ BuildCachedPlan(CachedPlanSource *plansource, List *qlist,
897897
* rejected a generic plan, it's possible to reach here with is_valid
898898
* false due to an invalidation while making the generic plan. In theory
899899
* the invalidation must be a false positive, perhaps a consequence of an
900-
* sinval reset event or the debug_invalidate_system_caches_always code.
901-
* But for safety, let's treat it as real and redo the
902-
* RevalidateCachedQuery call.
900+
* sinval reset event or the debug_discard_caches code. But for safety,
901+
* let's treat it as real and redo the RevalidateCachedQuery call.
903902
*/
904903
if (!plansource->is_valid)
905904
qlist=RevalidateCachedQuery(plansource,queryEnv);

‎src/backend/utils/cache/relcache.c‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
#defineMAYBE_RECOVER_RELATION_BUILD_MEMORY 1
9898
#else
9999
#defineRECOVER_RELATION_BUILD_MEMORY 0
100-
#ifdefCLOBBER_CACHE_ENABLED
100+
#ifdefDISCARD_CACHES_ENABLED
101101
#defineMAYBE_RECOVER_RELATION_BUILD_MEMORY 1
102102
#endif
103103
#endif
@@ -1011,10 +1011,10 @@ RelationBuildDesc(Oid targetRelId, bool insertIt)
10111011
* data, reasoning that the caller's context is at worst of transaction
10121012
* scope, and relcache loads shouldn't happen so often that it's essential
10131013
* to recover transient data before end of statement/transaction. However
1014-
* that's definitely not truein clobber-cache test builds, and perhaps
1015-
* it's not true in other cases.
1014+
* that's definitely not truewhen debug_discard_caches is active, and
1015+
*perhapsit's not true in other cases.
10161016
*
1017-
* Whencache clobberingisenabled or when forced to by
1017+
* Whendebug_discard_cachesisactive or when forced to by
10181018
* RECOVER_RELATION_BUILD_MEMORY=1, arrange to allocate the junk in a
10191019
* temporary context that we'll free before returning. Make it a child of
10201020
* caller's context so that it will get cleaned up appropriately if we
@@ -1024,7 +1024,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt)
10241024
MemoryContexttmpcxt=NULL;
10251025
MemoryContextoldcxt=NULL;
10261026

1027-
if (RECOVER_RELATION_BUILD_MEMORY||debug_invalidate_system_caches_always>0)
1027+
if (RECOVER_RELATION_BUILD_MEMORY||debug_discard_caches>0)
10281028
{
10291029
tmpcxt=AllocSetContextCreate(CurrentMemoryContext,
10301030
"RelationBuildDesc workspace",
@@ -1627,11 +1627,10 @@ LookupOpclassInfo(Oid operatorClassOid,
16271627
* otherwise. However it can be helpful for detecting bugs in the cache
16281628
* loading logic itself, such as reliance on a non-nailed index. Given
16291629
* the limited use-case and the fact that this adds a great deal of
1630-
* expense, we enable it only for high values of
1631-
* debug_invalidate_system_caches_always.
1630+
* expense, we enable it only for high values of debug_discard_caches.
16321631
*/
1633-
#ifdefCLOBBER_CACHE_ENABLED
1634-
if (debug_invalidate_system_caches_always>2)
1632+
#ifdefDISCARD_CACHES_ENABLED
1633+
if (debug_discard_caches>2)
16351634
opcentry->valid= false;
16361635
#endif
16371636

‎src/backend/utils/misc/guc.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,13 +3513,13 @@ static struct config_int ConfigureNamesInt[] =
35133513
},
35143514

35153515
{
3516-
{"debug_invalidate_system_caches_always",PGC_SUSET,DEVELOPER_OPTIONS,
3517-
gettext_noop("Aggressivelyinvalidate system caches for debugging purposes."),
3516+
{"debug_discard_caches",PGC_SUSET,DEVELOPER_OPTIONS,
3517+
gettext_noop("Aggressivelyflush system caches for debugging purposes."),
35183518
NULL,
35193519
GUC_NOT_IN_SAMPLE
35203520
},
3521-
&debug_invalidate_system_caches_always,
3522-
#ifdefCLOBBER_CACHE_ENABLED
3521+
&debug_discard_caches,
3522+
#ifdefDISCARD_CACHES_ENABLED
35233523
/* Set default based on older compile-time-only cache clobber macros */
35243524
#if defined(CLOBBER_CACHE_RECURSIVELY)
35253525
3,
@@ -3529,9 +3529,9 @@ static struct config_int ConfigureNamesInt[] =
35293529
0,
35303530
#endif
35313531
0,5,
3532-
#else/* notCLOBBER_CACHE_ENABLED */
3532+
#else/* notDISCARD_CACHES_ENABLED */
35333533
0,0,0,
3534-
#endif/* notCLOBBER_CACHE_ENABLED */
3534+
#endif/* notDISCARD_CACHES_ENABLED */
35353535
NULL,NULL,NULL
35363536
},
35373537

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp