summaryrefslogtreecommitdiff
path: root/innobase/srv/srv0srv.c
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-10-13 20:04:52 +0300
committerunknown <heikki@hundin.mysql.fi>2004-10-13 20:04:52 +0300
commit7b1f818d913f4ff96c2e33a7ffc4f3ad688374a5 (patch)
tree085896d71c407139f1c00651549adbe7462bde15 /innobase/srv/srv0srv.c
parent8983293d3b2449d0ecb2cd070e6dbd21610bbc1b (diff)
downloadmariadb-git-7b1f818d913f4ff96c2e33a7ffc4f3ad688374a5.tar.gz
srv0srv.c, log0log.c, srv0srv.h, ha_innodb.cc, ha_innodb.h:
Implement innobase_very_fast_shutdown and innobase_start_trx_and_assign_read_view(); these were requested by Guilhem sql/ha_innodb.h: Implement innobase_very_fast_shutdown and innobase_start_trx_and_assign_read_view(); these were requested by Guilhem sql/ha_innodb.cc: Implement innobase_very_fast_shutdown and innobase_start_trx_and_assign_read_view(); these were requested by Guilhem innobase/include/srv0srv.h: Implement innobase_very_fast_shutdown and innobase_start_trx_and_assign_read_view(); these were requested by Guilhem innobase/log/log0log.c: Implement innobase_very_fast_shutdown and innobase_start_trx_and_assign_read_view(); these were requested by Guilhem innobase/srv/srv0srv.c: Implement innobase_very_fast_shutdown and innobase_start_trx_and_assign_read_view(); these were requested by Guilhem
Diffstat (limited to 'innobase/srv/srv0srv.c')
-rw-r--r--innobase/srv/srv0srv.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index adffe06ef0a..d913d77fdfc 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -249,6 +249,10 @@ merge to completion before shutdown */
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;
@@ -2178,7 +2182,8 @@ loop:
/*****************************************************************/
background_loop:
/* ---- In this loop we run background operations when the server
- is quiet from user activity */
+ is quiet from user activity. Also in the case of a shutdown, we
+ loop here, flushing the buffer pool to the data files. */
/* The server has been quiet for a while: start running background
operations */
@@ -2251,7 +2256,16 @@ background_loop:
flush_loop:
srv_main_thread_op_info = "flushing buffer pool pages";
- n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max);
+
+ if (!srv_very_fast_shutdown) {
+ 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
+ to data files: we set n_pages_flushed to 0 artificially. */
+
+ n_pages_flushed = 0;
+ }
srv_main_thread_op_info = "reserving kernel mutex";
@@ -2304,7 +2318,10 @@ flush_loop:
/* If we are doing a fast shutdown (= the default)
we do not do purge or insert buffer merge. But we
- flush the buffer pool completely to disk. */
+ flush the buffer pool completely to disk.
+ In a 'very fast' shutdown we do not flush the buffer
+ pool to data files: we have set n_pages_flushed to
+ 0 artificially. */
goto background_loop;
}