List:Commits« Previous MessageNext Message »
From:Mikael Ronstrom Date:May 14 2009 9:50am
Subject:bzr commit into mysql-5.1 branch (mikael:2847)
View as plain text  
#At file:///home/mikael/mysql_clones/tmp/

 2847 Mikael Ronstrom	2009-05-14
      Multiple rollback segements to decrease contention on rollback segment mutexes
      modified:
        storage/innobase/include/trx0rseg.h
        storage/innobase/include/trx0sys.h
        storage/innobase/srv/srv0start.c
        storage/innobase/trx/trx0rseg.c

=== modified file 'storage/innobase/include/trx0rseg.h'
--- a/storage/innobase/include/trx0rseg.h	2006-03-10 16:22:21 +0000
+++ b/storage/innobase/include/trx0rseg.h	2009-05-14 09:50:42 +0000
@@ -14,6 +14,10 @@ Created 3/26/1996 Heikki Tuuri
 #include "trx0sys.h"
 
 /**********************************************************************
+Add more rollback segments at startup. */
+void
+trx_rseg_add_more(void);
+/**********************************************************************
 Gets a rollback segment header. */
 UNIV_INLINE
 trx_rsegf_t*

=== modified file 'storage/innobase/include/trx0sys.h'
--- a/storage/innobase/include/trx0sys.h	2006-03-10 16:22:21 +0000
+++ b/storage/innobase/include/trx0sys.h	2009-05-14 09:50:42 +0000
@@ -325,10 +325,10 @@ trx_sys_print_mysql_master_log_pos(void)
 					segment specification slots */
 /*-------------------------------------------------------------*/
 
-/* Max number of rollback segments: the number of segment specification slots
+/* Number of rollback segments: the number of segment specification slots
 in the transaction system array; rollback segment id must fit in one byte,
-therefore 256; each slot is currently 8 bytes in size */
-#define	TRX_SYS_N_RSEGS		256
+therefore max 256; each slot is currently 8 bytes in size */
+#define	TRX_SYS_N_RSEGS		9
 
 #define TRX_SYS_MYSQL_LOG_NAME_LEN	512
 #define TRX_SYS_MYSQL_LOG_MAGIC_N	873422344

=== modified file 'storage/innobase/srv/srv0start.c'
--- a/storage/innobase/srv/srv0start.c	2009-02-26 06:44:36 +0000
+++ b/storage/innobase/srv/srv0start.c	2009-05-14 09:50:42 +0000
@@ -1502,6 +1502,7 @@ innobase_start_or_create_for_mysql(void)
 		dict_create();
 		srv_startup_is_before_trx_rollback_phase = FALSE;
 
+                trx_rseg_add_more();
 #ifdef UNIV_LOG_ARCHIVE
 	} else if (srv_archive_recovery) {
 		fprintf(stderr,

=== modified file 'storage/innobase/trx/trx0rseg.c'
--- a/storage/innobase/trx/trx0rseg.c	2007-03-22 21:59:35 +0000
+++ b/storage/innobase/trx/trx0rseg.c	2009-05-14 09:50:42 +0000
@@ -197,6 +197,7 @@ trx_rseg_list_and_array_init(
 	mtr_t*		mtr)		/* in: mtr */
 {
 	ulint	i;
+        ulint   rseg_id;
 	ulint	page_no;
 	ulint	space;
 
@@ -220,6 +221,28 @@ trx_rseg_list_and_array_init(
 }
 
 /********************************************************************
+Adds more rollback segment to the database as part of startup. */
+void
+trx_rseg_add_more()
+{
+	ulint	i;
+        ulint   rseg_id;
+        mtr_t   mtr;
+
+        mtr_start(&mtr);
+        for (i = 1; i < TRX_SYS_N_RSEGS; i++) {
+                if (!trx_rseg_create(TRX_SYS_SPACE, ULINT_MAX, &rseg_id,
+                                     &mtr)) {
+                         fprintf(stderr,
+                         "Couldn't create rollback segments.\n");
+                         ut_a(0);
+                }
+                ut_a(rseg_id == i);
+        }
+        mtr_commit(&mtr);
+}
+
+/********************************************************************
 Creates a new rollback segment to the database. */
 
 trx_rseg_t*

Thread
bzr commit into mysql-5.1 branch (mikael:2847) Mikael Ronstrom14 May