summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0mon.cc5
-rw-r--r--storage/innobase/srv/srv0srv.cc6
-rw-r--r--storage/innobase/srv/srv0start.cc32
3 files changed, 33 insertions, 10 deletions
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index 57409243f5e..5e15dd15db2 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 2014, MariaDB Corporation
@@ -1003,7 +1003,8 @@ static monitor_info_t innodb_counter_info[] =
{"adaptive_hash_searches_btree", "adaptive_hash_index",
"Number of searches using B-tree on an index search",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREE},
{"adaptive_hash_pages_added", "adaptive_hash_index",
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 4f72ab3f4f2..129b33f0da9 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
@@ -2687,7 +2687,9 @@ srv_do_purge(
*n_total_purged += n_pages_purged;
- } while (!srv_purge_should_exit(n_pages_purged) && n_pages_purged > 0);
+ } while (!srv_purge_should_exit(n_pages_purged)
+ && n_pages_purged > 0
+ && purge_sys->state == PURGE_STATE_RUN);
return(rseg_history_len);
}
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index cdf08b4cde1..f2de5e954ad 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
@@ -138,7 +138,7 @@ static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 + 32 + MTFLUSH_MAX_WOR
void *mtflush_ctx=NULL;
/** Thead handles */
-static os_thread_t thread_handles[SRV_MAX_N_IO_THREADS + 6 + 32];
+static os_thread_t thread_handles[SRV_MAX_N_IO_THREADS + 6 + 32 + MTFLUSH_MAX_WORKER];
static os_thread_t buf_flush_page_cleaner_thread_handle;
static os_thread_t buf_dump_thread_handle;
static os_thread_t dict_stats_thread_handle;
@@ -239,8 +239,8 @@ srv_file_check_mode(
/* Note: stat.rw_perm is only valid of files */
- if (stat.type == OS_FILE_TYPE_FILE
- || stat.type == OS_FILE_TYPE_BLOCK) {
+ if (stat.type == OS_FILE_TYPE_FILE) {
+
if (!stat.rw_perm) {
ib_logf(IB_LOG_LEVEL_ERROR,
@@ -437,14 +437,16 @@ srv_parse_data_file_paths_and_sizes(
&& *(str + 1) == 'e'
&& *(str + 2) == 'w') {
str += 3;
+ /* Initialize new raw device only during bootstrap */
(srv_data_file_is_raw_partition)[i] = SRV_NEW_RAW;
}
if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') {
str += 3;
+ /* Initialize new raw device only during bootstrap */
if ((srv_data_file_is_raw_partition)[i] == 0) {
- (srv_data_file_is_raw_partition)[i] = SRV_OLD_RAW;
+ (srv_data_file_is_raw_partition)[i] = SRV_NEW_RAW;
}
}
@@ -897,6 +899,24 @@ open_or_create_data_files(
return(DB_ERROR);
}
+
+ const char* check_msg;
+ check_msg = fil_read_first_page(
+ files[i], FALSE, &flags, &space,
+#ifdef UNIV_LOG_ARCHIVE
+ min_arch_log_no, max_arch_log_no,
+#endif /* UNIV_LOG_ARCHIVE */
+ min_flushed_lsn, max_flushed_lsn, ULINT_UNDEFINED);
+
+ /* If first page is valid, don't overwrite DB.
+ It prevents overwriting DB when mysql_install_db
+ starts mysqld multiple times during bootstrap. */
+ if (check_msg == NULL) {
+
+ srv_created_new_raw = FALSE;
+ ret = FALSE;
+ }
+
} else if (srv_data_file_is_raw_partition[i] == SRV_OLD_RAW) {
srv_start_raw_disk_in_use = TRUE;
@@ -3121,9 +3141,9 @@ innobase_shutdown_for_mysql(void)
ibuf_close();
log_shutdown();
- lock_sys_close();
trx_sys_file_format_close();
trx_sys_close();
+ lock_sys_close();
/* We don't create these mutexes in RO mode because we don't create
the temp files that the cover. */