List:Commits« Previous MessageNext Message »
From:Sunny Bains Date:April 14 2011 7:10am
Subject:bzr push into mysql-trunk-innodb branch (Sunny.Bains:3584 to 3585)
View as plain text  
 3585 Sunny Bains	2011-04-14
      Fix comment.

 3584 Sunny Bains	2011-04-14
      Bug 11833462 - lock_table() shouldn't acquire the lock mutex to check whether a transaction holds a lock on a table
      lock_table() needs to check whether a transaction has a (strong enough) lock
      on a table, and if it doesn't it needs to create and acquire the requested
      lock. The table locks are in the dict_table_t::locks for every transaction
      on the system. This can make the check expensive for >= 256 transactions and
      increase the pressure on the lock mutex.
      With this patch we cache the table locks in trx_t::table_locks. Because the
      table locks are only added by the running transaction and removed at
      trx_commit() by the owning transaction, it is safe to read the locks
      vector without holding any mutex in lock_table().
      rb://605 Approved by: Jimmy Yang.

=== modified file 'storage/innobase/include/trx0trx.h'
--- a/storage/innobase/include/trx0trx.h	revid:sunny.bains@stripped
+++ b/storage/innobase/include/trx0trx.h	revid:sunny.bains@stripped
@@ -485,9 +485,7 @@ struct trx_lock_struct {
 					protected by lock_sys->mutex */
 	ib_vector_t*	table_locks;	/*!< All table locks requested by this
-					transaction, except AUTOINC locks.
-					It shares the heap with the
-					trx_t::autoinc_locks. */
+					transaction, including AUTOINC locks */
 #define TRX_MAGIC_N	91118598

Attachment: [text/bzr-bundle] bzr/
bzr push into mysql-trunk-innodb branch (Sunny.Bains:3584 to 3585) Sunny Bains14 Apr