Re: [HACKERS] Remove support for 'userlocks'?

2011-10-13 Thread Bruce Momjian
Josh Berkus wrote:
 On 6/3/11 11:01 AM, Bruce Momjian wrote:
  According to our documentation, 'userlocks' were removed in PG 8.2:
  
  
  http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html
 
 I take it this doesn't trace advisory locks, and trace_locks does?
 
 If so, then by all means remove the code.  I highly doubt anyone is
 using that option anyway ...

The attached, applied patch removes all traces of trace_userlocks.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
new file mode 100644
index d3a8b26..fa2dcf3
*** a/doc/src/sgml/config.sgml
--- b/doc/src/sgml/config.sgml
*** LOG:  CleanUpLock: deleting: lock(0xb7ac
*** 6193,6220 
   /varlistentry
  
   varlistentry
-   termvarnametrace_userlocks/varname (typeboolean/type)/term
-   indexterm
-primaryvarnametrace_userlocks/ configuration parameter/primary
-   /indexterm
-   listitem
-para
- If on, emit information about user lock usage.  Output is the same
- as for symboltrace_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 symbolLOCK_DEBUG/symbol
- macro was defined when productnamePostgreSQL/productname was
- compiled.
-/para
-   /listitem
-  /varlistentry
- 
-  varlistentry
termvarnametrace_lock_oidmin/varname (typeinteger/type)/term
indexterm
 primaryvarnametrace_lock_oidmin/ configuration parameter/primary
--- 6193,6198 
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
new file mode 100644
index 905502f..ed8344f
*** a/src/backend/storage/lmgr/lock.c
--- b/src/backend/storage/lmgr/lock.c
*** static const LockMethodData user_lockmet
*** 213,224 
  	AccessExclusiveLock,		/* highest valid lock mode number */
  	true,
  	LockConflicts,
! 	lock_mode_names,
! #ifdef LOCK_DEBUG
! 	Trace_userlocks
! #else
! 	Dummy_trace
! #endif
  };
  
  /*
--- 213,219 
  	AccessExclusiveLock,		/* highest valid lock mode number */
  	true,
  	LockConflicts,
! 	lock_mode_names
  };
  
  /*
*** static ResourceOwner awaitedOwner;
*** 276,282 
  
  int			Trace_lock_oidmin = FirstNormalObjectId;
  bool		Trace_locks = false;
- bool		Trace_userlocks = false;
  int			Trace_lock_table = 0;
  bool		Debug_deadlocks = false;
  
--- 271,276 
diff --git a/src/backend/utils/misc/check_guc b/src/backend/utils/misc/check_guc
new file mode 100755
index 293fb03..91c1c58
*** a/src/backend/utils/misc/check_guc
--- b/src/backend/utils/misc/check_guc
*** INTENTIONALLY_NOT_INCLUDED=autocommit d
*** 20,26 
  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 trace_userlocks transaction_isolation transaction_read_only \
  zero_damaged_pages
  
  ### What options are listed in postgresql.conf.sample, but don't appear
--- 20,26 
  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 \
  zero_damaged_pages
  
  ### What options are listed in postgresql.conf.sample, but don't appear
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
new file mode 100644
index 106096f..f1d35a9
*** a/src/backend/utils/misc/guc.c
--- b/src/backend/utils/misc/guc.c
*** static struct config_bool ConfigureNames
*** 1059,1074 
  		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.),
  			NULL,
--- 1059,1064 
diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h
new file mode 100644
index e106ad5..bc746a3
*** a/src/include/storage/lock.h
--- b/src/include/storage/lock.h
*** extern int	max_locks_per_xact;
*** 34,40 
  #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 */
--- 34,39 

-- 
Sent via pgsql-hackers mailing list 

[HACKERS] Remove support for 'userlocks'?

2011-06-03 Thread Bruce Momjian
According to our documentation, 'userlocks' were removed in PG 8.2:


http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html

trace_userlocks (boolean)

If on, emit information about user lock usage. Output is the same as
for trace_locks, only for user locks.

User locks were removed as of PostgreSQL version 8.2. This option
currently has no effect.

This parameter is only available if the LOCK_DEBUG macro was defined
when PostgreSQL was compiled.

Should we remove this parameter and the supporting code since pre-8.2 is
now end-of-life?

--
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Remove support for 'userlocks'?

2011-06-03 Thread Merlin Moncure
On Fri, Jun 3, 2011 at 1:01 PM, Bruce Momjian br...@momjian.us wrote:
 According to our documentation, 'userlocks' were removed in PG 8.2:

        
 http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html

        trace_userlocks (boolean)

        If on, emit information about user lock usage. Output is the same as
        for trace_locks, only for user locks.

        User locks were removed as of PostgreSQL version 8.2. This option
        currently has no effect.

        This parameter is only available if the LOCK_DEBUG macro was defined
        when PostgreSQL was compiled.

 Should we remove this parameter and the supporting code since pre-8.2 is
 now end-of-life?

hm, shouldn't it be replaced with trace_advisory_locks?

merlin

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Remove support for 'userlocks'?

2011-06-03 Thread Josh Berkus
On 6/3/11 11:01 AM, Bruce Momjian wrote:
 According to our documentation, 'userlocks' were removed in PG 8.2:
 
   
 http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html

I take it this doesn't trace advisory locks, and trace_locks does?

If so, then by all means remove the code.  I highly doubt anyone is
using that option anyway ...

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Remove support for 'userlocks'?

2011-06-03 Thread Bruce Momjian
Josh Berkus wrote:
 On 6/3/11 11:01 AM, Bruce Momjian wrote:
  According to our documentation, 'userlocks' were removed in PG 8.2:
  
  
  http://developer.postgresql.org/pgdocs/postgres/runtime-config-developer.html
 
 I take it this doesn't trace advisory locks, and trace_locks does?
 
 If so, then by all means remove the code.  I highly doubt anyone is
 using that option anyway ...

OK, that is something I will do for 9.2.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers