Below is the list of changes that have just been committed into a local
5.0 repository of gbichot. When gbichot does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1837 05/04/15 18:00:38 gbichot@stripped +8 -0
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).
sql/set_var.cc
1.104 05/04/15 18:00:28 gbichot@stripped +4 -1
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.
sql/mysqld.cc
1.455 05/04/15 18:00:28 gbichot@stripped +18 -5
Making the "very fast" InnoDB shutdown accessible to users, by passing
--innodb-fast-shutdown=2 (disabled on Netware)
sql/ha_innodb.h
1.92 05/04/15 18:00:27 gbichot@stripped +2 -2
innobase_fast_shutdown now ulong to accept 3 values
sql/ha_innodb.cc
1.193 05/04/15 18:00:27 gbichot@stripped +2 -17
As innodb_fast_shutdown is now settable, srv_fast_shutdown must be
set at shutdown, not at startup.
innobase/srv/srv0start.c
1.80 05/04/15 18:00:27 gbichot@stripped +9 -0
moving message to the InnoDB internal code (like "InnoDB: Starting shutdown" is)
instead of ha_innodb.cc. That's to have ut_print_timestamp().
innobase/srv/srv0srv.c
1.88 05/04/15 18:00:27 gbichot@stripped +7 -10
srv_very_fast_shutdown -> (srv_fast_shutdown == 2)
innobase/log/log0log.c
1.42 05/04/15 18:00:27 gbichot@stripped +4 -6
srv_very_fast_shutdown -> (srv_fast_shutdown == 2)
innobase/include/srv0srv.h
1.52 05/04/15 18:00:26 gbichot@stripped +6 -4
srv_fast_shutdown now int to allow 3 values, replacing the
srv_fast_shutdown/srv_very_fast_shutdown combo
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: gbichot
# Host: quadita2.mysql.com
# Root: /nfstmp1/guilhem/mysql-5.0-4ita
--- 1.454/sql/mysqld.cc 2005-04-13 17:30:08 +02:00
+++ 1.455/sql/mysqld.cc 2005-04-15 18:00:28 +02:00
@@ -4494,8 +4494,24 @@
Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
(gptr*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"innodb_fast_shutdown", OPT_INNODB_FAST_SHUTDOWN,
- "Speeds up server shutdown process.", (gptr*) &innobase_fast_shutdown,
- (gptr*) &innobase_fast_shutdown, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
+ "Speeds up the shutdown process of the InnoDB storage engine. Possible "
+ "values are 0, 1 (faster)"
+ /*
+ NetWare can't close unclosed files, can't automatically kill remaining
+ threads, etc, so on this OS we disable the crash-like InnoDB shutdown.
+ */
+#ifndef __NETWARE__
+ " or 2 (fastest - crash-like)"
+#endif
+ ".",
+ (gptr*) &innobase_fast_shutdown,
+ (gptr*) &innobase_fast_shutdown, 0, GET_ULONG, OPT_ARG, 1, 0,
+#ifndef __NETWARE__
+ 2,
+#else
+ 1,
+#endif
+ 0, 0, 0},
{"innodb_file_per_table", OPT_INNODB_FILE_PER_TABLE,
"Stores each InnoDB table to an .ibd file in the database dir.",
(gptr*) &innobase_file_per_table,
@@ -6509,9 +6525,6 @@
#ifdef HAVE_INNOBASE_DB
case OPT_INNODB_LOG_ARCHIVE:
innobase_log_archive= argument ? test(atoi(argument)) : 1;
- break;
- case OPT_INNODB_FAST_SHUTDOWN:
- innobase_fast_shutdown= argument ? test(atoi(argument)) : 1;
break;
#endif /* HAVE_INNOBASE_DB */
case OPT_MYISAM_RECOVER:
--- 1.51/innobase/include/srv0srv.h 2005-03-09 13:37:13 +01:00
+++ 1.52/innobase/include/srv0srv.h 2005-04-15 18:00:26 +02:00
@@ -99,11 +99,13 @@
extern lint srv_conc_n_threads;
-extern ibool srv_fast_shutdown;
-extern ibool srv_very_fast_shutdown; /* if this TRUE, do not flush the
+extern ulint srv_fast_shutdown; /* If this is 1, do not do a
+ purge and index buffer merge.
+ If this 2, do not even flush the
buffer pool to data files at the
- shutdown; we effectively 'crash'
- InnoDB */
+ shutdown: we effectively 'crash'
+ InnoDB (but lose no committed
+ transactions). */
extern ibool srv_innodb_status;
extern ibool srv_use_doublewrite_buf;
--- 1.41/innobase/log/log0log.c 2005-03-09 00:32:50 +01:00
+++ 1.42/innobase/log/log0log.c 2005-04-15 18:00:27 +02:00
@@ -3059,15 +3059,13 @@
goto loop;
}
- if (srv_very_fast_shutdown) {
- /* In a 'very fast' shutdown we do not flush the buffer pool:
+ if (srv_fast_shutdown == 2) {
+ /* In this fastest shutdown we do not flush the buffer pool:
it is essentially a 'crash' of the InnoDB server.
- Make sure that the log is all flushed to disk, so that
+ Make sure that the log is all flushed to disk, so that
we can recover all committed transactions in a crash
recovery.
- In a 'very fast' shutdown we do not flush the buffer pool:
- it is essentially a 'crash' of the InnoDB server. Then we must
- not write the lsn stamps to the data files, since at a
+ We must not write the lsn stamps to the data files, since at a
startup InnoDB deduces from the stamps if the previous
shutdown was clean. */
--- 1.87/innobase/srv/srv0srv.c 2005-03-09 13:37:14 +01:00
+++ 1.88/innobase/srv/srv0srv.c 2005-04-15 18:00:27 +02:00
@@ -300,15 +300,12 @@
#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 @@
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;
--- 1.79/innobase/srv/srv0start.c 2005-04-06 20:29:11 +02:00
+++ 1.80/innobase/srv/srv0start.c 2005-04-15 18:00:27 +02:00
@@ -1729,6 +1729,15 @@
The step 1 is the real InnoDB shutdown. The remaining steps 2 - ...
just free data structures after the shutdown. */
+
+ if (srv_fast_shutdown == 2) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: MySQL has requested a very fast shutdown without flushing "
+"the InnoDB buffer pool to data files. At the next mysqld startup "
+"InnoDB will do a crash recovery!\n");
+ }
+
#ifdef __NETWARE__
if(!panic_shutdown)
#endif
--- 1.192/sql/ha_innodb.cc 2005-04-14 10:11:57 +02:00
+++ 1.193/sql/ha_innodb.cc 2005-04-15 18:00:27 +02:00
@@ -116,15 +116,12 @@
values */
uint innobase_flush_log_at_trx_commit = 1;
+ulong innobase_fast_shutdown = 1;
my_bool innobase_log_archive = FALSE;/* unused */
my_bool innobase_use_doublewrite = TRUE;
my_bool innobase_use_checksums = TRUE;
my_bool innobase_use_large_pages = FALSE;
my_bool innobase_use_native_aio = FALSE;
-my_bool innobase_fast_shutdown = TRUE;
-my_bool innobase_very_fast_shutdown = FALSE; /* this can be set to
- 1 just prior calling
- innobase_end() */
my_bool innobase_file_per_table = FALSE;
my_bool innobase_locks_unsafe_for_binlog = FALSE;
my_bool innobase_create_status_file = FALSE;
@@ -1238,8 +1235,6 @@
srv_lock_wait_timeout = (ulint) innobase_lock_wait_timeout;
srv_force_recovery = (ulint) innobase_force_recovery;
- srv_fast_shutdown = (ibool) innobase_fast_shutdown;
-
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
srv_use_checksums = (ibool) innobase_use_checksums;
@@ -1330,17 +1325,7 @@
#endif
if (innodb_inited) {
-#ifndef __NETWARE__ /* NetWare can't close unclosed files, kill remaining
- threads, etc, so we disable the very fast shutdown */
- if (innobase_very_fast_shutdown) {
- srv_very_fast_shutdown = TRUE;
- fprintf(stderr,
-"InnoDB: MySQL has requested a very fast shutdown without flushing\n"
-"InnoDB: the InnoDB buffer pool to data files. At the next mysqld startup\n"
-"InnoDB: InnoDB will do a crash recovery!\n");
- }
-#endif
-
+ srv_fast_shutdown = (ulint) innobase_fast_shutdown;
innodb_inited = 0;
if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
err = 1;
--- 1.91/sql/ha_innodb.h 2005-04-11 12:11:47 +02:00
+++ 1.92/sql/ha_innodb.h 2005-04-15 18:00:27 +02:00
@@ -210,7 +210,7 @@
extern struct show_var_st innodb_status_variables[];
extern uint innobase_init_flags, innobase_lock_type;
extern uint innobase_flush_log_at_trx_commit;
-extern ulong innobase_cache_size;
+extern ulong innobase_cache_size, innobase_fast_shutdown;
extern ulong innobase_large_page_size;
extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
extern long innobase_lock_scan_time;
@@ -229,7 +229,7 @@
innobase_use_doublewrite,
innobase_use_checksums,
innobase_use_large_pages,
- innobase_use_native_aio, innobase_fast_shutdown,
+ innobase_use_native_aio,
innobase_file_per_table, innobase_locks_unsafe_for_binlog,
innobase_create_status_file;
extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before
--- 1.103/sql/set_var.cc 2005-04-05 13:17:40 +02:00
+++ 1.104/sql/set_var.cc 2005-04-15 18:00:28 +02:00
@@ -386,6 +386,8 @@
&SV::net_wait_timeout);
#ifdef HAVE_INNOBASE_DB
+sys_var_long_ptr sys_innodb_fast_shutdown("innodb_fast_shutdown",
+ &innobase_fast_shutdown);
sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct",
&srv_max_buf_pool_modified_pct);
sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag",
@@ -689,6 +691,7 @@
&sys_tx_isolation,
&sys_os,
#ifdef HAVE_INNOBASE_DB
+ &sys_innodb_fast_shutdown,
&sys_innodb_max_dirty_pages_pct,
&sys_innodb_max_purge_lag,
&sys_innodb_table_locks,
@@ -795,7 +798,7 @@
{"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR},
{"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR},
{"innodb_doublewrite", (char*) &innobase_use_doublewrite, SHOW_MY_BOOL},
- {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL},
+ {sys_innodb_fast_shutdown.name,(char*) &sys_innodb_fast_shutdown, SHOW_SYS},
{"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
{"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL},
{"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit,
SHOW_INT},
| Thread |
|---|
| • bk commit into 5.0 tree (gbichot:1.1837) | guilhem | 15 Apr |