Rename log_lock_failure GUC to log_lock_failures for consistency.
authorFujii Masao <fujii@postgresql.org>
Tue, 3 Jun 2025 01:02:55 +0000 (10:02 +0900)
committerFujii Masao <fujii@postgresql.org>
Tue, 3 Jun 2025 01:02:55 +0000 (10:02 +0900)
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

doc/src/sgml/config.sgml
doc/src/sgml/release-18.sgml
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam_handler.c
src/backend/storage/lmgr/lock.c
src/backend/utils/misc/guc_tables.c
src/backend/utils/misc/postgresql.conf.sample
src/include/storage/lock.h

index f4a0191c55b8e9d12d8093ccbfbe83d8f98df567..021153b2a5f278449cdbb4ff613072c8007f9f30 100644 (file)
@@ -7923,10 +7923,10 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
       </listitem>
      </varlistentry>
 
-     <varlistentry id="guc-log-lock-failure" xreflabel="log_lock_failure">
-      <term><varname>log_lock_failure</varname> (<type>boolean</type>)
+     <varlistentry id="guc-log-lock-failures" xreflabel="log_lock_failures">
+      <term><varname>log_lock_failures</varname> (<type>boolean</type>)
       <indexterm>
-       <primary><varname>log_lock_failure</varname> configuration parameter</primary>
+       <primary><varname>log_lock_failures</varname> configuration parameter</primary>
       </indexterm>
       </term>
       <listitem>
index 3315ea52def55731171571698c84e7173e46e76b..d7340465e7925d0cddd4ba5fd3d4897701b7c07f 100644 (file)
@@ -727,7 +727,7 @@ Author: Fujii Masao <fujii@postgresql.org>
 
 <listitem>
 <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>
 </para>
 
index 2be7f817c78ad624014897f17331a48f0ab5f6b4..0dcd6ee817e04d617d12a6b4ebb72c599297fbcf 100644 (file)
@@ -4982,7 +4982,7 @@ l3:
                    case LockWaitError:
                        if (!ConditionalMultiXactIdWait((MultiXactId) xwait,
                                                        status, infomask, relation,
-                                                       NULL, log_lock_failure))
+                                                       NULL, log_lock_failures))
                            ereport(ERROR,
                                    (errcode(ERRCODE_LOCK_NOT_AVAILABLE),
                                     errmsg("could not obtain lock on row in relation \"%s\"",
@@ -5020,7 +5020,7 @@ l3:
                        }
                        break;
                    case LockWaitError:
-                       if (!ConditionalXactLockTableWait(xwait, log_lock_failure))
+                       if (!ConditionalXactLockTableWait(xwait, log_lock_failures))
                            ereport(ERROR,
                                    (errcode(ERRCODE_LOCK_NOT_AVAILABLE),
                                     errmsg("could not obtain lock on row in relation \"%s\"",
@@ -5285,7 +5285,7 @@ heap_acquire_tuplock(Relation relation, ItemPointer tid, LockTupleMode mode,
            break;
 
        case LockWaitError:
-           if (!ConditionalLockTupleTuplock(relation, tid, mode, log_lock_failure))
+           if (!ConditionalLockTupleTuplock(relation, tid, mode, log_lock_failures))
                ereport(ERROR,
                        (errcode(ERRCODE_LOCK_NOT_AVAILABLE),
                         errmsg("could not obtain lock on row in relation \"%s\"",
index ac082fefa77a7a1e1c98579c0c61940c4d050167..cb4bc35c93ed4d28d74c9db9fa1c4da2b17386ee 100644 (file)
@@ -464,7 +464,7 @@ tuple_lock_retry:
                                    return TM_WouldBlock;
                                break;
                            case LockWaitError:
-                               if (!ConditionalXactLockTableWait(SnapshotDirty.xmax, log_lock_failure))
+                               if (!ConditionalXactLockTableWait(SnapshotDirty.xmax, log_lock_failures))
                                    ereport(ERROR,
                                            (errcode(ERRCODE_LOCK_NOT_AVAILABLE),
                                             errmsg("could not obtain lock on row in relation \"%s\"",
index 86b06b9223f0b00489d6d8ac5ef9de2b4eb586ce..2776ceb295be4889659c7f2bb14eec281e5a1e55 100644 (file)
@@ -51,7 +51,7 @@
 
 /* GUC variables */
 int            max_locks_per_xact; /* used to set the lock table size */
-bool       log_lock_failure = false;
+bool       log_lock_failures = false;
 
 #define NLOCKENTS() \
    mul_size(max_locks_per_xact, add_size(MaxBackends, max_prepared_xacts))
index 2f8cbd8675998a9a8e25bc6953933ad807d52b42..f04bfedb2fd1036caec085be6b0087c01b7c9d4e 100644 (file)
@@ -1602,11 +1602,11 @@ struct config_bool ConfigureNamesBool[] =
        NULL, NULL, NULL
    },
    {
-       {"log_lock_failure", PGC_SUSET, LOGGING_WHAT,
+       {"log_lock_failures", PGC_SUSET, LOGGING_WHAT,
            gettext_noop("Logs lock failures."),
            NULL
        },
-       &log_lock_failure,
+       &log_lock_failures,
        false,
        NULL, NULL, NULL
    },
index 87ce76b18f41c75a3b11e7f04d4c5b485196f053..341f88adc87b270234c00d387b2ddc85b5688df4 100644 (file)
                    #   %% = '%'
                    # e.g. '<%u%%%d> '
 #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
                    # >= deadlock_timeout
 #log_parameter_max_length = -1     # when logging statements, limit logged
index 6f2108a44e8fbf0b48691ccd678d3ac45ea7b544..4862b80eec3c7e89b0e6e270fcc44f9e7649e821 100644 (file)
@@ -30,7 +30,7 @@ typedef struct PGPROC PGPROC;
 
 /* GUC variables */
 extern PGDLLIMPORT int max_locks_per_xact;
-extern PGDLLIMPORT bool log_lock_failure;
+extern PGDLLIMPORT bool log_lock_failures;
 
 #ifdef LOCK_DEBUG
 extern PGDLLIMPORT int Trace_lock_oidmin;