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

Commit ff245a3

Browse files
committed
Doc: improve descriptions of max_[pred_]locks_per_transaction GUCs.
The old wording described these as being multiplied by max_connections plus max_prepared_transactions, which hasn't been exactly right for some time thanks to the addition of various auxiliary processes. Moreover, exactness here is a bit pointless given that the lock tables can expand into the initially-unallocated "slop" space in shared memory. Rather than trying to track exactly what the code is doing, let's just use the term "server processes". Likewise adjust these GUCs' description strings in guc_tables.c. Wang Wei, reviewed by Nathan Bossart and myself Discussion: https://postgr.es/m/OS3PR01MB6275BDD09C9B875C65FCC5AB9EA39@OS3PR01MB6275.jpnprd01.prod.outlook.com
1 parent 888f2ea commit ff245a3

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

doc/src/sgml/config.sgml

+13-15
Original file line numberDiff line numberDiff line change
@@ -10236,13 +10236,12 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
1023610236
</term>
1023710237
<listitem>
1023810238
<para>
10239-
The shared lock table tracks locks on
10240-
<varname>max_locks_per_transaction</varname> * (<xref
10241-
linkend="guc-max-connections"/> + <xref
10242-
linkend="guc-max-prepared-transactions"/>) objects (e.g., tables);
10239+
The shared lock table has space for
10240+
<varname>max_locks_per_transaction</varname> objects
10241+
(e.g., tables) per server process or prepared transaction;
1024310242
hence, no more than this many distinct objects can be locked at
10244-
any one time. This parameter controls the average number of object
10245-
locks allocated for each transaction; individual transactions
10243+
any one time. This parameter limits the average number of object
10244+
locks used by each transaction; individual transactions
1024610245
can lock more objects as long as the locks of all transactions
1024710246
fit in the lock table. This is <emphasis>not</emphasis> the number of
1024810247
rows that can be locked; that value is unlimited. The default,
@@ -10253,8 +10252,8 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
1025310252
</para>
1025410253

1025510254
<para>
10256-
When running a standby server, you must set this parameter to the
10257-
same or higher value than on the primary server. Otherwise, queries
10255+
When running a standby server, you must set this parameter to have the
10256+
same or higher value as on the primary server. Otherwise, queries
1025810257
will not be allowed in the standby server.
1025910258
</para>
1026010259
</listitem>
@@ -10268,17 +10267,16 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
1026810267
</term>
1026910268
<listitem>
1027010269
<para>
10271-
The shared predicate lock table tracks locks on
10272-
<varname>max_pred_locks_per_transaction</varname> * (<xref
10273-
linkend="guc-max-connections"/> + <xref
10274-
linkend="guc-max-prepared-transactions"/>) objects (e.g., tables);
10270+
The shared predicate lock table has space for
10271+
<varname>max_pred_locks_per_transaction</varname> objects
10272+
(e.g., tables) per server process or prepared transaction;
1027510273
hence, no more than this many distinct objects can be locked at
10276-
any one time. This parameter controls the average number of object
10277-
locks allocated for each transaction; individual transactions
10274+
any one time. This parameter limits the average number of object
10275+
locks used by each transaction; individual transactions
1027810276
can lock more objects as long as the locks of all transactions
1027910277
fit in the lock table. This is <emphasis>not</emphasis> the number of
1028010278
rows that can be locked; that value is unlimited. The default,
10281-
64, has generally been sufficient in testing, but you might need to
10279+
64, has historically proven sufficient, but you might need to
1028210280
raise this value if you have clients that touch many different
1028310281
tables in a single serializable transaction. This parameter can
1028410282
only be set at server start.

src/backend/utils/misc/guc_tables.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -2599,9 +2599,9 @@ struct config_int ConfigureNamesInt[] =
25992599
{
26002600
{"max_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT,
26012601
gettext_noop("Sets the maximum number of locks per transaction."),
2602-
gettext_noop("The shared lock table is sized on the assumption that "
2603-
"at most max_locks_per_transaction * max_connections distinct "
2604-
"objects will need to be locked at any one time.")
2602+
gettext_noop("The shared lock table is sized on the assumption that at most "
2603+
"max_locks_per_transaction objects per server process or prepared "
2604+
"transaction will need to be locked at any one time.")
26052605
},
26062606
&max_locks_per_xact,
26072607
64, 10, INT_MAX,
@@ -2612,8 +2612,8 @@ struct config_int ConfigureNamesInt[] =
26122612
{"max_pred_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT,
26132613
gettext_noop("Sets the maximum number of predicate locks per transaction."),
26142614
gettext_noop("The shared predicate lock table is sized on the assumption that "
2615-
"at most max_pred_locks_per_transaction * max_connections distinct "
2616-
"objects will need to be locked at any one time.")
2615+
"at most max_pred_locks_per_transaction objects per server process "
2616+
"or prepared transaction will need to be locked at any one time.")
26172617
},
26182618
&max_predicate_locks_per_xact,
26192619
64, 10, INT_MAX,

0 commit comments

Comments
 (0)