Commit 0a96975a authored by Vasil Dimov's avatar Vasil Dimov

Make output from innobase_start_or_create_for_mysql() consistent

Prefix all printed lines with a timestamp and write one space between
the timestamp and "InnoDB:".
parent 715cf980
...@@ -1026,26 +1026,35 @@ innobase_start_or_create_for_mysql(void) ...@@ -1026,26 +1026,35 @@ innobase_start_or_create_for_mysql(void)
on Mac OS X 10.3 or later. */ on Mac OS X 10.3 or later. */
struct utsname utsname; struct utsname utsname;
if (uname(&utsname)) { if (uname(&utsname)) {
fputs("InnoDB: cannot determine Mac OS X version!\n", stderr); ut_print_timestamp(stderr);
fputs(" InnoDB: cannot determine Mac OS X version!\n", stderr);
} else { } else {
srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0; srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
} }
if (!srv_have_fullfsync) { if (!srv_have_fullfsync) {
fputs("InnoDB: On Mac OS X, fsync() may be" ut_print_timestamp(stderr);
" broken on internal drives,\n" fputs(" InnoDB: On Mac OS X, fsync() may be "
"InnoDB: making transactions unsafe!\n", stderr); "broken on internal drives,\n", stderr);
ut_print_timestamp(stderr);
fputs(" InnoDB: making transactions unsafe!\n", stderr);
} }
# endif /* F_FULLFSYNC */ # endif /* F_FULLFSYNC */
#endif /* HAVE_DARWIN_THREADS */ #endif /* HAVE_DARWIN_THREADS */
if (sizeof(ulint) != sizeof(void*)) { if (sizeof(ulint) != sizeof(void*)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: size of InnoDB's ulint is %lu, "
"but size of void*\n", (ulong) sizeof(ulint));
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: is %lu. The sizes should be the same "
"so that on a 64-bit\n",
(ulong) sizeof(void*));
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: size of InnoDB's ulint is %lu," " InnoDB: platforms you can allocate more than 4 GB "
" but size of void* is %lu.\n" "of memory.\n");
"InnoDB: The sizes should be the same"
" so that on a 64-bit platform you can\n"
"InnoDB: allocate more than 4 GB of memory.",
(ulong)sizeof(ulint), (ulong)sizeof(void*));
} }
/* System tables are created in tablespace 0. Thus, we must /* System tables are created in tablespace 0. Thus, we must
...@@ -1054,53 +1063,68 @@ innobase_start_or_create_for_mysql(void) ...@@ -1054,53 +1063,68 @@ innobase_start_or_create_for_mysql(void)
innodb_file_per_table) until this function has returned. */ innodb_file_per_table) until this function has returned. */
srv_file_per_table = FALSE; srv_file_per_table = FALSE;
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n"); " InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
#endif #endif
#ifdef UNIV_IBUF_DEBUG #ifdef UNIV_IBUF_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n" " InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n");
# ifdef UNIV_IBUF_COUNT_DEBUG # ifdef UNIV_IBUF_COUNT_DEBUG
"InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n" ut_print_timestamp(stderr);
"InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n" fprintf(stderr,
" InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on "
"!!!!!!!!!\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n");
# endif # endif
);
#endif #endif
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n"); " InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
#endif #endif
#ifdef UNIV_SEARCH_DEBUG #ifdef UNIV_SEARCH_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n"); " InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
#endif #endif
#ifdef UNIV_LOG_LSN_DEBUG #ifdef UNIV_LOG_LSN_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n"); " InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
#endif /* UNIV_LOG_LSN_DEBUG */ #endif /* UNIV_LOG_LSN_DEBUG */
#ifdef UNIV_MEM_DEBUG #ifdef UNIV_MEM_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n"); " InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
#endif #endif
if (UNIV_LIKELY(srv_use_sys_malloc)) { if (UNIV_LIKELY(srv_use_sys_malloc)) {
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: The InnoDB memory heap is disabled\n"); " InnoDB: The InnoDB memory heap is disabled\n");
} }
fputs("InnoDB: " IB_ATOMICS_STARTUP_MSG ut_print_timestamp(stderr);
"\nInnoDB: Compressed tables use zlib " ZLIB_VERSION fputs(" InnoDB: " IB_ATOMICS_STARTUP_MSG "\n", stderr);
ut_print_timestamp(stderr);
fputs(" InnoDB: Compressed tables use zlib " ZLIB_VERSION
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
" with validation" " with validation"
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
"\n" , stderr);
#ifdef UNIV_ZIP_COPY #ifdef UNIV_ZIP_COPY
" and extra copying" ut_print_timestamp(stderr);
fputs(" InnoDB: and extra copying\n", stderr);
#endif /* UNIV_ZIP_COPY */ #endif /* UNIV_ZIP_COPY */
"\n" , stderr);
/* Since InnoDB does not currently clean up all its internal data /* Since InnoDB does not currently clean up all its internal data
structures in MySQL Embedded Server Library server_end(), we structures in MySQL Embedded Server Library server_end(), we
...@@ -1108,13 +1132,17 @@ innobase_start_or_create_for_mysql(void) ...@@ -1108,13 +1132,17 @@ innobase_start_or_create_for_mysql(void)
second time during the process lifetime. */ second time during the process lifetime. */
if (srv_start_has_been_called) { if (srv_start_has_been_called) {
fprintf(stderr, ut_print_timestamp(stderr);
"InnoDB: Error: startup called second time" fprintf(stderr, " InnoDB: Error: startup called second time "
" during the process lifetime.\n" "during the process\n");
"InnoDB: In the MySQL Embedded Server Library" ut_print_timestamp(stderr);
" you cannot call server_init()\n" fprintf(stderr, " InnoDB: lifetime. In the MySQL Embedded "
"InnoDB: more than once during" "Server Library you\n");
" the process lifetime.\n"); ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: cannot call server_init() more "
"than once during the\n");
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: process lifetime.\n");
} }
srv_start_has_been_called = TRUE; srv_start_has_been_called = TRUE;
...@@ -1158,7 +1186,7 @@ innobase_start_or_create_for_mysql(void) ...@@ -1158,7 +1186,7 @@ innobase_start_or_create_for_mysql(void)
if (srv_use_native_aio) { if (srv_use_native_aio) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Using Linux native AIO\n"); " InnoDB: Using Linux native AIO\n");
} }
#else #else
/* Currently native AIO is supported only on windows and linux /* Currently native AIO is supported only on windows and linux
...@@ -1203,8 +1231,9 @@ innobase_start_or_create_for_mysql(void) ...@@ -1203,8 +1231,9 @@ innobase_start_or_create_for_mysql(void)
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED; srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
#endif #endif
} else { } else {
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Unrecognized value %s for" " InnoDB: Unrecognized value %s for"
" innodb_flush_method\n", " innodb_flush_method\n",
srv_file_flush_method_str); srv_file_flush_method_str);
return(DB_ERROR); return(DB_ERROR);
...@@ -1285,7 +1314,8 @@ innobase_start_or_create_for_mysql(void) ...@@ -1285,7 +1314,8 @@ innobase_start_or_create_for_mysql(void)
we'll emit a message telling the user that this parameter we'll emit a message telling the user that this parameter
is now deprecated. */ is now deprecated. */
if (srv_n_file_io_threads != 4) { if (srv_n_file_io_threads != 4) {
fprintf(stderr, "InnoDB: Warning:" ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Warning:"
" innodb_file_io_threads is deprecated." " innodb_file_io_threads is deprecated."
" Please use innodb_read_io_threads and" " Please use innodb_read_io_threads and"
" innodb_write_io_threads instead\n"); " innodb_write_io_threads instead\n");
...@@ -1316,7 +1346,7 @@ innobase_start_or_create_for_mysql(void) ...@@ -1316,7 +1346,7 @@ innobase_start_or_create_for_mysql(void)
/* Print time to initialize the buffer pool */ /* Print time to initialize the buffer pool */
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Initializing buffer pool, size ="); " InnoDB: Initializing buffer pool, size =");
if (srv_buf_pool_size >= 1024 * 1024 * 1024) { if (srv_buf_pool_size >= 1024 * 1024 * 1024) {
fprintf(stderr, fprintf(stderr,
...@@ -1332,11 +1362,12 @@ innobase_start_or_create_for_mysql(void) ...@@ -1332,11 +1362,12 @@ innobase_start_or_create_for_mysql(void)
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Completed initialization of buffer pool\n"); " InnoDB: Completed initialization of buffer pool\n");
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Fatal error: cannot allocate the memory" " InnoDB: Fatal error: cannot allocate memory"
" for the buffer pool\n"); " for the buffer pool\n");
return(DB_ERROR); return(DB_ERROR);
...@@ -1348,7 +1379,8 @@ innobase_start_or_create_for_mysql(void) ...@@ -1348,7 +1379,8 @@ innobase_start_or_create_for_mysql(void)
if (srv_buf_pool_size <= 5 * 1024 * 1024) { if (srv_buf_pool_size <= 5 * 1024 * 1024) {
fprintf(stderr, "InnoDB: Warning: Small buffer pool size " ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Warning: Small buffer pool size "
"(%luM), the flst_validate() debug function " "(%luM), the flst_validate() debug function "
"can cause a deadlock if the buffer pool fills up.\n", "can cause a deadlock if the buffer pool fills up.\n",
srv_buf_pool_size / 1024 / 1024); srv_buf_pool_size / 1024 / 1024);
...@@ -1370,18 +1402,19 @@ innobase_start_or_create_for_mysql(void) ...@@ -1370,18 +1402,19 @@ innobase_start_or_create_for_mysql(void)
#ifdef UNIV_LOG_ARCHIVE #ifdef UNIV_LOG_ARCHIVE
if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) { if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) {
fprintf(stderr, ut_print_timestamp(stderr);
"InnoDB: Error: you must set the log group" fprintf(stderr, " InnoDB: Error: you must set the log group home dir in my.cnf\n");
" home dir in my.cnf the\n" ut_print_timestamp(stderr);
"InnoDB: same as log arch dir.\n"); fprintf(stderr, " InnoDB: the same as log arch dir.\n");
return(DB_ERROR); return(DB_ERROR);
} }
#endif /* UNIV_LOG_ARCHIVE */ #endif /* UNIV_LOG_ARCHIVE */
if (srv_n_log_files * srv_log_file_size >= 262144) { if (srv_n_log_files * srv_log_file_size >= 262144) {
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: combined size of log files" " InnoDB: Error: combined size of log files"
" must be < 4 GB\n"); " must be < 4 GB\n");
return(DB_ERROR); return(DB_ERROR);
...@@ -1392,10 +1425,13 @@ innobase_start_or_create_for_mysql(void) ...@@ -1392,10 +1425,13 @@ innobase_start_or_create_for_mysql(void)
for (i = 0; i < srv_n_data_files; i++) { for (i = 0; i < srv_n_data_files; i++) {
#ifndef __WIN__ #ifndef __WIN__
if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) { if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: file size must be < 4 GB" " InnoDB: Error: file size must be < 4 GB"
" with this MySQL binary\n" " with this MySQL binary\n");
"InnoDB: and operating system combination," ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: and operating system combination,"
" in some OS's < 2 GB\n"); " in some OS's < 2 GB\n");
return(DB_ERROR); return(DB_ERROR);
...@@ -1405,8 +1441,9 @@ innobase_start_or_create_for_mysql(void) ...@@ -1405,8 +1441,9 @@ innobase_start_or_create_for_mysql(void)
} }
if (sum_of_new_sizes < 10485760 / UNIV_PAGE_SIZE) { if (sum_of_new_sizes < 10485760 / UNIV_PAGE_SIZE) {
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: tablespace size must be" " InnoDB: Error: tablespace size must be"
" at least 10 MB\n"); " at least 10 MB\n");
return(DB_ERROR); return(DB_ERROR);
...@@ -1419,19 +1456,32 @@ innobase_start_or_create_for_mysql(void) ...@@ -1419,19 +1456,32 @@ innobase_start_or_create_for_mysql(void)
&min_flushed_lsn, &max_flushed_lsn, &min_flushed_lsn, &max_flushed_lsn,
&sum_of_new_sizes); &sum_of_new_sizes);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Could not open or create data files.\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: If you tried to add new data files,"
" and it failed here,\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: you should now edit innodb_data_file_path"
" in my.cnf back\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: to what it was, and remove the"
" new ibdata files InnoDB created\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: in this failed attempt. InnoDB only wrote"
" those files full of\n");
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Could not open or create data files.\n" " InnoDB: zeros, but did not yet use them in any way."
"InnoDB: If you tried to add new data files," " But be careful: do not\n");
" and it failed here,\n" ut_print_timestamp(stderr);
"InnoDB: you should now edit innodb_data_file_path" fprintf(stderr,
" in my.cnf back\n" " InnoDB: remove old data files"
"InnoDB: to what it was, and remove the"
" new ibdata files InnoDB created\n"
"InnoDB: in this failed attempt. InnoDB only wrote"
" those files full of\n"
"InnoDB: zeros, but did not yet use them in any way."
" But be careful: do not\n"
"InnoDB: remove old data files"
" which contain your precious data!\n"); " which contain your precious data!\n");
return((int) err); return((int) err);
...@@ -1457,18 +1507,29 @@ innobase_start_or_create_for_mysql(void) ...@@ -1457,18 +1507,29 @@ innobase_start_or_create_for_mysql(void)
} }
if ((log_opened && create_new_db) if ((log_opened && create_new_db)
|| (log_opened && log_created)) { || (log_opened && log_created)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: all log files must be"
" created at the same time.\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: All log files must be"
" created also in database creation.\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: If you want bigger or smaller"
" log files, shut down the\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: database and make sure there"
" were no errors in shutdown.\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Then delete the existing log files."
" Edit the .cnf file\n");
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: all log files must be" " InnoDB: and start the database again.\n");
" created at the same time.\n"
"InnoDB: All log files must be"
" created also in database creation.\n"
"InnoDB: If you want bigger or smaller"
" log files, shut down the\n"
"InnoDB: database and make sure there"
" were no errors in shutdown.\n"
"InnoDB: Then delete the existing log files."
" Edit the .cnf file\n"
"InnoDB: and start the database again.\n");
return(DB_ERROR); return(DB_ERROR);
} }
...@@ -1489,27 +1550,41 @@ innobase_start_or_create_for_mysql(void) ...@@ -1489,27 +1550,41 @@ innobase_start_or_create_for_mysql(void)
|| max_arch_log_no != min_arch_log_no || max_arch_log_no != min_arch_log_no
#endif /* UNIV_LOG_ARCHIVE */ #endif /* UNIV_LOG_ARCHIVE */
) { ) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Cannot initialize created"
" log files because\n");
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Cannot initialize created" " InnoDB: data files were not in sync"
" log files because\n" " with each other\n");
"InnoDB: data files were not in sync" ut_print_timestamp(stderr);
" with each other\n" fprintf(stderr,
"InnoDB: or the data files are corrupt.\n"); " InnoDB: or the data files are corrupt.\n");
return(DB_ERROR); return(DB_ERROR);
} }
if (max_flushed_lsn < (ib_uint64_t) 1000) { if (max_flushed_lsn < (ib_uint64_t) 1000) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Cannot initialize created"
" log files because\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: data files are corrupt,"
" or new data files were\n");
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Cannot initialize created" " InnoDB: created when the database"
" log files because\n" " was started previous\n");
"InnoDB: data files are corrupt," ut_print_timestamp(stderr);
" or new data files were\n" fprintf(stderr,
"InnoDB: created when the database" " InnoDB: time but the database"
" was started previous\n" " was not shut down\n");
"InnoDB: time but the database" ut_print_timestamp(stderr);
" was not shut down\n" fprintf(stderr,
"InnoDB: normally after that.\n"); " InnoDB: normally after that.\n");
return(DB_ERROR); return(DB_ERROR);
} }
...@@ -1548,8 +1623,9 @@ innobase_start_or_create_for_mysql(void) ...@@ -1548,8 +1623,9 @@ innobase_start_or_create_for_mysql(void)
#ifdef UNIV_LOG_ARCHIVE #ifdef UNIV_LOG_ARCHIVE
} else if (srv_archive_recovery) { } else if (srv_archive_recovery) {
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Starting archive" " InnoDB: Starting archive"
" recovery from a backup...\n"); " recovery from a backup...\n");
err = recv_recovery_from_archive_start( err = recv_recovery_from_archive_start(
min_flushed_lsn, srv_archive_recovery_limit_lsn, min_flushed_lsn, srv_archive_recovery_limit_lsn,
...@@ -1771,11 +1847,14 @@ innobase_start_or_create_for_mysql(void) ...@@ -1771,11 +1847,14 @@ innobase_start_or_create_for_mysql(void)
if (!srv_auto_extend_last_data_file if (!srv_auto_extend_last_data_file
&& sum_of_data_file_sizes != tablespace_size_in_header) { && sum_of_data_file_sizes != tablespace_size_in_header) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: tablespace size"
" stored in header is %lu pages, but\n",
(ulong) tablespace_size_in_header);
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: tablespace size"
" stored in header is %lu pages, but\n"
"InnoDB: the sum of data file sizes is %lu pages\n", "InnoDB: the sum of data file sizes is %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes); (ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0 if (srv_force_recovery == 0
...@@ -1783,16 +1862,25 @@ innobase_start_or_create_for_mysql(void) ...@@ -1783,16 +1862,25 @@ innobase_start_or_create_for_mysql(void)
/* This is a fatal error, the tail of a tablespace is /* This is a fatal error, the tail of a tablespace is
missing */ missing */
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Cannot start InnoDB." " InnoDB: Cannot start InnoDB."
" The tail of the system tablespace is\n" " The tail of the system tablespace is\n");
"InnoDB: missing. Have you edited" ut_print_timestamp(stderr);
" innodb_data_file_path in my.cnf in an\n" fprintf(stderr,
"InnoDB: inappropriate way, removing" " InnoDB: missing. Have you edited"
" ibdata files from there?\n" " innodb_data_file_path in my.cnf in an\n");
"InnoDB: You can set innodb_force_recovery=1" ut_print_timestamp(stderr);
" in my.cnf to force\n" fprintf(stderr,
"InnoDB: a startup if you are trying" " InnoDB: inappropriate way, removing"
" ibdata files from there?\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: You can set innodb_force_recovery=1"
" in my.cnf to force\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: a startup if you are trying"
" to recover a badly corrupt database.\n"); " to recover a badly corrupt database.\n");
return(DB_ERROR); return(DB_ERROR);
...@@ -1802,26 +1890,38 @@ innobase_start_or_create_for_mysql(void) ...@@ -1802,26 +1890,38 @@ innobase_start_or_create_for_mysql(void)
if (srv_auto_extend_last_data_file if (srv_auto_extend_last_data_file
&& sum_of_data_file_sizes < tablespace_size_in_header) { && sum_of_data_file_sizes < tablespace_size_in_header) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: tablespace size stored in header"
" is %lu pages, but\n",
(ulong) tablespace_size_in_header);
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: tablespace size stored in header" " InnoDB: the sum of data file sizes"
" is %lu pages, but\n"
"InnoDB: the sum of data file sizes"
" is only %lu pages\n", " is only %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes); (ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0) { if (srv_force_recovery == 0) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Cannot start InnoDB. The tail of"
" the system tablespace is\n");
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Cannot start InnoDB. The tail of" " InnoDB: missing. Have you edited"
" the system tablespace is\n" " innodb_data_file_path in my.cnf in an\n");
"InnoDB: missing. Have you edited" ut_print_timestamp(stderr);
" innodb_data_file_path in my.cnf in an\n" fprintf(stderr,
"InnoDB: inappropriate way, removing" " InnoDB: inappropriate way, removing"
" ibdata files from there?\n" " ibdata files from there?\n");
"InnoDB: You can set innodb_force_recovery=1" ut_print_timestamp(stderr);
" in my.cnf to force\n" fprintf(stderr,
"InnoDB: a startup if you are trying to" " InnoDB: You can set innodb_force_recovery=1"
" in my.cnf to force\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: a startup if you are trying to"
" recover a badly corrupt database.\n"); " recover a badly corrupt database.\n");
return(DB_ERROR); return(DB_ERROR);
...@@ -1832,10 +1932,13 @@ innobase_start_or_create_for_mysql(void) ...@@ -1832,10 +1932,13 @@ innobase_start_or_create_for_mysql(void)
os_fast_mutex_init(&srv_os_test_mutex); os_fast_mutex_init(&srv_os_test_mutex);
if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) { if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: pthread_mutex_trylock returns"
" an unexpected value on\n");
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: pthread_mutex_trylock returns" " InnoDB: success! Cannot continue.\n");
" an unexpected value on\n"
"InnoDB: success! Cannot continue.\n");
exit(1); exit(1);
} }
...@@ -1850,14 +1953,15 @@ innobase_start_or_create_for_mysql(void) ...@@ -1850,14 +1953,15 @@ innobase_start_or_create_for_mysql(void)
if (srv_print_verbose_log) { if (srv_print_verbose_log) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: %s started; " " InnoDB: %s started; "
"log sequence number %llu\n", "log sequence number %llu\n",
INNODB_VERSION_STR, srv_start_lsn); INNODB_VERSION_STR, srv_start_lsn);
} }
if (srv_force_recovery > 0) { if (srv_force_recovery > 0) {
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: !!! innodb_force_recovery" " InnoDB: !!! innodb_force_recovery"
" is set to %lu !!!\n", " is set to %lu !!!\n",
(ulong) srv_force_recovery); (ulong) srv_force_recovery);
} }
...@@ -1878,12 +1982,17 @@ innobase_start_or_create_for_mysql(void) ...@@ -1878,12 +1982,17 @@ innobase_start_or_create_for_mysql(void)
4.1.1. It is essential that the insert buffer is emptied 4.1.1. It is essential that the insert buffer is emptied
here! */ here! */
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: You are upgrading to an"
" InnoDB version which allows multiple\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: tablespaces. Wait that purge"
" and insert buffer merge run to\n");
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: You are upgrading to an" " InnoDB: completion...\n");
" InnoDB version which allows multiple\n"
"InnoDB: tablespaces. Wait that purge"
" and insert buffer merge run to\n"
"InnoDB: completion...\n");
for (;;) { for (;;) {
os_thread_sleep(1000000); os_thread_sleep(1000000);
...@@ -1895,21 +2004,29 @@ innobase_start_or_create_for_mysql(void) ...@@ -1895,21 +2004,29 @@ innobase_start_or_create_for_mysql(void)
break; break;
} }
} }
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: Full purge and insert buffer merge" " InnoDB: Full purge and insert buffer merge"
" completed.\n"); " completed.\n");
trx_sys_mark_upgraded_to_multiple_tablespaces(); trx_sys_mark_upgraded_to_multiple_tablespaces();
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: You have now successfully upgraded"
" to the multiple tablespaces\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: format. You should NOT DOWNGRADE"
" to an earlier version of\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: InnoDB! But if you absolutely need to"
" downgrade, see\n");
ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
"InnoDB: You have now successfully upgraded" " InnoDB: " REFMAN "multiple-tablespaces.html\n"
" to the multiple tablespaces\n" " InnoDB: for instructions.\n");
"InnoDB: format. You should NOT DOWNGRADE"
" to an earlier version of\n"
"InnoDB: InnoDB! But if you absolutely need to"
" downgrade, see\n"
"InnoDB: " REFMAN "multiple-tablespaces.html\n"
"InnoDB: for instructions.\n");
} }
if (srv_force_recovery == 0) { if (srv_force_recovery == 0) {
......
...@@ -1160,7 +1160,7 @@ trx_sys_file_format_max_check( ...@@ -1160,7 +1160,7 @@ trx_sys_file_format_max_check(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: highest supported file format is %s.\n", " InnoDB: highest supported file format is %s.\n",
trx_sys_file_format_id_to_name(DICT_TF_FORMAT_MAX)); trx_sys_file_format_id_to_name(DICT_TF_FORMAT_MAX));
if (format_id > DICT_TF_FORMAT_MAX) { if (format_id > DICT_TF_FORMAT_MAX) {
...@@ -1169,7 +1169,7 @@ trx_sys_file_format_max_check( ...@@ -1169,7 +1169,7 @@ trx_sys_file_format_max_check(
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: %s: the system tablespace is in a file " " InnoDB: %s: the system tablespace is in a file "
"format that this version doesn't support - %s\n", "format that this version doesn't support - %s\n",
((max_format_id <= DICT_TF_FORMAT_MAX) ((max_format_id <= DICT_TF_FORMAT_MAX)
? "Error" : "Warning"), ? "Error" : "Warning"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment