Rename log_lock_failure GUC to log_lock_failures for consistency.

This commit renames the GUC log_lock_failure to log_lock_failures
to align with the existing similar setting log_lock_waits, which uses
the plural form. This improves naming consistency across related GUCs.

Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Author: Fujii Masao <masao.fujii@gmail.com
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/7a8198b6-d5b8-4910-b41e-8d3efcbb015d@eisentraut.org
This commit is contained in:
Fujii Masao 2025-06-03 10:02:55 +09:00
parent aa87f69c00
commit 73bdcfab35
8 changed files with 13 additions and 13 deletions

View File

@ -7923,10 +7923,10 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry id="guc-log-lock-failure" xreflabel="log_lock_failure"> <varlistentry id="guc-log-lock-failures" xreflabel="log_lock_failures">
<term><varname>log_lock_failure</varname> (<type>boolean</type>) <term><varname>log_lock_failures</varname> (<type>boolean</type>)
<indexterm> <indexterm>
<primary><varname>log_lock_failure</varname> configuration parameter</primary> <primary><varname>log_lock_failures</varname> configuration parameter</primary>
</indexterm> </indexterm>
</term> </term>
<listitem> <listitem>

View File

@ -727,7 +727,7 @@ Author: Fujii Masao <fujii@postgresql.org>
<listitem> <listitem>
<para> <para>
Add server variable log_lock_failure to log lock acquisition failures (Yuki Seino) Add server variable log_lock_failures to log lock acquisition failures (Yuki Seino)
<ulink url="&commit_baseurl;6d376c3b0">&sect;</ulink> <ulink url="&commit_baseurl;6d376c3b0">&sect;</ulink>
</para> </para>

View File

@ -4982,7 +4982,7 @@ l3:
case LockWaitError: case LockWaitError:
if (!ConditionalMultiXactIdWait((MultiXactId) xwait, if (!ConditionalMultiXactIdWait((MultiXactId) xwait,
status, infomask, relation, status, infomask, relation,
NULL, log_lock_failure)) NULL, log_lock_failures))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_LOCK_NOT_AVAILABLE), (errcode(ERRCODE_LOCK_NOT_AVAILABLE),
errmsg("could not obtain lock on row in relation \"%s\"", errmsg("could not obtain lock on row in relation \"%s\"",
@ -5020,7 +5020,7 @@ l3:
} }
break; break;
case LockWaitError: case LockWaitError:
if (!ConditionalXactLockTableWait(xwait, log_lock_failure)) if (!ConditionalXactLockTableWait(xwait, log_lock_failures))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_LOCK_NOT_AVAILABLE), (errcode(ERRCODE_LOCK_NOT_AVAILABLE),
errmsg("could not obtain lock on row in relation \"%s\"", errmsg("could not obtain lock on row in relation \"%s\"",
@ -5285,7 +5285,7 @@ heap_acquire_tuplock(Relation relation, ItemPointer tid, LockTupleMode mode,
break; break;
case LockWaitError: case LockWaitError:
if (!ConditionalLockTupleTuplock(relation, tid, mode, log_lock_failure)) if (!ConditionalLockTupleTuplock(relation, tid, mode, log_lock_failures))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_LOCK_NOT_AVAILABLE), (errcode(ERRCODE_LOCK_NOT_AVAILABLE),
errmsg("could not obtain lock on row in relation \"%s\"", errmsg("could not obtain lock on row in relation \"%s\"",

View File

@ -464,7 +464,7 @@ tuple_lock_retry:
return TM_WouldBlock; return TM_WouldBlock;
break; break;
case LockWaitError: case LockWaitError:
if (!ConditionalXactLockTableWait(SnapshotDirty.xmax, log_lock_failure)) if (!ConditionalXactLockTableWait(SnapshotDirty.xmax, log_lock_failures))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_LOCK_NOT_AVAILABLE), (errcode(ERRCODE_LOCK_NOT_AVAILABLE),
errmsg("could not obtain lock on row in relation \"%s\"", errmsg("could not obtain lock on row in relation \"%s\"",

View File

@ -51,7 +51,7 @@
/* GUC variables */ /* GUC variables */
int max_locks_per_xact; /* used to set the lock table size */ int max_locks_per_xact; /* used to set the lock table size */
bool log_lock_failure = false; bool log_lock_failures = false;
#define NLOCKENTS() \ #define NLOCKENTS() \
mul_size(max_locks_per_xact, add_size(MaxBackends, max_prepared_xacts)) mul_size(max_locks_per_xact, add_size(MaxBackends, max_prepared_xacts))

View File

@ -1602,11 +1602,11 @@ struct config_bool ConfigureNamesBool[] =
NULL, NULL, NULL NULL, NULL, NULL
}, },
{ {
{"log_lock_failure", PGC_SUSET, LOGGING_WHAT, {"log_lock_failures", PGC_SUSET, LOGGING_WHAT,
gettext_noop("Logs lock failures."), gettext_noop("Logs lock failures."),
NULL NULL
}, },
&log_lock_failure, &log_lock_failures,
false, false,
NULL, NULL, NULL NULL, NULL, NULL
}, },

View File

@ -624,7 +624,7 @@
# %% = '%' # %% = '%'
# e.g. '<%u%%%d> ' # e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout #log_lock_waits = off # log lock waits >= deadlock_timeout
#log_lock_failure = off # log lock failures #log_lock_failures = off # log lock failures
#log_recovery_conflict_waits = off # log standby recovery conflict waits #log_recovery_conflict_waits = off # log standby recovery conflict waits
# >= deadlock_timeout # >= deadlock_timeout
#log_parameter_max_length = -1 # when logging statements, limit logged #log_parameter_max_length = -1 # when logging statements, limit logged

View File

@ -30,7 +30,7 @@ typedef struct PGPROC PGPROC;
/* GUC variables */ /* GUC variables */
extern PGDLLIMPORT int max_locks_per_xact; extern PGDLLIMPORT int max_locks_per_xact;
extern PGDLLIMPORT bool log_lock_failure; extern PGDLLIMPORT bool log_lock_failures;
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
extern PGDLLIMPORT int Trace_lock_oidmin; extern PGDLLIMPORT int Trace_lock_oidmin;