diff options
Diffstat (limited to 'storage/innobase/srv/srv0start.cc')
-rw-r--r-- | storage/innobase/srv/srv0start.cc | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 00604a896ca..0c04fba421a 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2009, Percona Inc. @@ -158,7 +158,7 @@ UNIV_INTERN mysql_pfs_key_t srv_purge_thread_key; #endif /* UNIV_PFS_THREAD */ /*********************************************************************//** -Convert a numeric string that optionally ends in G or M, to a number +Convert a numeric string that optionally ends in G or M or K, to a number containing megabytes. @return next character in string */ static @@ -182,6 +182,10 @@ srv_parse_megabytes( case 'M': case 'm': str++; break; + case 'K': case 'k': + size /= 1024; + str++; + break; default: size /= 1024 * 1024; break; @@ -218,7 +222,8 @@ srv_file_check_mode( /* Note: stat.rw_perm is only valid of files */ - if (stat.type == OS_FILE_TYPE_FILE) { + if (stat.type == OS_FILE_TYPE_FILE + || stat.type == OS_FILE_TYPE_BLOCK) { if (!stat.rw_perm) { ib_logf(IB_LOG_LEVEL_ERROR, @@ -980,6 +985,16 @@ size_check: return(DB_ERROR); } skip_size_check: + + /* This is the earliest location where we can load + the double write buffer. */ + if (i == 0) { + buf_dblwr_init_or_load_pages( + files[i], srv_data_file_names[i], true); + } + + bool retry = true; +check_first_page: check_msg = fil_read_first_page( files[i], one_opened, &flags, &space, #ifdef UNIV_LOG_ARCHIVE @@ -988,9 +1003,25 @@ skip_size_check: min_flushed_lsn, max_flushed_lsn); if (check_msg) { + + if (retry) { + fsp_open_info fsp; + const ulint page_no = 0; + + retry = false; + fsp.id = 0; + fsp.filepath = srv_data_file_names[i]; + fsp.file = files[i]; + + if (fil_user_tablespace_restore_page( + &fsp, page_no)) { + goto check_first_page; + } + } + ib_logf(IB_LOG_LEVEL_ERROR, - "%s in data file %s", - check_msg, name); + "%s in data file %s", + check_msg, name); return(DB_ERROR); } @@ -1526,6 +1557,16 @@ innobase_start_or_create_for_mysql(void) # endif /* F_FULLFSYNC */ #endif /* HAVE_DARWIN_THREADS */ + ib_logf(IB_LOG_LEVEL_INFO, + "Using %s to ref count buffer pool pages", +#ifdef PAGE_ATOMIC_REF_COUNT + "atomics" +#else + "mutexes" +#endif /* PAGE_ATOMIC_REF_COUNT */ + ); + + if (sizeof(ulint) != sizeof(void*)) { ut_print_timestamp(stderr); fprintf(stderr, @@ -1999,6 +2040,9 @@ innobase_start_or_create_for_mysql(void) return(DB_ERROR); } + recv_sys_create(); + recv_sys_init(buf_pool_get_curr_size()); + err = open_or_create_data_files(&create_new_db, #ifdef UNIV_LOG_ARCHIVE &min_arch_log_no, &max_arch_log_no, |