Skip to content

Commit 71b2b65

Browse files
committed
Revert removal of trace_userlocks, because userlocks aren't gone.
This reverts commit 0180bd6. contrib/userlock is gone, but user-level locking still exists, and is exposed via the pg_advisory* family of functions.
1 parent cf22e85 commit 71b2b65

File tree

5 files changed

+41
-2
lines changed

5 files changed

+41
-2
lines changed

doc/src/sgml/config.sgml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6217,6 +6217,28 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
62176217
</listitem>
62186218
</varlistentry>
62196219

6220+
<varlistentry>
6221+
<term><varname>trace_userlocks</varname> (<type>boolean</type>)</term>
6222+
<indexterm>
6223+
<primary><varname>trace_userlocks</> configuration parameter</primary>
6224+
</indexterm>
6225+
<listitem>
6226+
<para>
6227+
If on, emit information about user lock usage. Output is the same
6228+
as for <symbol>trace_locks</symbol>, only for user locks.
6229+
</para>
6230+
<para>
6231+
User locks were removed as of PostgreSQL version 8.2. This option
6232+
currently has no effect.
6233+
</para>
6234+
<para>
6235+
This parameter is only available if the <symbol>LOCK_DEBUG</symbol>
6236+
macro was defined when <productname>PostgreSQL</productname> was
6237+
compiled.
6238+
</para>
6239+
</listitem>
6240+
</varlistentry>
6241+
62206242
<varlistentry>
62216243
<term><varname>trace_lock_oidmin</varname> (<type>integer</type>)</term>
62226244
<indexterm>

src/backend/storage/lmgr/lock.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ static const LockMethodData user_lockmethod = {
213213
AccessExclusiveLock, /* highest valid lock mode number */
214214
true,
215215
LockConflicts,
216-
lock_mode_names
216+
lock_mode_names,
217+
#ifdef LOCK_DEBUG
218+
&Trace_userlocks
219+
#else
220+
&Dummy_trace
221+
#endif
217222
};
218223

219224
/*
@@ -271,6 +276,7 @@ static ResourceOwner awaitedOwner;
271276

272277
int Trace_lock_oidmin = FirstNormalObjectId;
273278
bool Trace_locks = false;
279+
bool Trace_userlocks = false;
274280
int Trace_lock_table = 0;
275281
bool Debug_deadlocks = false;
276282

src/backend/utils/misc/check_guc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ INTENTIONALLY_NOT_INCLUDED="autocommit debug_deadlocks \
2020
is_superuser lc_collate lc_ctype lc_messages lc_monetary lc_numeric lc_time \
2121
pre_auth_delay role seed server_encoding server_version server_version_int \
2222
session_authorization trace_lock_oidmin trace_lock_table trace_locks trace_lwlocks \
23-
trace_notify transaction_isolation transaction_read_only \
23+
trace_notify trace_userlocks transaction_isolation transaction_read_only \
2424
zero_damaged_pages"
2525

2626
### What options are listed in postgresql.conf.sample, but don't appear

src/backend/utils/misc/guc.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,16 @@ static struct config_bool ConfigureNamesBool[] =
10601060
false,
10611061
NULL, NULL, NULL
10621062
},
1063+
{
1064+
{"trace_userlocks", PGC_SUSET, DEVELOPER_OPTIONS,
1065+
gettext_noop("No description available."),
1066+
NULL,
1067+
GUC_NOT_IN_SAMPLE
1068+
},
1069+
&Trace_userlocks,
1070+
false,
1071+
NULL, NULL, NULL
1072+
},
10631073
{
10641074
{"trace_lwlocks", PGC_SUSET, DEVELOPER_OPTIONS,
10651075
gettext_noop("No description available."),

src/include/storage/lock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ extern int max_locks_per_xact;
3434
#ifdef LOCK_DEBUG
3535
extern int Trace_lock_oidmin;
3636
extern bool Trace_locks;
37+
extern bool Trace_userlocks;
3738
extern int Trace_lock_table;
3839
extern bool Debug_deadlocks;
3940
#endif /* LOCK_DEBUG */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy