1
/*****************************************************************************
3
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
4
Copyright (C) 2008, Google Inc.
5
Copyright (C) 2009, Percona Inc.
7
Portions of this file contain modifications contributed and copyrighted by
8
Google, Inc. Those modifications are gratefully acknowledged and are described
9
briefly in the InnoDB documentation. The contributions by Google are
10
incorporated with their permission, and subject to the conditions contained in
11
the file COPYING.Google.
13
Portions of this file contain modifications contributed and copyrighted
14
by Percona Inc.. Those modifications are
15
gratefully acknowledged and are described briefly in the InnoDB
16
documentation. The contributions by Percona Inc. are incorporated with
17
their permission, and subject to the conditions contained in the file
20
This program is free software; you can redistribute it and/or modify it under
21
the terms of the GNU General Public License as published by the Free Software
22
Foundation; version 2 of the License.
24
This program is distributed in the hope that it will be useful, but WITHOUT
25
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
28
You should have received a copy of the GNU General Public License along with
29
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
30
St, Fifth Floor, Boston, MA 02110-1301 USA
32
*****************************************************************************/
34
/********************************************************************//**
1
/************************************************************************
36
2
Starts the InnoDB database server
4
(c) 1996-2000 Innobase Oy
38
6
Created 2/16/1996 Heikki Tuuri
39
7
*************************************************************************/
10
#include "sync0sync.h"
41
11
#include "ut0mem.h"
42
12
#include "mem0mem.h"
43
14
#include "data0data.h"
44
15
#include "data0type.h"
45
16
#include "dict0dict.h"
46
17
#include "buf0buf.h"
47
20
#include "os0file.h"
48
21
#include "os0thread.h"
49
22
#include "fil0fil.h"
50
23
#include "fsp0fsp.h"
51
24
#include "rem0rec.h"
52
26
#include "mtr0mtr.h"
53
27
#include "log0log.h"
54
28
#include "log0recv.h"
55
29
#include "page0page.h"
56
30
#include "page0cur.h"
57
31
#include "trx0trx.h"
32
#include "dict0boot.h"
33
#include "dict0load.h"
58
34
#include "trx0sys.h"
35
#include "dict0crea.h"
59
36
#include "btr0btr.h"
60
38
#include "btr0cur.h"
61
40
#include "rem0rec.h"
44
#include "lock0lock.h"
46
#include "trx0purge.h"
51
#include "row0mysql.h"
52
#include "lock0lock.h"
62
53
#include "ibuf0ibuf.h"
54
#include "pars0pars.h"
63
56
#include "srv0start.h"
65
#ifndef UNIV_HOTBACKUP
67
# include "sync0sync.h"
70
# include "dict0boot.h"
71
# include "dict0load.h"
73
# include "usr0sess.h"
74
# include "lock0lock.h"
75
# include "trx0roll.h"
76
# include "trx0purge.h"
77
# include "lock0lock.h"
78
# include "pars0pars.h"
81
# include "dict0crea.h"
86
# include "row0mysql.h"
87
# include "btr0pcur.h"
89
# include "os0sync.h" /* for INNODB_RW_LOCKS_USE_ATOMICS */
90
# include "zlib.h" /* for ZLIB_VERSION */
95
#include <drizzled/gettext.h>
96
#include <drizzled/errmsg_print.h>
98
/** Log sequence number immediately after startup */
59
/* Log sequence number immediately after startup */
99
60
UNIV_INTERN ib_uint64_t srv_start_lsn;
100
/** Log sequence number at shutdown */
61
/* Log sequence number at shutdown */
101
62
UNIV_INTERN ib_uint64_t srv_shutdown_lsn;
103
64
#ifdef HAVE_DARWIN_THREADS
104
65
# include <sys/utsname.h>
105
/** TRUE if the F_FULLFSYNC option is available */
106
66
UNIV_INTERN ibool srv_have_fullfsync = FALSE;
109
/** TRUE if a raw partition is in use */
110
69
UNIV_INTERN ibool srv_start_raw_disk_in_use = FALSE;
112
/** TRUE if the server is being started, before rolling back any
113
incomplete transactions */
114
71
UNIV_INTERN ibool srv_startup_is_before_trx_rollback_phase = FALSE;
115
/** TRUE if the server is being started */
116
72
UNIV_INTERN ibool srv_is_being_started = FALSE;
117
/** TRUE if the server was successfully started */
118
73
UNIV_INTERN ibool srv_was_started = FALSE;
119
/** TRUE if innobase_start_or_create_for_mysql() has been called */
74
#ifndef UNIV_HOTBACKUP
120
75
static ibool srv_start_has_been_called = FALSE;
122
/** At a shutdown this value climbs from SRV_SHUTDOWN_NONE to
123
SRV_SHUTDOWN_CLEANUP and then to SRV_SHUTDOWN_LAST_PHASE, and so on */
124
UNIV_INTERN enum srv_shutdown_state srv_shutdown_state = SRV_SHUTDOWN_NONE;
126
/** Files comprising the system tablespace */
76
#endif /* !UNIV_HOTBACKUP */
78
/* At a shutdown the value first climbs to SRV_SHUTDOWN_CLEANUP
79
and then to SRV_SHUTDOWN_LAST_PHASE */
80
UNIV_INTERN ulint srv_shutdown_state = 0;
82
#ifndef UNIV_HOTBACKUP
127
83
static os_file_t files[1000];
129
/** io_handler_thread parameters for thread identification */
130
static ulint n[SRV_MAX_N_IO_THREADS + 6];
131
/** io_handler_thread identifiers */
132
static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6];
134
/** We use this mutex to test the return value of pthread_mutex_trylock
85
static mutex_t ios_mutex;
88
static ulint n[SRV_MAX_N_IO_THREADS + 5];
89
static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 5];
91
/* We use this mutex to test the return value of pthread_mutex_trylock
135
92
on successful locking. HP-UX does NOT return 0, though Linux et al do. */
136
93
static os_fast_mutex_t srv_os_test_mutex;
138
/** Name of srv_monitor_file */
95
/* Name of srv_monitor_file */
139
96
static char* srv_monitor_file_name;
140
97
#endif /* !UNIV_HOTBACKUP */
143
99
#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
144
100
#define SRV_MAX_N_PENDING_SYNC_IOS 100
146
#ifdef UNIV_PFS_THREAD
147
/* Keys to register InnoDB threads with performance schema */
148
UNIV_INTERN mysql_pfs_key_t io_handler_thread_key;
149
UNIV_INTERN mysql_pfs_key_t srv_lock_timeout_thread_key;
150
UNIV_INTERN mysql_pfs_key_t srv_error_monitor_thread_key;
151
UNIV_INTERN mysql_pfs_key_t srv_monitor_thread_key;
152
UNIV_INTERN mysql_pfs_key_t srv_master_thread_key;
153
#endif /* UNIV_PFS_THREAD */
155
/*********************************************************************//**
156
Convert a numeric string that optionally ends in G or M, to a number
157
containing megabytes.
158
@return next character in string */
161
105
srv_parse_megabytes(
162
106
/*================*/
163
char* str, /*!< in: string containing a quantity in bytes */
164
ulint* megs) /*!< out: the number in megabytes */
107
/* out: next character in string */
108
char* str, /* in: string containing a quantity in bytes */
109
ulint* megs) /* out: the number in megabytes */
189
/*********************************************************************//**
134
/*************************************************************************
190
135
Reads the data files and their sizes from a character string given in
192
@return TRUE if ok, FALSE on parse error */
195
139
srv_parse_data_file_paths_and_sizes(
196
140
/*================================*/
197
char* str) /*!< in/out: the data file path string */
141
/* out: TRUE if ok, FALSE if parsing
143
char* str, /* in: the data file path string */
144
char*** data_file_names, /* out, own: array of data file
146
ulint** data_file_sizes, /* out, own: array of data file sizes
148
ulint** data_file_is_raw_partition,/* out, own: array of flags
149
showing which data files are raw
151
ulint* n_data_files, /* out: number of data files */
152
ibool* is_auto_extending, /* out: TRUE if the last data file is
154
ulint* max_auto_extend_size) /* out: max auto extend size for the
155
last file if specified, 0 if not */
204
srv_auto_extend_last_data_file = FALSE;
205
srv_last_file_size_max = 0;
206
srv_data_file_names = NULL;
207
srv_data_file_sizes = NULL;
208
srv_data_file_is_raw_partition = NULL;
162
*is_auto_extending = FALSE;
163
*max_auto_extend_size = 0;
445
/*********************************************************************//**
446
Frees the memory allocated by srv_parse_data_file_paths_and_sizes()
447
and srv_parse_log_group_home_dirs(). */
450
srv_free_paths_and_sizes(void)
451
/*==========================*/
453
free(srv_data_file_names);
454
srv_data_file_names = NULL;
455
free(srv_data_file_sizes);
456
srv_data_file_sizes = NULL;
457
free(srv_data_file_is_raw_partition);
458
srv_data_file_is_raw_partition = NULL;
459
free(srv_log_group_home_dirs);
460
srv_log_group_home_dirs = NULL;
463
399
#ifndef UNIV_HOTBACKUP
464
/********************************************************************//**
465
I/o-handler thread function.
466
@return OS_THREAD_DUMMY_RETURN */
469
io_handler_thread(void* arg);
400
/************************************************************************
401
I/o-handler thread function. */
473
405
io_handler_thread(
474
406
/*==============*/
475
void* arg) /*!< in: pointer to the number of the segment in
480
412
segment = *((ulint*)arg);
461
/*************************************************************************
462
Adds a slash or a backslash to the end of a string if it is missing
463
and the string is not empty. */
466
srv_add_path_separator_if_needed(
467
/*=============================*/
468
/* out: string which has the separator if the
469
string is not empty */
470
char* str) /* in: null-terminated character string */
473
ulint len = ut_strlen(str);
475
if (len == 0 || str[len - 1] == SRV_PATH_SEPARATOR) {
480
out_str = ut_malloc(len + 2);
481
memcpy(out_str, str, len);
482
out_str[len] = SRV_PATH_SEPARATOR;
483
out_str[len + 1] = 0;
528
488
#ifndef UNIV_HOTBACKUP
529
/*********************************************************************//**
489
/*************************************************************************
530
490
Calculates the low 32 bits when a file size which is given as a number
531
database pages is converted to the number of bytes.
532
@return low 32 bytes of file size when expressed in bytes */
491
database pages is converted to the number of bytes. */
537
ulint file_size) /*!< in: file size in database pages */
496
/* out: low 32 bytes of file size when
497
expressed in bytes */
498
ulint file_size) /* in: file size in database pages */
539
500
return(0xFFFFFFFFUL & (file_size << UNIV_PAGE_SIZE_SHIFT));
542
/*********************************************************************//**
503
/*************************************************************************
543
504
Calculates the high 32 bits when a file size which is given as a number
544
database pages is converted to the number of bytes.
545
@return high 32 bytes of file size when expressed in bytes */
505
database pages is converted to the number of bytes. */
550
ulint file_size) /*!< in: file size in database pages */
510
/* out: high 32 bytes of file size when
511
expressed in bytes */
512
ulint file_size) /* in: file size in database pages */
552
514
return(file_size >> (32 - UNIV_PAGE_SIZE_SHIFT));
555
/*********************************************************************//**
556
Creates or opens the log files and closes them.
557
@return DB_SUCCESS or error code */
517
/*************************************************************************
518
Creates or opens the log files and closes them. */
560
521
open_or_create_log_file(
561
522
/*====================*/
562
ibool create_new_db, /*!< in: TRUE if we should create a
523
/* out: DB_SUCCESS or error code */
524
ibool create_new_db, /* in: TRUE if we should create a
564
ibool* log_file_created, /*!< out: TRUE if new log file
526
ibool* log_file_created, /* out: TRUE if new log file
566
ibool log_file_has_been_opened,/*!< in: TRUE if a log file has been
528
ibool log_file_has_been_opened,/* in: TRUE if a log file has been
567
529
opened before: then it is an error
568
530
to try to create another log file */
569
ulint k, /*!< in: log group number */
570
ulint i) /*!< in: log file number in group */
531
ulint k, /* in: log group number */
532
ulint i) /* in: log file number in group */
575
537
char name[10000];
578
539
UT_NOT_USED(create_new_db);
580
541
*log_file_created = FALSE;
582
543
srv_normalize_path_for_win(srv_log_group_home_dirs[k]);
584
dirnamelen = strlen(srv_log_group_home_dirs[k]);
585
ut_a(dirnamelen < (sizeof name) - 10 - sizeof "ib_logfile");
586
memcpy(name, srv_log_group_home_dirs[k], dirnamelen);
588
/* Add a path separator if needed. */
589
if (dirnamelen && name[dirnamelen - 1] != SRV_PATH_SEPARATOR) {
590
name[dirnamelen++] = SRV_PATH_SEPARATOR;
593
sprintf(name + dirnamelen, "%s%lu", "ib_logfile", (ulong) i);
595
files[i] = os_file_create(innodb_file_log_key, name,
596
OS_FILE_CREATE, OS_FILE_NORMAL,
544
srv_log_group_home_dirs[k] = srv_add_path_separator_if_needed(
545
srv_log_group_home_dirs[k]);
547
ut_a(strlen(srv_log_group_home_dirs[k])
548
< (sizeof name) - 10 - sizeof "ib_logfile");
549
sprintf(name, "%s%s%lu", srv_log_group_home_dirs[k],
550
"ib_logfile", (ulong) i);
552
files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_NORMAL,
597
553
OS_LOG_FILE, &ret);
598
554
if (ret == FALSE) {
599
555
if (os_file_get_last_error(FALSE) != OS_FILE_ALREADY_EXISTS
626
582
if (size != srv_calc_low32(srv_log_file_size)
627
583
|| size_high != srv_calc_high32(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));
586
"InnoDB: Error: log file %s is"
587
" of different size %lu %lu bytes\n"
588
"InnoDB: than specified in the .cnf"
589
" file %lu %lu bytes!\n",
590
name, (ulong) size_high, (ulong) size,
591
(ulong) srv_calc_high32(srv_log_file_size),
592
(ulong) srv_calc_low32(srv_log_file_size));
636
594
return(DB_ERROR);
639
597
*log_file_created = TRUE;
641
drizzled::errmsg_printf(drizzled::error::INFO,
642
"InnoDB: Log file %s did not exist: new to be created",
599
ut_print_timestamp(stderr);
602
" InnoDB: Log file %s did not exist:"
603
" new to be created\n",
644
605
if (log_file_has_been_opened) {
646
607
return(DB_ERROR);
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));
610
fprintf(stderr, "InnoDB: Setting log file %s size to %lu MB\n",
611
name, (ulong) srv_log_file_size
612
>> (20 - UNIV_PAGE_SIZE_SHIFT));
654
drizzled::errmsg_printf(drizzled::error::INFO,
655
"InnoDB: Database physically writes the file full: wait...\n");
615
"InnoDB: Database physically writes the file"
657
618
ret = os_file_set_size(name, files[i],
658
619
srv_calc_low32(srv_log_file_size),
659
620
srv_calc_high32(srv_log_file_size));
661
drizzled::errmsg_printf(drizzled::error::ERROR,
662
"InnoDB: Error in creating %s: probably out of disk space",
623
"InnoDB: Error in creating %s:"
624
" probably out of disk space\n",
665
627
return(DB_ERROR);
705
667
return(DB_SUCCESS);
708
/*********************************************************************//**
709
Creates or opens database data files and closes them.
710
@return DB_SUCCESS or error code */
670
/*************************************************************************
671
Creates or opens database data files and closes them. */
713
674
open_or_create_data_files(
714
675
/*======================*/
715
ibool* create_new_db, /*!< out: TRUE if new database should be
676
/* out: DB_SUCCESS or error code */
677
ibool* create_new_db, /* out: TRUE if new database should be
717
679
#ifdef UNIV_LOG_ARCHIVE
718
ulint* min_arch_log_no,/*!< out: min of archived log
680
ulint* min_arch_log_no,/* out: min of archived log
719
681
numbers in data files */
720
ulint* max_arch_log_no,/*!< out: max of archived log
682
ulint* max_arch_log_no,/* out: max of archived log
721
683
numbers in data files */
722
684
#endif /* UNIV_LOG_ARCHIVE */
723
ib_uint64_t* min_flushed_lsn,/*!< out: min of flushed lsn
724
values in data files */
725
ib_uint64_t* max_flushed_lsn,/*!< out: max of flushed lsn
726
values in data files */
727
ulint* sum_of_new_sizes)/*!< out: sum of sizes of the
685
ib_uint64_t* min_flushed_lsn,/* out: min of flushed lsn
686
values in data files */
687
ib_uint64_t* max_flushed_lsn,/* out: max of flushed lsn
688
values in data files */
689
ulint* sum_of_new_sizes)/* out: sum of sizes of the
728
690
new files added */
748
710
*create_new_db = FALSE;
750
712
srv_normalize_path_for_win(srv_data_home);
713
srv_data_home = srv_add_path_separator_if_needed(srv_data_home);
752
715
for (i = 0; i < srv_n_data_files; i++) {
755
716
srv_normalize_path_for_win(srv_data_file_names[i]);
756
dirnamelen = strlen(srv_data_home);
758
ut_a(dirnamelen + strlen(srv_data_file_names[i])
718
ut_a(strlen(srv_data_home) + strlen(srv_data_file_names[i])
759
719
< (sizeof name) - 1);
760
memcpy(name, srv_data_home, dirnamelen);
761
/* Add a path separator if needed. */
762
if (dirnamelen && name[dirnamelen - 1] != SRV_PATH_SEPARATOR) {
763
name[dirnamelen++] = SRV_PATH_SEPARATOR;
766
strcpy(name + dirnamelen, srv_data_file_names[i]);
720
sprintf(name, "%s%s", srv_data_home, srv_data_file_names[i]);
768
722
if (srv_data_file_is_raw_partition[i] == 0) {
770
724
/* First we try to create the file: if it already
771
725
exists, ret will get value FALSE */
773
files[i] = os_file_create(innodb_file_data_key,
774
name, OS_FILE_CREATE,
727
files[i] = os_file_create(name, OS_FILE_CREATE,
776
729
OS_DATA_FILE, &ret);
819
772
/* We open the data file */
821
774
if (one_created) {
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.",
776
"InnoDB: Error: data files can only"
777
" be added at the end\n");
779
"InnoDB: of a tablespace, but"
780
" data file %s existed beforehand.\n",
826
782
return(DB_ERROR);
829
785
if (srv_data_file_is_raw_partition[i] == SRV_OLD_RAW) {
830
786
files[i] = os_file_create(
831
innodb_file_data_key,
832
787
name, OS_FILE_OPEN_RAW,
833
788
OS_FILE_NORMAL, OS_DATA_FILE, &ret);
834
789
} else if (i == 0) {
835
790
files[i] = os_file_create(
836
innodb_file_data_key,
837
791
name, OS_FILE_OPEN_RETRY,
838
792
OS_FILE_NORMAL, OS_DATA_FILE, &ret);
840
794
files[i] = os_file_create(
841
innodb_file_data_key,
842
795
name, OS_FILE_OPEN, OS_FILE_NORMAL,
843
796
OS_DATA_FILE, &ret);
847
drizzled::errmsg_printf(drizzled::error::ERROR,
848
"InnoDB: Error in opening %s", name);
801
"InnoDB: Error in opening %s\n", name);
849
802
os_file_get_last_error(TRUE);
851
804
return(DB_ERROR);
915
877
one_created = TRUE;
918
drizzled::errmsg_printf(drizzled::error::INFO,
919
" InnoDB: Data file %s did not exist: new to be created",
880
ut_print_timestamp(stderr);
882
" InnoDB: Data file %s did not"
883
" exist: new to be created\n",
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);
887
"InnoDB: The first specified"
888
" data file %s did not exist:\n"
889
"InnoDB: a new database"
890
" to be created!\n", name);
924
891
*create_new_db = TRUE;
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)));
894
ut_print_timestamp(stderr);
896
" InnoDB: Setting file %s size to %lu MB\n",
898
(ulong) (srv_data_file_sizes[i]
899
>> (20 - UNIV_PAGE_SIZE_SHIFT)));
932
drizzled::errmsg_printf(drizzled::error::INFO,
933
"InnoDB: Database physically writes the file full: wait...");
902
"InnoDB: Database physically writes the"
903
" file full: wait...\n");
935
905
ret = os_file_set_size(
1003
979
on Mac OS X 10.3 or later. */
1004
980
struct utsname utsname;
1005
981
if (uname(&utsname)) {
1006
fputs(_("InnoDB: cannot determine Mac OS X version!\n"), stderr);
982
fputs("InnoDB: cannot determine Mac OS X version!\n", stderr);
1008
984
srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
1010
986
if (!srv_have_fullfsync) {
1011
fputs(_("InnoDB: On Mac OS X, fsync() may be"
1012
" broken on internal drives,\n"
1013
"InnoDB: making transactions unsafe!\n"), stderr);
987
fputs("InnoDB: On Mac OS X, fsync() may be"
988
" broken on internal drives,\n"
989
"InnoDB: making transactions unsafe!\n", stderr);
1015
991
# endif /* F_FULLFSYNC */
1016
992
#endif /* HAVE_DARWIN_THREADS */
1018
994
if (sizeof(ulint) != sizeof(void*)) {
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."),
996
"InnoDB: Error: size of InnoDB's ulint is %lu,"
997
" but size of void* is %lu.\n"
998
"InnoDB: The sizes should be the same"
999
" so that on a 64-bit platform you can\n"
1000
"InnoDB: allocate more than 4 GB of memory.",
1022
1001
(ulong)sizeof(ulint), (ulong)sizeof(void*));
1028
1007
innodb_file_per_table) until this function has returned. */
1029
1008
srv_file_per_table = FALSE;
1030
1009
#ifdef UNIV_DEBUG
1031
drizzled::errmsg_printf(drizzled::error::INFO,
1032
_("InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n"));
1011
"InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
1035
1014
#ifdef UNIV_IBUF_DEBUG
1036
drizzled::errmsg_printf(drizzled::error::INFO,
1037
_("InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
1038
# ifdef UNIV_IBUF_COUNT_DEBUG
1039
"InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n"
1040
"InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n"
1016
"InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
1017
"InnoDB: Crash recovery will fail with UNIV_IBUF_DEBUG\n");
1045
1020
#ifdef UNIV_SYNC_DEBUG
1046
drizzled::errmsg_printf(drizzled::error::INFO,
1047
_("InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n"));
1022
"InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
1050
1025
#ifdef UNIV_SEARCH_DEBUG
1051
drizzled::errmsg_printf(drizzled::error::INFO,
1052
_("InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n"));
1027
"InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
1055
#ifdef UNIV_LOG_LSN_DEBUG
1056
drizzled::errmsg_printf(drizzled::error::INFO,
1057
_("InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n"));
1058
#endif /* UNIV_LOG_LSN_DEBUG */
1059
1030
#ifdef UNIV_MEM_DEBUG
1060
drizzled::errmsg_printf(drizzled::error::INFO,
1061
_("InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n"));
1032
"InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
1064
if (UNIV_LIKELY(srv_use_sys_malloc))
1066
drizzled::errmsg_printf(drizzled::error::ERROR, _("InnoDB: The InnoDB memory heap is disabled\n"));
1069
fputs("InnoDB: " IB_ATOMICS_STARTUP_MSG
1070
"\nInnoDB: Compressed tables use zlib " ZLIB_VERSION
1071
#ifdef UNIV_ZIP_DEBUG
1073
#endif /* UNIV_ZIP_DEBUG */
1074
#ifdef UNIV_ZIP_COPY
1075
" and extra copying"
1076
#endif /* UNIV_ZIP_COPY */
1080
1035
/* Since InnoDB does not currently clean up all its internal data
1081
1036
structures in MySQL Embedded Server Library server_end(), we
1082
1037
print an error message if someone tries to start up InnoDB a
1083
1038
second time during the process lifetime. */
1085
1040
if (srv_start_has_been_called) {
1086
drizzled::errmsg_printf(drizzled::error::ERROR,
1087
"InnoDB: Error: startup called second time during the process lifetime.\n");
1042
"InnoDB: Error:startup called second time"
1043
" during the process lifetime.\n"
1044
"InnoDB: In the MySQL Embedded Server Library"
1045
" you cannot call server_init()\n"
1046
"InnoDB: more than once during"
1047
" the process lifetime.\n");
1090
1050
srv_start_has_been_called = TRUE;
1097
1057
srv_is_being_started = TRUE;
1098
1058
srv_startup_is_before_trx_rollback_phase = TRUE;
1059
os_aio_use_native_aio = FALSE;
1101
switch (os_get_os_version()) {
1062
if (os_get_os_version() == OS_WIN95
1063
|| os_get_os_version() == OS_WIN31
1064
|| os_get_os_version() == OS_WINNT) {
1105
1066
/* On Win 95, 98, ME, Win32 subsystem for Windows 3.1,
1106
1067
and NT use simulated aio. In NT Windows provides async i/o,
1107
1068
but when run in conjunction with InnoDB Hot Backup, it seemed
1108
1069
to corrupt the data files. */
1110
srv_use_native_aio = FALSE;
1115
/* On 2000 and XP, async IO is available. */
1116
srv_use_native_aio = TRUE;
1120
/* Vista and later have both async IO and condition variables */
1121
srv_use_native_aio = TRUE;
1122
srv_use_native_conditions = TRUE;
1126
#elif defined(LINUX_NATIVE_AIO)
1128
if (srv_use_native_aio) {
1129
drizzled::errmsg_printf(drizzled::error::INFO,
1130
_("InnoDB: Using Linux native AIO"));
1133
/* Currently native AIO is supported only on windows and linux
1134
and that also when the support is compiled in. In all other
1135
cases, we ignore the setting of innodb_use_native_aio. */
1136
srv_use_native_aio = FALSE;
1071
os_aio_use_native_aio = FALSE;
1073
/* On Win 2000 and XP use async i/o */
1074
os_aio_use_native_aio = TRUE;
1140
1077
if (srv_file_flush_method_str == NULL) {
1141
1078
/* These are the default options */
1162
1099
} else if (0 == ut_strcmp(srv_file_flush_method_str, "normal")) {
1163
1100
srv_win_file_flush_method = SRV_WIN_IO_NORMAL;
1164
srv_use_native_aio = FALSE;
1101
os_aio_use_native_aio = FALSE;
1166
1103
} else if (0 == ut_strcmp(srv_file_flush_method_str, "unbuffered")) {
1167
1104
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
1168
srv_use_native_aio = FALSE;
1105
os_aio_use_native_aio = FALSE;
1170
1107
} else if (0 == ut_strcmp(srv_file_flush_method_str,
1171
1108
"async_unbuffered")) {
1172
1109
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
1175
drizzled::errmsg_printf(drizzled::error::ERROR,
1176
"InnoDB: Unrecognized value %s for innodb_flush_method",
1177
srv_file_flush_method_str);
1113
"InnoDB: Unrecognized value %s for"
1114
" innodb_flush_method\n",
1115
srv_file_flush_method_str);
1178
1116
return(DB_ERROR);
1210
1153
return((int) err);
1213
mutex_create(srv_monitor_file_mutex_key,
1214
&srv_monitor_file_mutex, SYNC_NO_ORDER_CHECK);
1156
mutex_create(&srv_monitor_file_mutex, SYNC_NO_ORDER_CHECK);
1216
1158
if (srv_innodb_status) {
1217
srv_monitor_file_name = static_cast<char *>(mem_alloc(
1159
srv_monitor_file_name = mem_alloc(
1218
1160
strlen(fil_path_to_mysql_datadir)
1219
+ 20 + sizeof "/innodb_status."));
1161
+ 20 + sizeof "/innodb_status.");
1220
1162
sprintf(srv_monitor_file_name, "%s/innodb_status.%lu",
1221
1163
fil_path_to_mysql_datadir, os_proc_get_number());
1222
1164
srv_monitor_file = fopen(srv_monitor_file_name, "w+");
1223
1165
if (!srv_monitor_file) {
1224
drizzled::errmsg_printf(drizzled::error::ERROR,
1225
"InnoDB: unable to create %s: %s\n", srv_monitor_file_name, strerror(errno));
1166
fprintf(stderr, "InnoDB: unable to create %s: %s\n",
1167
srv_monitor_file_name, strerror(errno));
1226
1168
return(DB_ERROR);
1236
mutex_create(srv_dict_tmpfile_mutex_key,
1237
&srv_dict_tmpfile_mutex, SYNC_DICT_OPERATION);
1178
mutex_create(&srv_dict_tmpfile_mutex, SYNC_DICT_OPERATION);
1239
1180
srv_dict_tmpfile = os_file_create_tmpfile();
1240
1181
if (!srv_dict_tmpfile) {
1241
1182
return(DB_ERROR);
1244
mutex_create(srv_misc_tmpfile_mutex_key,
1245
&srv_misc_tmpfile_mutex, SYNC_ANY_LATCH);
1185
mutex_create(&srv_misc_tmpfile_mutex, SYNC_ANY_LATCH);
1247
1187
srv_misc_tmpfile = os_file_create_tmpfile();
1248
1188
if (!srv_misc_tmpfile) {
1249
1189
return(DB_ERROR);
1252
/* innodb_file_io_threads used to be user settable.
1253
It is now just a combination of read_io_threads and
1254
write_io_threads that is set by innodb internally. */
1256
/* Now overwrite the value on srv_n_file_io_threads */
1257
srv_n_file_io_threads = 2 + srv_n_read_io_threads
1258
+ srv_n_write_io_threads;
1260
ut_a(srv_n_file_io_threads <= SRV_MAX_N_IO_THREADS);
1262
/* TODO: Investigate if SRV_N_PENDING_IOS_PER_THREAD (32) limit
1263
still applies to windows. */
1264
if (!srv_use_native_aio) {
1265
io_limit = 8 * SRV_N_PENDING_IOS_PER_THREAD;
1267
io_limit = SRV_N_PENDING_IOS_PER_THREAD;
1270
os_aio_init(io_limit,
1271
srv_n_read_io_threads,
1272
srv_n_write_io_threads,
1273
SRV_MAX_N_PENDING_SYNC_IOS);
1275
fil_init(srv_file_per_table ? 50000 : 5000,
1276
srv_max_n_open_files);
1278
/* Print time to initialize the buffer pool */
1280
if (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));
1284
drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: Initializing buffer pool, size = %.1fM",
1285
((double) srv_buf_pool_size) / (1024 * 1024));
1288
err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances);
1290
drizzled::errmsg_printf(drizzled::error::INFO, "InnoDB: Completed initialization of buffer pool");
1292
if (err != DB_SUCCESS) {
1293
drizzled::errmsg_printf(drizzled::error::ERROR, "InnoDB: Fatal error: cannot allocate the memory for the buffer pool");
1192
/* Restrict the maximum number of file i/o threads */
1193
if (srv_n_file_io_threads > SRV_MAX_N_IO_THREADS) {
1195
srv_n_file_io_threads = SRV_MAX_N_IO_THREADS;
1198
if (!os_aio_use_native_aio) {
1199
/* In simulated aio we currently have use only for 4 threads */
1200
srv_n_file_io_threads = 4;
1202
os_aio_init(8 * SRV_N_PENDING_IOS_PER_THREAD
1203
* srv_n_file_io_threads,
1204
srv_n_file_io_threads,
1205
SRV_MAX_N_PENDING_SYNC_IOS);
1207
os_aio_init(SRV_N_PENDING_IOS_PER_THREAD
1208
* srv_n_file_io_threads,
1209
srv_n_file_io_threads,
1210
SRV_MAX_N_PENDING_SYNC_IOS);
1213
fil_init(srv_max_n_open_files);
1215
ret = buf_pool_init();
1219
"InnoDB: Fatal error: cannot allocate the memory"
1220
" for the buffer pool\n");
1298
1225
#ifdef UNIV_DEBUG
1365
1299
&min_flushed_lsn, &max_flushed_lsn,
1366
1300
&sum_of_new_sizes);
1367
1301
if (err != DB_SUCCESS) {
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");
1303
"InnoDB: Could not open or create data files.\n"
1304
"InnoDB: If you tried to add new data files,"
1305
" and it failed here,\n"
1306
"InnoDB: you should now edit innodb_data_file_path"
1308
"InnoDB: to what it was, and remove the"
1309
" new ibdata files InnoDB created\n"
1310
"InnoDB: in this failed attempt. InnoDB only wrote"
1311
" those files full of\n"
1312
"InnoDB: zeros, but did not yet use them in any way."
1313
" But be careful: do not\n"
1314
"InnoDB: remove old data files"
1315
" which contain your precious data!\n");
1377
1317
return((int) err);
1398
1338
if ((log_opened && create_new_db)
1399
1339
|| (log_opened && log_created)) {
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"
1341
"InnoDB: Error: all log files must be"
1342
" created at the same time.\n"
1343
"InnoDB: All log files must be"
1344
" created also in database creation.\n"
1345
"InnoDB: If you want bigger or smaller"
1346
" log files, shut down the\n"
1347
"InnoDB: database and make sure there"
1348
" were no errors in shutdown.\n"
1349
"InnoDB: Then delete the existing log files."
1350
" Edit the .cnf file\n"
1406
1351
"InnoDB: and start the database again.\n");
1408
1353
return(DB_ERROR);
1424
1369
|| max_arch_log_no != min_arch_log_no
1425
1370
#endif /* UNIV_LOG_ARCHIVE */
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"
1373
"InnoDB: Cannot initialize created"
1374
" log files because\n"
1375
"InnoDB: data files were not in sync"
1376
" with each other\n"
1430
1377
"InnoDB: or the data files are corrupt.\n");
1432
1379
return(DB_ERROR);
1435
1382
if (max_flushed_lsn < (ib_uint64_t) 1000) {
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");
1384
"InnoDB: Cannot initialize created"
1385
" log files because\n"
1386
"InnoDB: data files are corrupt,"
1387
" or new data files were\n"
1388
"InnoDB: created when the database"
1389
" was started previous\n"
1390
"InnoDB: time but the database"
1391
" was not shut down\n"
1392
"InnoDB: normally after that.\n");
1443
1394
return(DB_ERROR);
1629
1576
/* fprintf(stderr, "Max allowed record size %lu\n",
1630
1577
page_get_free_space_of_empty() / 2); */
1632
if (trx_doublewrite == NULL) {
1633
/* Create the doublewrite buffer to a new tablespace */
1635
trx_sys_create_doublewrite_buf();
1638
/* Here the double write buffer has already been created and so
1639
any new rollback segments will be allocated after the double
1640
write buffer. The default segment should already exist.
1641
We create the new segments only if it's a new database or
1642
the database was shutdown cleanly. */
1644
/* Note: When creating the extra rollback segments during an upgrade
1645
we violate the latching order, even if the change buffer is empty.
1646
We make an exception in sync0sync.c and check srv_is_being_started
1647
for that violation. It cannot create a deadlock because we are still
1648
running in single threaded mode essentially. Only the IO threads
1649
should be running at this stage. */
1651
trx_sys_create_rsegs(TRX_SYS_N_RSEGS - 1);
1653
/* Create the thread which watches the timeouts for lock waits */
1654
os_thread_create(&srv_lock_timeout_thread, NULL,
1579
/* Create the thread which watches the timeouts for lock waits
1580
and prints InnoDB monitor info */
1582
os_thread_create(&srv_lock_timeout_and_monitor_thread, NULL,
1655
1583
thread_ids + 2 + SRV_MAX_N_IO_THREADS);
1657
1585
/* Create the thread which warns of long semaphore waits */
1658
1586
os_thread_create(&srv_error_monitor_thread, NULL,
1659
1587
thread_ids + 3 + SRV_MAX_N_IO_THREADS);
1661
/* Create the thread which prints InnoDB monitor info */
1662
os_thread_create(&srv_monitor_thread, NULL,
1663
thread_ids + 4 + SRV_MAX_N_IO_THREADS);
1665
1588
srv_is_being_started = FALSE;
1590
if (trx_doublewrite == NULL) {
1591
/* Create the doublewrite buffer to a new tablespace */
1593
trx_sys_create_doublewrite_buf();
1667
1596
err = dict_create_or_check_foreign_constraint_tables();
1669
1598
if (err != DB_SUCCESS) {
1699
1618
if (!srv_auto_extend_last_data_file
1700
1619
&& sum_of_data_file_sizes != tablespace_size_in_header) {
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);
1622
"InnoDB: Error: tablespace size"
1623
" stored in header is %lu pages, but\n"
1624
"InnoDB: the sum of data file sizes is %lu pages\n",
1625
(ulong) tablespace_size_in_header,
1626
(ulong) sum_of_data_file_sizes);
1707
1628
if (srv_force_recovery == 0
1708
1629
&& sum_of_data_file_sizes < tablespace_size_in_header) {
1709
1630
/* This is a fatal error, the tail of a tablespace is
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.");
1634
"InnoDB: Cannot start InnoDB."
1635
" The tail of the system tablespace is\n"
1636
"InnoDB: missing. Have you edited"
1637
" innodb_data_file_path in my.cnf in an\n"
1638
"InnoDB: inappropriate way, removing"
1639
" ibdata files from there?\n"
1640
"InnoDB: You can set innodb_force_recovery=1"
1641
" in my.cnf to force\n"
1642
"InnoDB: a startup if you are trying"
1643
" to recover a badly corrupt database.\n");
1719
1645
return(DB_ERROR);
1723
1649
if (srv_auto_extend_last_data_file
1724
1650
&& sum_of_data_file_sizes < tablespace_size_in_header) {
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);
1653
"InnoDB: Error: tablespace size stored in header"
1654
" is %lu pages, but\n"
1655
"InnoDB: the sum of data file sizes"
1656
" is only %lu pages\n",
1657
(ulong) tablespace_size_in_header,
1658
(ulong) sum_of_data_file_sizes);
1732
1660
if (srv_force_recovery == 0) {
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");
1663
"InnoDB: Cannot start InnoDB. The tail of"
1664
" the system tablespace is\n"
1665
"InnoDB: missing. Have you edited"
1666
" innodb_data_file_path in my.cnf in an\n"
1667
"InnoDB: inappropriate way, removing"
1668
" ibdata files from there?\n"
1669
"InnoDB: You can set innodb_force_recovery=1"
1670
" in my.cnf to force\n"
1671
"InnoDB: a startup if you are trying to"
1672
" recover a badly corrupt database.\n");
1741
1674
return(DB_ERROR);
1760
1695
os_fast_mutex_free(&srv_os_test_mutex);
1762
1697
if (srv_print_verbose_log) {
1763
drizzled::errmsg_printf(drizzled::error::ERROR,
1764
"InnoDB %s started; log sequence number %"PRIu64"\n",
1765
INNODB_VERSION_STR, srv_start_lsn);
1698
ut_print_timestamp(stderr);
1700
" InnoDB Plugin %s started; "
1701
"log sequence number %"PRIu64"\n",
1702
INNODB_VERSION_STR, srv_start_lsn);
1768
1705
if (srv_force_recovery > 0) {
1769
drizzled::errmsg_printf(drizzled::error::ERROR,
1770
"InnoDB: !!! innodb_force_recovery is set to %lu !!!\n",
1771
(ulong) srv_force_recovery);
1707
"InnoDB: !!! innodb_force_recovery"
1708
" is set to %lu !!!\n",
1709
(ulong) srv_force_recovery);
1774
1714
if (trx_doublewrite_must_reset_space_ids) {
1775
1715
/* Actually, we did not change the undo log format between
1776
1716
4.0 and 4.1.1, and we would not need to run purge to
1802
drizzled::errmsg_printf(drizzled::error::INFO,
1803
"InnoDB: Full purge and insert buffer merge completed.");
1746
"InnoDB: Full purge and insert buffer merge"
1805
1749
trx_sys_mark_upgraded_to_multiple_tablespaces();
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");
1752
"InnoDB: You have now successfully upgraded"
1753
" to the multiple tablespaces\n"
1754
"InnoDB: format. You should NOT DOWNGRADE"
1755
" to an earlier version of\n"
1756
"InnoDB: InnoDB! But if you absolutely need to"
1758
"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/"
1759
"multiple-tablespaces.html\n"
1760
"InnoDB: for instructions.\n");
1818
1763
if (srv_force_recovery == 0) {
1858
1809
if (srv_fast_shutdown == 2) {
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!");
1810
ut_print_timestamp(stderr);
1812
" InnoDB: MySQL has requested a very fast shutdown"
1813
" without flushing "
1814
"the InnoDB buffer pool to data files."
1815
" At the next mysqld startup "
1816
"InnoDB will do a crash recovery!\n");
1865
logs_empty_and_mark_files_at_shutdown();
1822
logs_empty_and_mark_files_at_shutdown();
1867
1824
if (srv_conc_n_threads != 0) {
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);
1826
"InnoDB: Warning: query counter shows %ld queries"
1828
"InnoDB: inside InnoDB at shutdown\n",
1829
srv_conc_n_threads);
1873
1832
/* 2. Make all threads created by InnoDB to exit */
1953
1908
srv_misc_tmpfile = 0;
1956
/* This must be disabled before closing the buffer pool
1957
and closing the data dictionary. */
1958
btr_search_disable();
1964
1911
trx_sys_file_format_close();
1967
1913
mutex_free(&srv_monitor_file_mutex);
1968
1914
mutex_free(&srv_dict_tmpfile_mutex);
1969
1915
mutex_free(&srv_misc_tmpfile_mutex);
1971
btr_search_sys_free();
1973
1917
/* 3. Free all InnoDB's own mutexes and the os_fast_mutexes inside
1921
/* 4. Free the os_conc_mutex and all os_events and os_mutexes */
1980
/* 4. Free the os_conc_mutex and all os_events and os_mutexes */
1982
1924
os_sync_free();
1984
/* 5. Free all allocated memory */
1988
buf_pool_free(srv_buf_pool_instances);
1991
/* ut_free_all_mem() frees all allocated memory not freed yet
1992
in shutdown, and it will also free the ut_list_mutex, so it
1993
should be the last one for all operation */
1926
/* Check that all read views are closed except read view owned
1929
if (UT_LIST_GET_LEN(trx_sys->view_list) > 1) {
1931
"InnoDB: Error: all read views were not closed"
1932
" before shutdown:\n"
1933
"InnoDB: %lu read views open \n",
1934
UT_LIST_GET_LEN(trx_sys->view_list) - 1);
1937
/* 5. Free all allocated memory and the os_fast_mutex created in
1994
1941
ut_free_all_mem();
1996
1943
if (os_thread_count != 0
1997
1944
|| os_event_count != 0
1998
1945
|| os_mutex_count != 0
1999
1946
|| os_fast_mutex_count != 0) {
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);
1948
"InnoDB: Warning: some resources were not"
1949
" cleaned up in shutdown:\n"
1950
"InnoDB: threads %lu, events %lu,"
1951
" os_mutexes %lu, os_fast_mutexes %lu\n",
1952
(ulong) os_thread_count, (ulong) os_event_count,
1953
(ulong) os_mutex_count, (ulong) os_fast_mutex_count);
2007
1956
if (dict_foreign_err_file) {