summaryrefslogtreecommitdiff
path: root/innobase/srv/srv0start.c
diff options
context:
space:
mode:
authorunknown <gbichot@quadita2.mysql.com>2005-03-09 00:32:58 +0100
committerunknown <gbichot@quadita2.mysql.com>2005-03-09 00:32:58 +0100
commit9856fc62b79c3c08b39a942e8df2336e4ff34019 (patch)
tree2f2a2dd0468b4a571930cb61c93081197e333f87 /innobase/srv/srv0start.c
parent8a9d56070b8d11fc3df5166db0a64fa9f756dfea (diff)
downloadmariadb-git-9856fc62b79c3c08b39a942e8df2336e4ff34019.tar.gz
This code change has 0 effects as it's about the case where innobase_very_fast_shutdown!=0,
which is always false. In a very fast InnoDB shutdown, we just ensure that no more transactions are running, flush InnoDB log, signal InnoDB threads to die, and then return from InnoDB (from innobase_end()) without waiting for those threads to actually die. I have tested on a 4CPU machine that even with --innodb_flush_log_at_trx_commit=0, this optimized InnoDB very fast shutdown loses no committed transactions. Patch pre-approved by Heikki. innobase/log/log0log.c: In an InnoDB very fast shutdown, we just need to wait for no more transactions to be happening and then we can flush the InnoDB log and don't need to wait for the signaled-to-die InnoDB threads to finish (saves seconds). innobase/srv/srv0start.c: In an InnoDB very fast shutdown, once we have forced a flush of the InnoDB log to disk, and signalled InnoDB threads to die, we needn't wait for these threads to die.
Diffstat (limited to 'innobase/srv/srv0start.c')
-rw-r--r--innobase/srv/srv0start.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 210739b26fd..c65b7d3e141 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1740,6 +1740,13 @@ innobase_shutdown_for_mysql(void)
srv_shutdown_state = SRV_SHUTDOWN_EXIT_THREADS;
+ /* In a 'very fast' shutdown, we do not need to wait for these threads
+ to die; all which counts is that we flushed the log; a 'very fast'
+ shutdown is essentially a crash. */
+
+ if (srv_fast_shutdown)
+ return((int) DB_SUCCESS);
+
/* All threads end up waiting for certain events. Put those events
to the signaled state. Then the threads will exit themselves in
os_thread_event_wait(). */