diff options
author | unknown <gbichot@quadita2.mysql.com> | 2005-04-15 18:00:38 +0200 |
---|---|---|
committer | unknown <gbichot@quadita2.mysql.com> | 2005-04-15 18:00:38 +0200 |
commit | 43b1125cb9433c1ff1efce0d823f62de6b5a7dc9 (patch) | |
tree | 0cb2a277f0c3cbfc9d0767d8b8fd920ce539bf8d /innobase/srv/srv0srv.c | |
parent | e35244d626a14d2574efbee5c5db0dfec27cb8aa (diff) | |
download | mariadb-git-43b1125cb9433c1ff1efce0d823f62de6b5a7dc9.tar.gz |
Adding --innodb_fast_shutdown=2 which shuts down InnoDB faster than the default "1":
most InnoDB threads are not terminated properly and the buffer pool is not flushed
to disk. Still no committed transaction is lost as we flush the logs to disk.
InnoDB does crash recovery at startup after this shutdown.
Using this shutdown in testsuite (mysql-test-run --mysqld=--innodb_fast_shutdown=2) saved 3 minutes (13% of total time).
innobase/include/srv0srv.h:
srv_fast_shutdown now int to allow 3 values, replacing the srv_fast_shutdown/srv_very_fast_shutdown combo
innobase/log/log0log.c:
srv_very_fast_shutdown -> (srv_fast_shutdown == 2)
innobase/srv/srv0srv.c:
srv_very_fast_shutdown -> (srv_fast_shutdown == 2)
innobase/srv/srv0start.c:
moving message to the InnoDB internal code (like "InnoDB: Starting shutdown" is)
instead of ha_innodb.cc. That's to have ut_print_timestamp().
sql/ha_innodb.cc:
As innodb_fast_shutdown is now settable, srv_fast_shutdown must be
set at shutdown, not at startup.
sql/ha_innodb.h:
innobase_fast_shutdown now ulong to accept 3 values
sql/mysqld.cc:
Making the "very fast" InnoDB shutdown accessible to users, by passing
--innodb-fast-shutdown=2 (disabled on Netware)
sql/set_var.cc:
innodb_fast_shutdown now settable on the fly (global variable).
So that user can decide to do a normal/fast/fastest shutdown
just before doing it.
Diffstat (limited to 'innobase/srv/srv0srv.c')
-rw-r--r-- | innobase/srv/srv0srv.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 41b0594d705..a4bfdb6162d 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -300,15 +300,12 @@ SQL query after it has once got the ticket at srv_conc_enter_innodb */ #define SRV_FREE_TICKETS_TO_ENTER srv_n_free_tickets_to_enter #define SRV_THREAD_SLEEP_DELAY srv_thread_sleep_delay /*-----------------------*/ -/* If the following is set TRUE then we do not run purge and insert buffer -merge to completion before shutdown */ +/* If the following is set to 1 then we do not run purge and insert buffer +merge to completion before shutdown. If it is set to 2, do not even flush the +buffer pool to data files at the shutdown: we effectively 'crash' +InnoDB (but lose no committed transactions). */ +ulint srv_fast_shutdown = 0; -ibool srv_fast_shutdown = FALSE; - -ibool srv_very_fast_shutdown = FALSE; /* if this TRUE, do not flush the - buffer pool to data files at the - shutdown; we effectively 'crash' - InnoDB */ /* Generate a innodb_status.<pid> file */ ibool srv_innodb_status = FALSE; @@ -2471,11 +2468,11 @@ background_loop: flush_loop: srv_main_thread_op_info = "flushing buffer pool pages"; - if (!srv_very_fast_shutdown) { + if (srv_fast_shutdown < 2) { n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max); } else { - /* In a 'very fast' shutdown we do not flush the buffer pool + /* In the fastest shutdown we do not flush the buffer pool to data files: we set n_pages_flushed to 0 artificially. */ n_pages_flushed = 0; |