summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
committerSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
commitf62c12b405ba7ec80b8e2490856b83c6f5899211 (patch)
tree010605c7f145da6ea6ac14b39abc4cf700d619b1 /storage/innobase/srv
parentf947f73b2b6d2bd246b81a9038224d2a85777520 (diff)
parentf1afc003eefe0aafd3e070c7453d9e029d8445a8 (diff)
downloadmariadb-git-f62c12b405ba7ec80b8e2490856b83c6f5899211.tar.gz
Merge 10.0.14 into 10.1
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0mon.cc4
-rw-r--r--storage/innobase/srv/srv0srv.cc16
-rw-r--r--storage/innobase/srv/srv0start.cc45
3 files changed, 47 insertions, 18 deletions
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index f276efdc021..5880e03073e 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -41,8 +41,8 @@ Created 12/9/2009 Jimmy Yang
/* Macro to standardize the counter names for counters in the
"monitor_buf_page" module as they have very structured defines */
#define MONITOR_BUF_PAGE(name, description, code, op, op_code) \
- {"buffer_page_"op"_"name, "buffer_page_io", \
- "Number of "description" Pages "op, \
+ {"buffer_page_" op "_" name, "buffer_page_io", \
+ "Number of " description " Pages " op, \
MONITOR_GROUP_MODULE, MONITOR_DEFAULT_START, \
MONITOR_##code##_##op_code}
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 0c0075c98f1..ca5c22d8ee4 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -376,7 +376,12 @@ UNIV_INTERN ulong srv_doublewrite_batch_size = 120;
UNIV_INTERN ulong srv_replication_delay = 0;
/*-------------------------------------------*/
+#ifdef HAVE_MEMORY_BARRIER
+/* No idea to wait long with memory barriers */
+UNIV_INTERN ulong srv_n_spin_wait_rounds = 15;
+#else
UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
+#endif
UNIV_INTERN ulong srv_spin_wait_delay = 6;
UNIV_INTERN ibool srv_priority_boost = TRUE;
@@ -509,6 +514,9 @@ current_time % 5 != 0. */
#endif /* MEM_PERIODIC_CHECK */
# define SRV_MASTER_DICT_LRU_INTERVAL (47)
+/** Simulate compression failures. */
+UNIV_INTERN uint srv_simulate_comp_failures = 0;
+
/** Acquire the system_mutex. */
#define srv_sys_mutex_enter() do { \
mutex_enter(&srv_sys->mutex); \
@@ -1775,9 +1783,10 @@ loop:
/* Try to track a strange bug reported by Harald Fuchs and others,
where the lsn seems to decrease at times */
- new_lsn = log_get_lsn();
+ /* We have to use nowait to ensure we don't block */
+ new_lsn= log_get_lsn_nowait();
- if (new_lsn < old_lsn) {
+ if (new_lsn && new_lsn < old_lsn) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: old log sequence number " LSN_PF
@@ -1789,7 +1798,8 @@ loop:
ut_ad(0);
}
- old_lsn = new_lsn;
+ if (new_lsn)
+ old_lsn = new_lsn;
if (difftime(time(NULL), srv_last_monitor_time) > 60) {
/* We referesh InnoDB Monitor values so that averages are
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index bfdcbfaeee0..2692636dcb5 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1533,6 +1533,7 @@ innobase_start_or_create_for_mysql(void)
char logfilename[10000];
char* logfile0 = NULL;
size_t dirnamelen;
+ bool sys_datafiles_created = false;
/* This should be initialized early */
ut_init_timer();
@@ -1661,6 +1662,19 @@ innobase_start_or_create_for_mysql(void)
"" IB_ATOMICS_STARTUP_MSG "");
ib_logf(IB_LOG_LEVEL_INFO,
+ "" IB_MEMORY_BARRIER_STARTUP_MSG "");
+
+#ifndef HAVE_MEMORY_BARRIER
+#if defined __i386__ || defined __x86_64__ || defined _M_IX86 || defined _M_X64 || defined __WIN__
+#else
+ ib_logf(IB_LOG_LEVEL_WARN,
+ "MySQL was built without a memory barrier capability on this"
+ " architecture, which might allow a mutex/rw_lock violation"
+ " under high thread concurrency. This may cause a hang.");
+#endif /* IA32 or AMD64 */
+#endif /* HAVE_MEMORY_BARRIER */
+
+ ib_logf(IB_LOG_LEVEL_INFO,
"Compressed tables use zlib " ZLIB_VERSION
#ifdef UNIV_ZIP_DEBUG
" with validation"
@@ -2211,9 +2225,9 @@ innobase_start_or_create_for_mysql(void)
} else if (size != srv_log_file_size) {
ib_logf(IB_LOG_LEVEL_ERROR,
"Log file %s is"
- " of different size "UINT64PF" bytes"
+ " of different size " UINT64PF " bytes"
" than other log"
- " files "UINT64PF" bytes!",
+ " files " UINT64PF " bytes!",
logfilename,
size << UNIV_PAGE_SIZE_SHIFT,
(os_offset_t) srv_log_file_size
@@ -2462,6 +2476,15 @@ files_checked:
dict_check = DICT_CHECK_NONE_LOADED;
}
+ /* Create the SYS_TABLESPACES and SYS_DATAFILES system table */
+ err = dict_create_or_check_sys_tablespace();
+ if (err != DB_SUCCESS) {
+ return(err);
+ }
+
+ sys_datafiles_created = true;
+
+ /* This function assumes that SYS_DATAFILES exists */
dict_check_tablespaces_and_store_max_id(dict_check);
}
@@ -2635,13 +2658,6 @@ files_checked:
srv_undo_logs = ULONG_UNDEFINED;
}
- /* Flush the changes made to TRX_SYS_PAGE by trx_sys_create_rsegs()*/
- if (!srv_force_recovery && !srv_read_only_mode) {
- bool success = buf_flush_list(ULINT_MAX, LSN_MAX, NULL);
- ut_a(success);
- buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST);
- }
-
if (!srv_read_only_mode) {
/* Create the thread which watches the timeouts
for lock waits */
@@ -2666,10 +2682,13 @@ files_checked:
return(err);
}
- /* Create the SYS_TABLESPACES system table */
- err = dict_create_or_check_sys_tablespace();
- if (err != DB_SUCCESS) {
- return(err);
+ /* Create the SYS_TABLESPACES and SYS_DATAFILES system tables if we
+ have not done that already on crash recovery. */
+ if (sys_datafiles_created == false) {
+ err = dict_create_or_check_sys_tablespace();
+ if (err != DB_SUCCESS) {
+ return(err);
+ }
}
srv_is_being_started = FALSE;