List:Commits« Previous MessageNext Message »
From:Sunny Bains Date:April 19 2011 4:19am
Subject:bzr push into mysql-trunk-innodb branch (Sunny.Bains:3591 to 3592)
View as plain text  
 3592 Sunny Bains	2011-04-19
      Bug 12373165 - PURGE THREADS SHOULD NOT BE CREATED FOR INNODB-FORCE-RECOVERY > 1
      
      Check the srv_force_recovery setting before creating the purge thread(s). If
      the setting is >= SRV_FORCE_NO_BACKGROUND then don't create the thread(s).
      
      Approved by Jimmy over IM.

    modified:
      storage/innobase/srv/srv0srv.c
      storage/innobase/srv/srv0start.c
 3591 Marko Mäkelä	2011-04-18
      Fix a memory leak introduced in the Bug#11833462 fix
      (bzr revision id sunny.bains@strippedihvdm5y433gtm3hc).
      
      trx_free(): Move some assertions to trx_free_for_background().
      trx_free_prepared(): Use trx_free() to free most data structures.

    modified:
      storage/innobase/trx/trx0trx.c
=== modified file 'storage/innobase/srv/srv0srv.c'
--- a/storage/innobase/srv/srv0srv.c	revid:marko.makela@stripped418110937-pm3x5j1i846m4kog
+++ b/storage/innobase/srv/srv0srv.c	revid:sunny.bains@strippedglj6phimo2
@@ -2345,6 +2345,8 @@ srv_worker_thread(
 {
 	srv_slot_t*	slot;
 
+	ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND);
+
 #ifdef UNIV_DEBUG_THREAD_CREATION
 	fprintf(stderr, "Worker thread starts, id %lu\n",
 		os_thread_pf(os_thread_get_curr_id()));
@@ -2522,8 +2524,7 @@ srv_purge_coordinator_thread(
 		}
 
 		/* Check for shutdown and whether we should do purge at all. */
-		if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND
-		    || srv_shutdown_state != SRV_SHUTDOWN_NONE
+		if (srv_shutdown_state != SRV_SHUTDOWN_NONE
 		    || srv_fast_shutdown) {
 
 			break;

=== modified file 'storage/innobase/srv/srv0start.c'
--- a/storage/innobase/srv/srv0start.c	revid:marko.makela@stripped
+++ b/storage/innobase/srv/srv0start.c	revid:sunny.bains@oracle.com-20110419041707-3oog92glj6phimo2
@@ -1861,7 +1861,8 @@ innobase_start_or_create_for_mysql(void)
 
 	/* If the user has requested a separate purge thread then
 	start the purge thread. */
-	if (srv_n_purge_threads >= 1) {
+	if (srv_n_purge_threads >= 1
+	    && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
 
 		os_thread_create(
 			&srv_purge_coordinator_thread, NULL,
@@ -1882,7 +1883,9 @@ innobase_start_or_create_for_mysql(void)
 
 	/* Wait for the purge coordinator and master thread to startup. */
 
-	while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
+	while (srv_shutdown_state == SRV_SHUTDOWN_NONE
+	       && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
+
 		if (srv_thread_has_reserved_slot(SRV_MASTER) == ULINT_UNDEFINED
 		    || (srv_n_purge_threads > 0
 			&& srv_thread_has_reserved_slot(SRV_PURGE)

Attachment: [text/bzr-bundle] bzr/sunny.bains@oracle.com-20110419041707-3oog92glj6phimo2.bundle
Thread
bzr push into mysql-trunk-innodb branch (Sunny.Bains:3591 to 3592) Sunny Bains19 Apr