123
126
/** Files comprising the system tablespace */
124
127
static os_file_t files[1000];
126
/** Mutex protecting the ios count */
127
static mutex_t ios_mutex;
128
/** Count of I/O operations in io_handler_thread() */
131
129
/** io_handler_thread parameters for thread identification */
132
130
static ulint n[SRV_MAX_N_IO_THREADS + 6];
133
131
/** io_handler_thread identifiers */
154
152
UNIV_INTERN mysql_pfs_key_t srv_master_thread_key;
155
153
#endif /* UNIV_PFS_THREAD */
157
#ifdef UNIV_PFS_MUTEX
158
/* Key to register ios_mutex_key with performance schema */
159
UNIV_INTERN mysql_pfs_key_t ios_mutex_key;
160
#endif /* UNIV_PFS_MUTEX */
162
155
/*********************************************************************//**
163
156
Convert a numeric string that optionally ends in G or M, to a number
164
157
containing megabytes.
292
srv_data_file_names = malloc(i * sizeof *srv_data_file_names);
293
srv_data_file_sizes = malloc(i * sizeof *srv_data_file_sizes);
294
srv_data_file_is_raw_partition = malloc(
295
i * sizeof *srv_data_file_is_raw_partition);
285
srv_data_file_names = static_cast<char **>(malloc(i * sizeof *srv_data_file_names));
286
srv_data_file_sizes = static_cast<ulint *>(malloc(i * sizeof *srv_data_file_sizes));
287
srv_data_file_is_raw_partition = static_cast<ulint *>(malloc(
288
i * sizeof *srv_data_file_is_raw_partition));
297
290
srv_n_data_files = i;
613
604
&& os_file_get_last_error(FALSE) != 100
617
"InnoDB: Error in creating"
618
" or opening %s\n", name);
607
drizzled::errmsg_printf(drizzled::error::ERROR,
608
"InnoDB: Error in creating or opening %s", name);
623
613
files[i] = os_file_create(innodb_file_log_key, name,
624
614
OS_FILE_OPEN, OS_FILE_AIO,
625
615
OS_LOG_FILE, &ret);
628
"InnoDB: Error in opening %s\n", name);
617
drizzled::errmsg_printf(drizzled::error::ERROR,
618
"InnoDB: Error in opening %s.", name);
630
620
return(DB_ERROR);
636
626
if (size != srv_calc_low32(srv_log_file_size)
637
627
|| size_high != srv_calc_high32(srv_log_file_size)) {
640
"InnoDB: Error: log file %s is"
641
" of different size %lu %lu bytes\n"
642
"InnoDB: than specified in the .cnf"
643
" file %lu %lu bytes!\n",
644
name, (ulong) size_high, (ulong) size,
645
(ulong) srv_calc_high32(srv_log_file_size),
646
(ulong) srv_calc_low32(srv_log_file_size));
629
drizzled::errmsg_printf(drizzled::error::ERROR,
630
"InnoDB: Error: log file %s is of different size %lu %lu bytes than specified in the .cnf"
631
" file %lu %lu bytes!",
632
name, (ulong) size_high, (ulong) size,
633
(ulong) srv_calc_high32(srv_log_file_size),
634
(ulong) srv_calc_low32(srv_log_file_size));
648
636
return(DB_ERROR);
651
639
*log_file_created = TRUE;
653
ut_print_timestamp(stderr);
656
" InnoDB: Log file %s did not exist:"
657
" new to be created\n",
641
drizzled::errmsg_printf(drizzled::error::INFO,
642
"InnoDB: Log file %s did not exist: new to be created",
659
644
if (log_file_has_been_opened) {
661
646
return(DB_ERROR);
664
fprintf(stderr, "InnoDB: Setting log file %s size to %lu MB\n",
665
name, (ulong) srv_log_file_size
666
>> (20 - UNIV_PAGE_SIZE_SHIFT));
649
drizzled::errmsg_printf(drizzled::error::INFO,
650
"InnoDB: Setting log file %s size to %lu MB",
651
name, (ulong) srv_log_file_size
652
>> (20 - UNIV_PAGE_SIZE_SHIFT));
669
"InnoDB: Database physically writes the file"
654
drizzled::errmsg_printf(drizzled::error::INFO,
655
"InnoDB: Database physically writes the file full: wait...\n");
672
657
ret = os_file_set_size(name, files[i],
673
658
srv_calc_low32(srv_log_file_size),
674
659
srv_calc_high32(srv_log_file_size));
677
"InnoDB: Error in creating %s:"
678
" probably out of disk space\n",
661
drizzled::errmsg_printf(drizzled::error::ERROR,
662
"InnoDB: Error in creating %s: probably out of disk space",
681
665
return(DB_ERROR);
753
737
char name[10000];
755
739
if (srv_n_data_files >= 1000) {
756
fprintf(stderr, "InnoDB: can only have < 1000 data files\n"
757
"InnoDB: you have defined %lu\n",
758
(ulong) srv_n_data_files);
740
drizzled::errmsg_printf(drizzled::error::ERROR,
741
"InnoDB: can only have < 1000 data files you have defined %lu",
742
(ulong) srv_n_data_files);
759
743
return(DB_ERROR);
836
819
/* We open the data file */
838
821
if (one_created) {
840
"InnoDB: Error: data files can only"
841
" be added at the end\n");
843
"InnoDB: of a tablespace, but"
844
" data file %s existed beforehand.\n",
822
drizzled::errmsg_printf(drizzled::error::ERROR,
823
"InnoDB: Error: data files can only be added at the end of a tablespace, but"
824
" data file %s existed beforehand.",
846
826
return(DB_ERROR);
892
872
&& srv_last_file_size_max
893
873
< rounded_size_pages)) {
896
"InnoDB: Error: auto-extending"
898
" of a different size\n"
899
"InnoDB: %lu pages (rounded"
900
" down to MB) than specified"
901
" in the .cnf file:\n"
902
"InnoDB: initial %lu pages,"
903
" max %lu (relevant if"
904
" non-zero) pages!\n",
906
(ulong) rounded_size_pages,
907
(ulong) srv_data_file_sizes[i],
909
srv_last_file_size_max);
875
drizzled::errmsg_printf(drizzled::error::ERROR,
876
"InnoDB: Error: auto-extending data file %s is of a different size. "
877
"%lu pages (rounded down to MB) than specified in the .cnf file: "
878
"initial %lu pages, max %lu (relevant if non-zero) pages!",
880
(ulong) rounded_size_pages,
881
(ulong) srv_data_file_sizes[i],
883
srv_last_file_size_max);
911
885
return(DB_ERROR);
917
891
if (rounded_size_pages != srv_data_file_sizes[i]) {
920
"InnoDB: Error: data file %s"
921
" is of a different size\n"
923
" (rounded down to MB)\n"
924
"InnoDB: than specified"
925
" in the .cnf file %lu pages!\n",
893
drizzled::errmsg_printf(drizzled::error::ERROR,
894
"InnoDB: Error: data file %s is of a different size. "
895
"%lu pages (rounded down to MB). "
896
"Than specified in the .cnf file %lu pages!",
927
898
(ulong) rounded_size_pages,
928
899
(ulong) srv_data_file_sizes[i]);
944
915
one_created = TRUE;
947
ut_print_timestamp(stderr);
949
" InnoDB: Data file %s did not"
950
" exist: new to be created\n",
918
drizzled::errmsg_printf(drizzled::error::INFO,
919
" InnoDB: Data file %s did not exist: new to be created",
954
"InnoDB: The first specified"
955
" data file %s did not exist:\n"
956
"InnoDB: a new database"
957
" to be created!\n", name);
922
drizzled::errmsg_printf(drizzled::error::INFO,
923
"InnoDB: The first specified data file %s did not exist. A new database to be created!", name);
958
924
*create_new_db = TRUE;
961
ut_print_timestamp(stderr);
963
" InnoDB: Setting file %s size to %lu MB\n",
965
(ulong) (srv_data_file_sizes[i]
966
>> (20 - UNIV_PAGE_SIZE_SHIFT)));
927
drizzled::errmsg_printf(drizzled::error::INFO,
928
" InnoDB: Setting file %s size to %lu MB",
929
name, (ulong) (srv_data_file_sizes[i]
930
>> (20 - UNIV_PAGE_SIZE_SHIFT)));
969
"InnoDB: Database physically writes the"
970
" file full: wait...\n");
932
drizzled::errmsg_printf(drizzled::error::INFO,
933
"InnoDB: Database physically writes the file full: wait...");
972
935
ret = os_file_set_size(
975
938
srv_calc_high32(srv_data_file_sizes[i]));
979
"InnoDB: Error in creating %s:"
980
" probably out of disk space\n", name);
941
drizzled::errmsg_printf(drizzled::error::ERROR,
942
"InnoDB: Error in creating %s: probably out of disk space", name);
982
944
return(DB_ERROR);
1045
1003
on Mac OS X 10.3 or later. */
1046
1004
struct utsname utsname;
1047
1005
if (uname(&utsname)) {
1048
fputs("InnoDB: cannot determine Mac OS X version!\n", stderr);
1006
fputs(_("InnoDB: cannot determine Mac OS X version!\n"), stderr);
1050
1008
srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
1052
1010
if (!srv_have_fullfsync) {
1053
fputs("InnoDB: On Mac OS X, fsync() may be"
1054
" broken on internal drives,\n"
1055
"InnoDB: making transactions unsafe!\n", stderr);
1011
fputs(_("InnoDB: On Mac OS X, fsync() may be"
1012
" broken on internal drives,\n"
1013
"InnoDB: making transactions unsafe!\n"), stderr);
1057
1015
# endif /* F_FULLFSYNC */
1058
1016
#endif /* HAVE_DARWIN_THREADS */
1060
1018
if (sizeof(ulint) != sizeof(void*)) {
1062
"InnoDB: Error: size of InnoDB's ulint is %lu,"
1063
" but size of void* is %lu.\n"
1064
"InnoDB: The sizes should be the same"
1065
" so that on a 64-bit platform you can\n"
1066
"InnoDB: allocate more than 4 GB of memory.",
1019
drizzled::errmsg_printf(drizzled::error::WARN,
1020
_("InnoDB: Error: size of InnoDB's ulint is %lu, but size of void* is %lu. "
1021
"The sizes should be the same so that on a 64-bit platform you can. Allocate more than 4 GB of memory."),
1067
1022
(ulong)sizeof(ulint), (ulong)sizeof(void*));
1073
1028
innodb_file_per_table) until this function has returned. */
1074
1029
srv_file_per_table = FALSE;
1075
1030
#ifdef UNIV_DEBUG
1077
"InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
1031
drizzled::errmsg_printf(drizzled::error::INFO,
1032
_("InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n"));
1080
1035
#ifdef UNIV_IBUF_DEBUG
1082
"InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
1036
drizzled::errmsg_printf(drizzled::error::INFO,
1037
_("InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
1083
1038
# ifdef UNIV_IBUF_COUNT_DEBUG
1084
"InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n"
1085
"InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n"
1039
"InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n"
1040
"InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n"
1090
1045
#ifdef UNIV_SYNC_DEBUG
1092
"InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
1046
drizzled::errmsg_printf(drizzled::error::INFO,
1047
_("InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n"));
1095
1050
#ifdef UNIV_SEARCH_DEBUG
1097
"InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
1051
drizzled::errmsg_printf(drizzled::error::INFO,
1052
_("InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n"));
1100
1055
#ifdef UNIV_LOG_LSN_DEBUG
1102
"InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
1056
drizzled::errmsg_printf(drizzled::error::INFO,
1057
_("InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n"));
1103
1058
#endif /* UNIV_LOG_LSN_DEBUG */
1104
1059
#ifdef UNIV_MEM_DEBUG
1106
"InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
1060
drizzled::errmsg_printf(drizzled::error::INFO,
1061
_("InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n"));
1109
if (UNIV_LIKELY(srv_use_sys_malloc)) {
1111
"InnoDB: The InnoDB memory heap is disabled\n");
1064
if (UNIV_LIKELY(srv_use_sys_malloc))
1066
drizzled::errmsg_printf(drizzled::error::INFO, _("InnoDB: The InnoDB memory heap is disabled\n"));
1114
fputs("InnoDB: " IB_ATOMICS_STARTUP_MSG
1115
"\nInnoDB: Compressed tables use zlib " ZLIB_VERSION
1069
drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: " IB_ATOMICS_STARTUP_MSG
1070
"\nInnoDB: Compressed tables use zlib " ZLIB_VERSION
1116
1071
#ifdef UNIV_ZIP_DEBUG
1117
1072
" with validation"
1118
1073
#endif /* UNIV_ZIP_DEBUG */
1119
1074
#ifdef UNIV_ZIP_COPY
1120
1075
" and extra copying"
1121
1076
#endif /* UNIV_ZIP_COPY */
1125
1080
/* Since InnoDB does not currently clean up all its internal data
1128
1083
second time during the process lifetime. */
1130
1085
if (srv_start_has_been_called) {
1132
"InnoDB: Error: startup called second time"
1133
" during the process lifetime.\n"
1134
"InnoDB: In the MySQL Embedded Server Library"
1135
" you cannot call server_init()\n"
1136
"InnoDB: more than once during"
1137
" the process lifetime.\n");
1086
drizzled::errmsg_printf(drizzled::error::ERROR,
1087
"InnoDB: Error: startup called second time during the process lifetime.\n");
1140
1090
srv_start_has_been_called = TRUE;
1176
1126
#elif defined(LINUX_NATIVE_AIO)
1178
1128
if (srv_use_native_aio) {
1179
ut_print_timestamp(stderr);
1181
" InnoDB: Using Linux native AIO\n");
1129
drizzled::errmsg_printf(drizzled::error::INFO,
1130
_("InnoDB: Using Linux native AIO"));
1184
1133
/* Currently native AIO is supported only on windows and linux
1223
1172
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
1227
"InnoDB: Unrecognized value %s for"
1228
" innodb_flush_method\n",
1229
srv_file_flush_method_str);
1175
drizzled::errmsg_printf(drizzled::error::ERROR,
1176
"InnoDB: Unrecognized value %s for innodb_flush_method",
1177
srv_file_flush_method_str);
1230
1178
return(DB_ERROR);
1266
1214
&srv_monitor_file_mutex, SYNC_NO_ORDER_CHECK);
1268
1216
if (srv_innodb_status) {
1269
srv_monitor_file_name = mem_alloc(
1217
srv_monitor_file_name = static_cast<char *>(mem_alloc(
1270
1218
strlen(fil_path_to_mysql_datadir)
1271
+ 20 + sizeof "/innodb_status.");
1219
+ 20 + sizeof "/innodb_status."));
1272
1220
sprintf(srv_monitor_file_name, "%s/innodb_status.%lu",
1273
1221
fil_path_to_mysql_datadir, os_proc_get_number());
1274
1222
srv_monitor_file = fopen(srv_monitor_file_name, "w+");
1275
1223
if (!srv_monitor_file) {
1276
fprintf(stderr, "InnoDB: unable to create %s: %s\n",
1277
srv_monitor_file_name, strerror(errno));
1224
drizzled::errmsg_printf(drizzled::error::ERROR,
1225
"InnoDB: unable to create %s: %s\n", srv_monitor_file_name, strerror(errno));
1278
1226
return(DB_ERROR);
1328
1276
srv_max_n_open_files);
1330
1278
/* Print time to initialize the buffer pool */
1331
ut_print_timestamp(stderr);
1333
" InnoDB: Initializing buffer pool, size =");
1335
1280
if (srv_buf_pool_size >= 1024 * 1024 * 1024) {
1338
((double) srv_buf_pool_size) / (1024 * 1024 * 1024));
1281
drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: Initializing buffer pool, size = %.1fG",
1282
((double) srv_buf_pool_size) / (1024 * 1024 * 1024));
1342
((double) srv_buf_pool_size) / (1024 * 1024));
1284
drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: Initializing buffer pool, size = %.1fM",
1285
((double) srv_buf_pool_size) / (1024 * 1024));
1345
1288
err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances);
1347
ut_print_timestamp(stderr);
1349
" InnoDB: Completed initialization of buffer pool\n");
1290
drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: Completed initialization of buffer pool");
1351
1292
if (err != DB_SUCCESS) {
1353
"InnoDB: Fatal error: cannot allocate the memory"
1354
" for the buffer pool\n");
1293
drizzled::errmsg_printf(drizzled::error::ERROR, "InnoDB: Fatal error: cannot allocate the memory for the buffer pool");
1359
1298
#ifdef UNIV_DEBUG
1363
1302
if (srv_buf_pool_size <= 5 * 1024 * 1024) {
1365
fprintf(stderr, "InnoDB: Warning: Small buffer pool size "
1366
"(%luM), the flst_validate() debug function "
1367
"can cause a deadlock if the buffer pool fills up.\n",
1368
srv_buf_pool_size / 1024 / 1024);
1304
drizzled::errmsg_printf(drizzled::error::WARN, "InnoDB: Warning: Small buffer pool size "
1305
"(%luM), the flst_validate() debug function "
1306
"can cause a deadlock if the buffer pool fills up.\n",
1307
srv_buf_pool_size / 1024 / 1024);
1385
1324
#ifdef UNIV_LOG_ARCHIVE
1386
1325
if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) {
1388
"InnoDB: Error: you must set the log group"
1389
" home dir in my.cnf the\n"
1390
"InnoDB: same as log arch dir.\n");
1326
drizzled::errmsg_printf(drizzled::error::ERROR,
1327
"InnoDB: Error: you must set the log group home dir in my.cnf the same as log arch dir.");
1392
1329
return(DB_ERROR);
1394
1331
#endif /* UNIV_LOG_ARCHIVE */
1396
1333
if (srv_n_log_files * srv_log_file_size >= 262144) {
1398
"InnoDB: Error: combined size of log files"
1399
" must be < 4 GB\n");
1334
drizzled::errmsg_printf(drizzled::error::ERROR,
1335
"InnoDB: Error: combined size of log files must be < 4 GB");
1401
1337
return(DB_ERROR);
1406
1342
for (i = 0; i < srv_n_data_files; i++) {
1407
1343
#ifndef __WIN__
1408
1344
if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
1410
"InnoDB: Error: file size must be < 4 GB"
1411
" with this MySQL binary\n"
1412
"InnoDB: and operating system combination,"
1413
" in some OS's < 2 GB\n");
1345
drizzled::errmsg_printf(drizzled::error::ERROR,
1346
"InnoDB: Error: file size must be < 4 GB with this MySQL binary and operating system combination,"
1347
" in some OS's < 2 GB\n");
1415
1349
return(DB_ERROR);
1433
1365
&min_flushed_lsn, &max_flushed_lsn,
1434
1366
&sum_of_new_sizes);
1435
1367
if (err != DB_SUCCESS) {
1437
"InnoDB: Could not open or create data files.\n"
1438
"InnoDB: If you tried to add new data files,"
1439
" and it failed here,\n"
1440
"InnoDB: you should now edit innodb_data_file_path"
1442
"InnoDB: to what it was, and remove the"
1443
" new ibdata files InnoDB created\n"
1444
"InnoDB: in this failed attempt. InnoDB only wrote"
1445
" those files full of\n"
1446
"InnoDB: zeros, but did not yet use them in any way."
1447
" But be careful: do not\n"
1448
"InnoDB: remove old data files"
1449
" which contain your precious data!\n");
1368
drizzled::errmsg_printf(drizzled::error::ERROR,
1369
"InnoDB: Could not open or create data files.\n"
1370
"InnoDB: If you tried to add new data files, and it failed here,\n"
1371
"InnoDB: you should now edit innodb_data_file_path in my.cnf back\n"
1372
"InnoDB: to what it was, and remove the new ibdata files InnoDB created\n"
1373
"InnoDB: in this failed attempt. InnoDB only wrote those files full of\n"
1374
"InnoDB: zeros, but did not yet use them in any way. But be careful: do not\n"
1375
"InnoDB: remove old data files which contain your precious data!\n");
1451
1377
return((int) err);
1472
1398
if ((log_opened && create_new_db)
1473
1399
|| (log_opened && log_created)) {
1475
"InnoDB: Error: all log files must be"
1476
" created at the same time.\n"
1477
"InnoDB: All log files must be"
1478
" created also in database creation.\n"
1479
"InnoDB: If you want bigger or smaller"
1480
" log files, shut down the\n"
1481
"InnoDB: database and make sure there"
1482
" were no errors in shutdown.\n"
1483
"InnoDB: Then delete the existing log files."
1484
" Edit the .cnf file\n"
1400
drizzled::errmsg_printf(drizzled::error::ERROR,
1401
"InnoDB: Error: all log files must be created at the same time.\n"
1402
"InnoDB: All log files must be created also in database creation.\n"
1403
"InnoDB: If you want bigger or smaller log files, shut down the\n"
1404
"InnoDB: database and make sure there were no errors in shutdown.\n"
1405
"InnoDB: Then delete the existing log files. Edit the .cnf file\n"
1485
1406
"InnoDB: and start the database again.\n");
1487
1408
return(DB_ERROR);
1503
1424
|| max_arch_log_no != min_arch_log_no
1504
1425
#endif /* UNIV_LOG_ARCHIVE */
1507
"InnoDB: Cannot initialize created"
1508
" log files because\n"
1509
"InnoDB: data files were not in sync"
1510
" with each other\n"
1427
drizzled::errmsg_printf(drizzled::error::ERROR,
1428
"InnoDB: Cannot initialize created log files because\n"
1429
"InnoDB: data files were not in sync with each other\n"
1511
1430
"InnoDB: or the data files are corrupt.\n");
1513
1432
return(DB_ERROR);
1516
1435
if (max_flushed_lsn < (ib_uint64_t) 1000) {
1518
"InnoDB: Cannot initialize created"
1519
" log files because\n"
1520
"InnoDB: data files are corrupt,"
1521
" or new data files were\n"
1522
"InnoDB: created when the database"
1523
" was started previous\n"
1524
"InnoDB: time but the database"
1525
" was not shut down\n"
1526
"InnoDB: normally after that.\n");
1436
drizzled::errmsg_printf(drizzled::error::ERROR,
1437
"InnoDB: Cannot initialize created log files because\n"
1438
"InnoDB: data files are corrupt, or new data files were\n"
1439
"InnoDB: created when the database was started previous\n"
1440
"InnoDB: time but the database was not shut down\n"
1441
"InnoDB: normally after that.\n");
1528
1443
return(DB_ERROR);
1563
1478
#ifdef UNIV_LOG_ARCHIVE
1564
1479
} else if (srv_archive_recovery) {
1566
"InnoDB: Starting archive"
1567
" recovery from a backup...\n");
1480
drizzled::errmsg_printf(drizzled::error::INFO,
1481
"InnoDB: Starting archive recovery from a backup...");
1568
1482
err = recv_recovery_from_archive_start(
1569
1483
min_flushed_lsn, srv_archive_recovery_limit_lsn,
1570
1484
min_arch_log_no);
1785
1699
if (!srv_auto_extend_last_data_file
1786
1700
&& sum_of_data_file_sizes != tablespace_size_in_header) {
1789
"InnoDB: Error: tablespace size"
1790
" stored in header is %lu pages, but\n"
1791
"InnoDB: the sum of data file sizes is %lu pages\n",
1792
(ulong) tablespace_size_in_header,
1793
(ulong) sum_of_data_file_sizes);
1702
drizzled::errmsg_printf(drizzled::error::ERROR,
1703
"InnoDB: Error: tablespace size stored in header is %lu pages, but the sum of data file sizes is %lu pages.",
1704
(ulong) tablespace_size_in_header,
1705
(ulong) sum_of_data_file_sizes);
1795
1707
if (srv_force_recovery == 0
1796
1708
&& sum_of_data_file_sizes < tablespace_size_in_header) {
1797
1709
/* This is a fatal error, the tail of a tablespace is
1801
"InnoDB: Cannot start InnoDB."
1802
" The tail of the system tablespace is\n"
1803
"InnoDB: missing. Have you edited"
1804
" innodb_data_file_path in my.cnf in an\n"
1805
"InnoDB: inappropriate way, removing"
1806
" ibdata files from there?\n"
1807
"InnoDB: You can set innodb_force_recovery=1"
1808
" in my.cnf to force\n"
1809
"InnoDB: a startup if you are trying"
1810
" to recover a badly corrupt database.\n");
1712
drizzled::errmsg_printf(drizzled::error::ERROR,
1713
"InnoDB: Cannot start InnoDB. The tail of the system tablespace is "
1714
"missing. Have you edited innodb_data_file_path in my.cnf in an "
1715
"inappropriate way, removing ibdata files from there? "
1716
"You can set innodb_force_recovery=1 in my.cnf to force "
1717
"a startup if you are trying to recover a badly corrupt database.");
1812
1719
return(DB_ERROR);
1816
1723
if (srv_auto_extend_last_data_file
1817
1724
&& sum_of_data_file_sizes < tablespace_size_in_header) {
1820
"InnoDB: Error: tablespace size stored in header"
1821
" is %lu pages, but\n"
1822
"InnoDB: the sum of data file sizes"
1823
" is only %lu pages\n",
1824
(ulong) tablespace_size_in_header,
1825
(ulong) sum_of_data_file_sizes);
1726
drizzled::errmsg_printf(drizzled::error::ERROR,
1727
"InnoDB: Error: tablespace size stored in header is %lu pages, but the sum of data file sizes"
1728
" is only %lu pages\n",
1729
(ulong) tablespace_size_in_header,
1730
(ulong) sum_of_data_file_sizes);
1827
1732
if (srv_force_recovery == 0) {
1830
"InnoDB: Cannot start InnoDB. The tail of"
1831
" the system tablespace is\n"
1832
"InnoDB: missing. Have you edited"
1833
" innodb_data_file_path in my.cnf in an\n"
1834
"InnoDB: inappropriate way, removing"
1835
" ibdata files from there?\n"
1836
"InnoDB: You can set innodb_force_recovery=1"
1837
" in my.cnf to force\n"
1838
"InnoDB: a startup if you are trying to"
1839
" recover a badly corrupt database.\n");
1734
drizzled::errmsg_printf(drizzled::error::ERROR,
1735
"InnoDB: Cannot start InnoDB. The tail of the system tablespace is "
1736
"missing. Have you edited innodb_data_file_path in my.cnf in an "
1737
"inappropriate way, removing ibdata files from there? "
1738
"You can set innodb_force_recovery=1 in my.cnf to force "
1739
"a startup if you are trying to recover a badly corrupt database.\n");
1841
1741
return(DB_ERROR);
1846
1746
os_fast_mutex_init(&srv_os_test_mutex);
1848
1748
if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) {
1850
"InnoDB: Error: pthread_mutex_trylock returns"
1851
" an unexpected value on\n"
1852
"InnoDB: success! Cannot continue.\n");
1749
drizzled::errmsg_printf(drizzled::error::ERROR,
1750
"InnoDB: Error: pthread_mutex_trylock returns an unexpected value on success! Cannot continue.\n");
1862
1760
os_fast_mutex_free(&srv_os_test_mutex);
1864
1762
if (srv_print_verbose_log) {
1865
ut_print_timestamp(stderr);
1867
" InnoDB %s started; "
1868
"log sequence number %"PRIu64"\n",
1869
INNODB_VERSION_STR, srv_start_lsn);
1763
drizzled::errmsg_printf(drizzled::error::INFO,
1764
"InnoDB %s started; log sequence number %"PRIu64"\n",
1765
INNODB_VERSION_STR, srv_start_lsn);
1872
1768
if (srv_force_recovery > 0) {
1874
"InnoDB: !!! innodb_force_recovery"
1875
" is set to %lu !!!\n",
1876
(ulong) srv_force_recovery);
1769
drizzled::errmsg_printf(drizzled::error::ERROR,
1770
"InnoDB: !!! innodb_force_recovery is set to %lu !!!\n",
1771
(ulong) srv_force_recovery);
1881
1774
if (trx_doublewrite_must_reset_space_ids) {
1882
1775
/* Actually, we did not change the undo log format between
1883
1776
4.0 and 4.1.1, and we would not need to run purge to
1892
1785
4.1.1. It is essential that the insert buffer is emptied
1896
"InnoDB: You are upgrading to an"
1897
" InnoDB version which allows multiple\n"
1898
"InnoDB: tablespaces. Wait that purge"
1899
" and insert buffer merge run to\n"
1900
"InnoDB: completion...\n");
1788
drizzled::errmsg_printf(drizzled::error::INFO,
1789
"InnoDB: You are upgrading to an InnoDB version which allows multiple. "
1790
"tablespaces. Wait that purge and insert buffer merge run to completion...");
1902
1792
os_thread_sleep(1000000);
1913
"InnoDB: Full purge and insert buffer merge"
1802
drizzled::errmsg_printf(drizzled::error::INFO,
1803
"InnoDB: Full purge and insert buffer merge completed.");
1916
1805
trx_sys_mark_upgraded_to_multiple_tablespaces();
1919
"InnoDB: You have now successfully upgraded"
1920
" to the multiple tablespaces\n"
1921
"InnoDB: format. You should NOT DOWNGRADE"
1922
" to an earlier version of\n"
1923
"InnoDB: InnoDB! But if you absolutely need to"
1925
"InnoDB: " REFMAN "multiple-tablespaces.html\n"
1926
"InnoDB: for instructions.\n");
1807
drizzled::errmsg_printf(drizzled::error::INFO,
1808
"InnoDB: You have now successfully upgraded"
1809
" to the multiple tablespaces\n"
1810
"InnoDB: format. You should NOT DOWNGRADE"
1811
" to an earlier version of\n"
1812
"InnoDB: InnoDB! But if you absolutely need to"
1814
"InnoDB: " REFMAN "multiple-tablespaces.html\n"
1815
"InnoDB: for instructions.\n");
1929
1818
if (srv_force_recovery == 0) {
1954
1843
if (!srv_was_started) {
1955
1844
if (srv_is_being_started) {
1956
ut_print_timestamp(stderr);
1958
" InnoDB: Warning: shutting down"
1959
" a not properly started\n"
1960
"InnoDB: or created database!\n");
1845
drizzled::errmsg_printf(drizzled::error::ERROR,
1846
"InnoDB: Warning: shutting down a not properly started or created database!");
1963
1849
return(DB_SUCCESS);
1972
1858
if (srv_fast_shutdown == 2) {
1973
ut_print_timestamp(stderr);
1975
" InnoDB: MySQL has requested a very fast shutdown"
1976
" without flushing "
1977
"the InnoDB buffer pool to data files."
1978
" At the next mysqld startup "
1979
"InnoDB will do a crash recovery!\n");
1859
drizzled::errmsg_printf(drizzled::error::INFO,
1860
"InnoDB: MySQL has requested a very fast shutdown without flushing "
1861
"the InnoDB buffer pool to data files. At the next mysqld startup "
1862
"InnoDB will do a crash recovery!");
1982
1865
logs_empty_and_mark_files_at_shutdown();
1984
1867
if (srv_conc_n_threads != 0) {
1986
"InnoDB: Warning: query counter shows %ld queries"
1988
"InnoDB: inside InnoDB at shutdown\n",
1989
srv_conc_n_threads);
1868
drizzled::errmsg_printf(drizzled::error::WARN,
1869
"InnoDB: Warning: query counter shows %ld queries still InnoDB: inside InnoDB at shutdown.",
1870
srv_conc_n_threads);
1992
1873
/* 2. Make all threads created by InnoDB to exit */
2051
1932
if (i == 1000) {
2053
"InnoDB: Warning: %lu threads created by InnoDB"
2054
" had not exited at shutdown!\n",
1933
drizzled::errmsg_printf(drizzled::error::WARN,
1934
"InnoDB: Warning: %lu threads created by InnoDB had not exited at shutdown!",
2055
1935
(ulong) os_thread_count);
2117
1997
|| os_event_count != 0
2118
1998
|| os_mutex_count != 0
2119
1999
|| os_fast_mutex_count != 0) {
2121
"InnoDB: Warning: some resources were not"
2122
" cleaned up in shutdown:\n"
2123
"InnoDB: threads %lu, events %lu,"
2124
" os_mutexes %lu, os_fast_mutexes %lu\n",
2125
(ulong) os_thread_count, (ulong) os_event_count,
2126
(ulong) os_mutex_count, (ulong) os_fast_mutex_count);
2000
drizzled::errmsg_printf(drizzled::error::WARN,
2001
"InnoDB: Warning: some resources were not cleaned up in shutdown:\n"
2002
"InnoDB: threads %lu, events %lu, os_mutexes %lu, os_fast_mutexes %lu\n",
2003
(ulong) os_thread_count, (ulong) os_event_count,
2004
(ulong) os_mutex_count, (ulong) os_fast_mutex_count);
2129
2007
if (dict_foreign_err_file) {
2136
2014
if (srv_print_verbose_log) {
2137
ut_print_timestamp(stderr);
2139
" InnoDB: Shutdown completed;"
2140
" log sequence number %"PRIu64"\n",
2015
drizzled::errmsg_printf(drizzled::error::INFO,
2016
"InnoDB: Shutdown completed log sequence number %"PRIu64,
2144
2020
srv_was_started = FALSE;