diff options
Diffstat (limited to 'storage/innobase/srv/srv0start.cc')
-rw-r--r-- | storage/innobase/srv/srv0start.cc | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 1c2bfcbd920..d1be5be9238 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1522,6 +1522,7 @@ innobase_start_or_create_for_mysql(void) char logfilename[10000]; char* logfile0 = NULL; size_t dirnamelen; + bool sys_datafiles_created = false; if (srv_force_recovery > SRV_FORCE_NO_TRX_UNDO) { srv_read_only_mode = true; @@ -1647,6 +1648,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" @@ -2448,6 +2462,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); } @@ -2621,13 +2644,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 */ @@ -2652,10 +2668,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; |