Revert removal of trace_userlocks, because userlocks aren't gone.
authorRobert Haas <rhaas@postgresql.org>
Thu, 10 Nov 2011 22:54:27 +0000 (17:54 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 10 Nov 2011 22:54:27 +0000 (17:54 -0500)
This reverts commit 0180bd6180511875db046bf8ddcaa633a2952dfd.
contrib/userlock is gone, but user-level locking still exists,
and is exposed via the pg_advisory* family of functions.

doc/src/sgml/config.sgml
src/backend/storage/lmgr/lock.c
src/backend/utils/misc/check_guc
src/backend/utils/misc/guc.c
src/include/storage/lock.h

index 3ace7dfa9309bdecef44e8573f54ec6367d99bbe..18b39ea0a97d4c867882f549fef7ba3c2fc42bb8 100644 (file)
@@ -6217,6 +6217,28 @@ LOG:  CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
       </listitem>
      </varlistentry>
 
+     <varlistentry>
+      <term><varname>trace_userlocks</varname> (<type>boolean</type>)</term>
+      <indexterm>
+       <primary><varname>trace_userlocks</> configuration parameter</primary>
+      </indexterm>
+      <listitem>
+       <para>
+        If on, emit information about user lock usage.  Output is the same
+        as for <symbol>trace_locks</symbol>, only for user locks.
+       </para>
+       <para>
+        User locks were removed as of PostgreSQL version 8.2.  This option
+        currently has no effect.
+       </para>
+       <para>
+        This parameter is only available if the <symbol>LOCK_DEBUG</symbol>
+        macro was defined when <productname>PostgreSQL</productname> was
+        compiled.
+       </para>
+      </listitem>
+     </varlistentry>
+
      <varlistentry>
       <term><varname>trace_lock_oidmin</varname> (<type>integer</type>)</term>
       <indexterm>
index ed8344ff8f28afe8ba34d2d0e92495bdfca0c4ae..905502f145b24928167b41ee7b5485fc972a5b86 100644 (file)
@@ -213,7 +213,12 @@ static const LockMethodData user_lockmethod = {
    AccessExclusiveLock,        /* highest valid lock mode number */
    true,
    LockConflicts,
-   lock_mode_names
+   lock_mode_names,
+#ifdef LOCK_DEBUG
+   &Trace_userlocks
+#else
+   &Dummy_trace
+#endif
 };
 
 /*
@@ -271,6 +276,7 @@ static ResourceOwner awaitedOwner;
 
 int            Trace_lock_oidmin = FirstNormalObjectId;
 bool       Trace_locks = false;
+bool       Trace_userlocks = false;
 int            Trace_lock_table = 0;
 bool       Debug_deadlocks = false;
 
index 91c1c581acd0fbf36bd8e992f210a9eaa48ae393..293fb0363f8fbda2acad821490fa86821bd72a59 100755 (executable)
@@ -20,7 +20,7 @@ INTENTIONALLY_NOT_INCLUDED="autocommit debug_deadlocks \
 is_superuser lc_collate lc_ctype lc_messages lc_monetary lc_numeric lc_time \
 pre_auth_delay role seed server_encoding server_version server_version_int \
 session_authorization trace_lock_oidmin trace_lock_table trace_locks trace_lwlocks \
-trace_notify transaction_isolation transaction_read_only \
+trace_notify trace_userlocks transaction_isolation transaction_read_only \
 zero_damaged_pages"
 
 ### What options are listed in postgresql.conf.sample, but don't appear
index a22272c6b76c079aaf7500d98900a732807286ac..da7b6d4e90b41347e93631ad5826bc64f5032c75 100644 (file)
@@ -1060,6 +1060,16 @@ static struct config_bool ConfigureNamesBool[] =
        false,
        NULL, NULL, NULL
    },
+   {
+       {"trace_userlocks", PGC_SUSET, DEVELOPER_OPTIONS,
+           gettext_noop("No description available."),
+           NULL,
+           GUC_NOT_IN_SAMPLE
+       },
+       &Trace_userlocks,
+       false,
+       NULL, NULL, NULL
+   },
    {
        {"trace_lwlocks", PGC_SUSET, DEVELOPER_OPTIONS,
            gettext_noop("No description available."),
index bc746a39e4f4b1c6874b6bc366f962f1960b1788..e106ad54019bb915edf84cfca014cae0eebdcaa6 100644 (file)
@@ -34,6 +34,7 @@ extern int    max_locks_per_xact;
 #ifdef LOCK_DEBUG
 extern int Trace_lock_oidmin;
 extern bool Trace_locks;
+extern bool Trace_userlocks;
 extern int Trace_lock_table;
 extern bool Debug_deadlocks;
 #endif   /* LOCK_DEBUG */