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)
on Mac OS X 10.3 or later. */
struct utsname 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 {
srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
}
if (!srv_have_fullfsync) {
fputs("InnoDB: On Mac OS X, fsync() may be"
" broken on internal drives,\n"
"InnoDB: making transactions unsafe!\n", stderr);
ut_print_timestamp(stderr);
fputs(" InnoDB: On Mac OS X, fsync() may be "
"broken on internal drives,\n", stderr);
ut_print_timestamp(stderr);
fputs(" InnoDB: making transactions unsafe!\n", stderr);
}
# endif /* F_FULLFSYNC */
#endif /* HAVE_DARWIN_THREADS */
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,
"InnoDB: Error: size of InnoDB's ulint is %lu,"
" but size of void* is %lu.\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*));
" InnoDB: platforms you can allocate more than 4 GB "
"of memory.\n");
}
/* System tables are created in tablespace 0. Thus, we must
......@@ -1054,53 +1063,68 @@ innobase_start_or_create_for_mysql(void)
innodb_file_per_table) until this function has returned. */
srv_file_per_table = FALSE;
#ifdef UNIV_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
" InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_IBUF_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
" InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n");
# ifdef UNIV_IBUF_COUNT_DEBUG
"InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n"
"InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n"
ut_print_timestamp(stderr);
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
#ifdef UNIV_SYNC_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
" InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_SEARCH_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
" InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_LOG_LSN_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
" InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
#endif /* UNIV_LOG_LSN_DEBUG */
#ifdef UNIV_MEM_DEBUG
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
" InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
#endif
if (UNIV_LIKELY(srv_use_sys_malloc)) {
ut_print_timestamp(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
"\nInnoDB: Compressed tables use zlib " ZLIB_VERSION
ut_print_timestamp(stderr);
fputs(" InnoDB: " IB_ATOMICS_STARTUP_MSG "\n", stderr);
ut_print_timestamp(stderr);
fputs(" InnoDB: Compressed tables use zlib " ZLIB_VERSION
#ifdef UNIV_ZIP_DEBUG
" with validation"
#endif /* UNIV_ZIP_DEBUG */
"\n" , stderr);
#ifdef UNIV_ZIP_COPY
" and extra copying"
ut_print_timestamp(stderr);
fputs(" InnoDB: and extra copying\n", stderr);
#endif /* UNIV_ZIP_COPY */
"\n" , stderr);
/* Since InnoDB does not currently clean up all its internal data
structures in MySQL Embedded Server Library server_end(), we
......@@ -1108,13 +1132,17 @@ innobase_start_or_create_for_mysql(void)
second time during the process lifetime. */
if (srv_start_has_been_called) {
fprintf(stderr,
"InnoDB: Error: startup called second time"
" during the process lifetime.\n"
"InnoDB: In the MySQL Embedded Server Library"
" you cannot call server_init()\n"
"InnoDB: more than once during"
" the process lifetime.\n");
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Error: startup called second time "
"during the process\n");
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: lifetime. In the MySQL Embedded "
"Server Library you\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;
......@@ -1203,8 +1231,9 @@ innobase_start_or_create_for_mysql(void)
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
#endif
} else {
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Unrecognized value %s for"
" InnoDB: Unrecognized value %s for"
" innodb_flush_method\n",
srv_file_flush_method_str);
return(DB_ERROR);
......@@ -1285,7 +1314,8 @@ innobase_start_or_create_for_mysql(void)
we'll emit a message telling the user that this parameter
is now deprecated. */
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."
" Please use innodb_read_io_threads and"
" innodb_write_io_threads instead\n");
......@@ -1335,8 +1365,9 @@ innobase_start_or_create_for_mysql(void)
" InnoDB: Completed initialization of buffer pool\n");
if (err != DB_SUCCESS) {
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Fatal error: cannot allocate the memory"
" InnoDB: Fatal error: cannot allocate memory"
" for the buffer pool\n");
return(DB_ERROR);
......@@ -1348,7 +1379,8 @@ innobase_start_or_create_for_mysql(void)
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 "
"can cause a deadlock if the buffer pool fills up.\n",
srv_buf_pool_size / 1024 / 1024);
......@@ -1370,18 +1402,19 @@ innobase_start_or_create_for_mysql(void)
#ifdef UNIV_LOG_ARCHIVE
if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) {
fprintf(stderr,
"InnoDB: Error: you must set the log group"
" home dir in my.cnf the\n"
"InnoDB: same as log arch dir.\n");
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Error: you must set the log group home dir in my.cnf\n");
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: the same as log arch dir.\n");
return(DB_ERROR);
}
#endif /* UNIV_LOG_ARCHIVE */
if (srv_n_log_files * srv_log_file_size >= 262144) {
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Error: combined size of log files"
" InnoDB: Error: combined size of log files"
" must be < 4 GB\n");
return(DB_ERROR);
......@@ -1392,10 +1425,13 @@ innobase_start_or_create_for_mysql(void)
for (i = 0; i < srv_n_data_files; i++) {
#ifndef __WIN__
if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Error: file size must be < 4 GB"
" with this MySQL binary\n"
"InnoDB: and operating system combination,"
" InnoDB: Error: file size must be < 4 GB"
" with this MySQL binary\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: and operating system combination,"
" in some OS's < 2 GB\n");
return(DB_ERROR);
......@@ -1405,8 +1441,9 @@ innobase_start_or_create_for_mysql(void)
}
if (sum_of_new_sizes < 10485760 / UNIV_PAGE_SIZE) {
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Error: tablespace size must be"
" InnoDB: Error: tablespace size must be"
" at least 10 MB\n");
return(DB_ERROR);
......@@ -1419,19 +1456,32 @@ innobase_start_or_create_for_mysql(void)
&min_flushed_lsn, &max_flushed_lsn,
&sum_of_new_sizes);
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,
"InnoDB: Could not open or create data files.\n"
"InnoDB: If you tried to add new data files,"
" and it failed here,\n"
"InnoDB: you should now edit innodb_data_file_path"
" in my.cnf back\n"
"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"
" InnoDB: zeros, but did not yet use them in any way."
" But be careful: do not\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: remove old data files"
" which contain your precious data!\n");
return((int) err);
......@@ -1457,18 +1507,29 @@ innobase_start_or_create_for_mysql(void)
}
if ((log_opened && create_new_db)
|| (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,
"InnoDB: Error: all log files must be"
" 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");
" InnoDB: and start the database again.\n");
return(DB_ERROR);
}
......@@ -1489,27 +1550,41 @@ innobase_start_or_create_for_mysql(void)
|| max_arch_log_no != min_arch_log_no
#endif /* UNIV_LOG_ARCHIVE */
) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Cannot initialize created"
" log files because\n");
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Cannot initialize created"
" log files because\n"
"InnoDB: data files were not in sync"
" with each other\n"
"InnoDB: or the data files are corrupt.\n");
" InnoDB: data files were not in sync"
" with each other\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: or the data files are corrupt.\n");
return(DB_ERROR);
}
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,
"InnoDB: Cannot initialize created"
" log files because\n"
"InnoDB: data files are corrupt,"
" or new data files were\n"
"InnoDB: created when the database"
" was started previous\n"
"InnoDB: time but the database"
" was not shut down\n"
"InnoDB: normally after that.\n");
" InnoDB: created when the database"
" was started previous\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: time but the database"
" was not shut down\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: normally after that.\n");
return(DB_ERROR);
}
......@@ -1548,8 +1623,9 @@ innobase_start_or_create_for_mysql(void)
#ifdef UNIV_LOG_ARCHIVE
} else if (srv_archive_recovery) {
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Starting archive"
" InnoDB: Starting archive"
" recovery from a backup...\n");
err = recv_recovery_from_archive_start(
min_flushed_lsn, srv_archive_recovery_limit_lsn,
......@@ -1771,11 +1847,14 @@ innobase_start_or_create_for_mysql(void)
if (!srv_auto_extend_last_data_file
&& 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,
"InnoDB: Error: tablespace size"
" stored in header is %lu pages, but\n"
"InnoDB: the sum of data file sizes is %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0
......@@ -1783,16 +1862,25 @@ innobase_start_or_create_for_mysql(void)
/* This is a fatal error, the tail of a tablespace is
missing */
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Cannot start InnoDB."
" The tail of the system tablespace is\n"
"InnoDB: missing. Have you edited"
" innodb_data_file_path in my.cnf in an\n"
"InnoDB: inappropriate way, removing"
" ibdata files from there?\n"
"InnoDB: You can set innodb_force_recovery=1"
" in my.cnf to force\n"
"InnoDB: a startup if you are trying"
" InnoDB: Cannot start InnoDB."
" The tail of the system tablespace is\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: missing. Have you edited"
" innodb_data_file_path in my.cnf in an\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" 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");
return(DB_ERROR);
......@@ -1802,26 +1890,38 @@ innobase_start_or_create_for_mysql(void)
if (srv_auto_extend_last_data_file
&& 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,
"InnoDB: Error: tablespace size stored in header"
" is %lu pages, but\n"
"InnoDB: the sum of data file sizes"
" InnoDB: the sum of data file sizes"
" is only %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
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,
"InnoDB: Cannot start InnoDB. The tail of"
" the system tablespace is\n"
"InnoDB: missing. Have you edited"
" innodb_data_file_path in my.cnf in an\n"
"InnoDB: inappropriate way, removing"
" ibdata files from there?\n"
"InnoDB: You can set innodb_force_recovery=1"
" in my.cnf to force\n"
"InnoDB: a startup if you are trying to"
" InnoDB: missing. Have you edited"
" innodb_data_file_path in my.cnf in an\n");
ut_print_timestamp(stderr);
fprintf(stderr,
" 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");
return(DB_ERROR);
......@@ -1832,10 +1932,13 @@ innobase_start_or_create_for_mysql(void)
os_fast_mutex_init(&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,
"InnoDB: Error: pthread_mutex_trylock returns"
" an unexpected value on\n"
"InnoDB: success! Cannot continue.\n");
" InnoDB: success! Cannot continue.\n");
exit(1);
}
......@@ -1856,8 +1959,9 @@ innobase_start_or_create_for_mysql(void)
}
if (srv_force_recovery > 0) {
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: !!! innodb_force_recovery"
" InnoDB: !!! innodb_force_recovery"
" is set to %lu !!!\n",
(ulong) srv_force_recovery);
}
......@@ -1878,12 +1982,17 @@ innobase_start_or_create_for_mysql(void)
4.1.1. It is essential that the insert buffer is emptied
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,
"InnoDB: You are upgrading to an"
" InnoDB version which allows multiple\n"
"InnoDB: tablespaces. Wait that purge"
" and insert buffer merge run to\n"
"InnoDB: completion...\n");
" InnoDB: completion...\n");
for (;;) {
os_thread_sleep(1000000);
......@@ -1895,21 +2004,29 @@ innobase_start_or_create_for_mysql(void)
break;
}
}
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: Full purge and insert buffer merge"
" InnoDB: Full purge and insert buffer merge"
" completed.\n");
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,
"InnoDB: You have now successfully upgraded"
" to the multiple tablespaces\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");
" InnoDB: " REFMAN "multiple-tablespaces.html\n"
" InnoDB: for instructions.\n");
}
if (srv_force_recovery == 0) {
......
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