summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0que.c10
-rw-r--r--storage/innobase/srv/srv0srv.c550
-rw-r--r--storage/innobase/srv/srv0start.c496
3 files changed, 557 insertions, 499 deletions
diff --git a/storage/innobase/srv/srv0que.c b/storage/innobase/srv/srv0que.c
index 9dc9ae453d9..9c261cbb00e 100644
--- a/storage/innobase/srv/srv0que.c
+++ b/storage/innobase/srv/srv0que.c
@@ -38,7 +38,7 @@ srv_que_task_queue_check(void)
}
UT_LIST_REMOVE(queue, srv_sys->tasks, thr);
-
+
mutex_exit(&kernel_mutex);
que_run_threads(thr);
@@ -62,11 +62,11 @@ srv_que_round_robin(
ut_ad(thr->state == QUE_THR_RUNNING);
mutex_enter(&kernel_mutex);
-
+
UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr);
new_thr = UT_LIST_GET_FIRST(srv_sys->tasks);
-
+
mutex_exit(&kernel_mutex);
return(new_thr);
@@ -106,8 +106,8 @@ srv_que_task_enqueue(
ut_a(0); /* Under MySQL this is never called */
mutex_enter(&kernel_mutex);
-
+
srv_que_task_enqueue_low(thr);
-
+
mutex_exit(&kernel_mutex);
}
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index c585536baee..1256dd21c87 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -73,22 +73,22 @@ const char* srv_main_thread_op_info = "";
/* The following three are dir paths which are catenated before file
names, where the file name itself may also contain a path */
-char* srv_data_home = NULL;
+char* srv_data_home = NULL;
#ifdef UNIV_LOG_ARCHIVE
-char* srv_arch_dir = NULL;
+char* srv_arch_dir = NULL;
#endif /* UNIV_LOG_ARCHIVE */
ibool srv_file_per_table = FALSE; /* store to its own file each table
created by an user; data dictionary
tables are in the system tablespace
0 */
-ibool srv_locks_unsafe_for_binlog = FALSE; /* Place locks to records only
- i.e. do not use next-key locking
- except on duplicate key checking and
- foreign key checking */
+ibool srv_locks_unsafe_for_binlog = FALSE; /* Place locks to records only
+ i.e. do not use next-key locking
+ except on duplicate key checking and
+ foreign key checking */
ulint srv_n_data_files = 0;
char** srv_data_file_names = NULL;
-ulint* srv_data_file_sizes = NULL; /* size in database pages */
+ulint* srv_data_file_sizes = NULL; /* size in database pages */
ibool srv_auto_extend_last_data_file = FALSE; /* if TRUE, then we
auto-extend the last data
@@ -100,19 +100,19 @@ ulint srv_last_file_size_max = 0; /* if != 0, this tells
ulong srv_auto_extend_increment = 8; /* If the last data file is
auto-extended, we add this
many pages to it at a time */
-ulint* srv_data_file_is_raw_partition = NULL;
+ulint* srv_data_file_is_raw_partition = NULL;
/* If the following is TRUE we do not allow inserts etc. This protects
the user from forgetting the 'newraw' keyword to my.cnf */
ibool srv_created_new_raw = FALSE;
-char** srv_log_group_home_dirs = NULL;
+char** srv_log_group_home_dirs = NULL;
ulint srv_n_log_groups = ULINT_MAX;
ulint srv_n_log_files = ULINT_MAX;
-ulint srv_log_file_size = ULINT_MAX; /* size in database pages */
-ulint srv_log_buffer_size = ULINT_MAX; /* size in database pages */
+ulint srv_log_file_size = ULINT_MAX; /* size in database pages */
+ulint srv_log_buffer_size = ULINT_MAX; /* size in database pages */
ulint srv_flush_log_at_trx_commit = 1;
byte srv_latin1_ordering[256] /* The sort order table of the latin1
@@ -152,16 +152,16 @@ byte srv_latin1_ordering[256] /* The sort order table of the latin1
, 0x44, 0x4E, 0x4F, 0x4F, 0x4F, 0x4F, 0x5D, 0xF7
, 0xD8, 0x55, 0x55, 0x55, 0x59, 0x59, 0xDE, 0xFF
};
-
+
ulint srv_pool_size = ULINT_MAX; /* size in pages; MySQL inits
this to size in kilobytes but
we normalize this to pages in
srv_boot() */
-ulint srv_awe_window_size = 0; /* size in pages; MySQL inits
+ulint srv_awe_window_size = 0; /* size in pages; MySQL inits
this to bytes, but we
normalize it to pages in
srv_boot() */
-ulint srv_mem_pool_size = ULINT_MAX; /* size in bytes */
+ulint srv_mem_pool_size = ULINT_MAX; /* size in bytes */
ulint srv_lock_table_size = ULINT_MAX;
ulint srv_n_file_io_threads = ULINT_MAX;
@@ -174,9 +174,9 @@ dulint srv_archive_recovery_limit_lsn;
ulint srv_lock_wait_timeout = 1024 * 1024 * 1024;
-char* srv_file_flush_method_str = NULL;
-ulint srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
-ulint srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
+char* srv_file_flush_method_str = NULL;
+ulint srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
+ulint srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
ulint srv_max_n_open_files = 300;
@@ -251,17 +251,18 @@ ulint srv_force_recovery = 0;
a semaphore inside InnoDB. innobase_start_or_create_for_mysql() sets the
value. */
-ulint srv_max_n_threads = 0;
+ulint srv_max_n_threads = 0;
/* The following controls how many threads we let inside InnoDB concurrently:
threads waiting for locks are not counted into the number because otherwise
we could get a deadlock. MySQL creates a thread for each user session, and
semaphore contention and convoy problems can occur withput this restriction.
Value 10 should be good if there are less than 4 processors + 4 disks in the
-computer. Bigger computers need bigger values. */
+computer. Bigger computers need bigger values. Value 0 will disable the
+concurrency check. */
-ulong srv_thread_concurrency = SRV_CONCURRENCY_THRESHOLD;
-ulong srv_commit_concurrency = 0;
+ulong srv_thread_concurrency = 0;
+ulong srv_commit_concurrency = 0;
os_fast_mutex_t srv_conc_mutex; /* this mutex protects srv_conc data
structures */
@@ -313,13 +314,13 @@ ibool srv_innodb_status = FALSE;
ibool srv_use_doublewrite_buf = TRUE;
ibool srv_use_checksums = TRUE;
-ibool srv_set_thread_priorities = TRUE;
-int srv_query_thread_priority = 0;
+ibool srv_set_thread_priorities = TRUE;
+int srv_query_thread_priority = 0;
/* TRUE if the Address Windowing Extensions of Windows are used; then we must
disable adaptive hash indexes */
ibool srv_use_awe = FALSE;
-ibool srv_use_adaptive_hash_indexes = TRUE;
+ibool srv_use_adaptive_hash_indexes = TRUE;
/*-------------------------------------------*/
ulong srv_n_spin_wait_rounds = 20;
@@ -338,10 +339,12 @@ ulint srv_n_rows_inserted = 0;
ulint srv_n_rows_updated = 0;
ulint srv_n_rows_deleted = 0;
ulint srv_n_rows_read = 0;
+#ifndef UNIV_HOTBACKUP
static ulint srv_n_rows_inserted_old = 0;
static ulint srv_n_rows_updated_old = 0;
static ulint srv_n_rows_deleted_old = 0;
static ulint srv_n_rows_read_old = 0;
+#endif /* !UNIV_HOTBACKUP */
ulint srv_n_lock_wait_count = 0;
ulint srv_n_lock_wait_current_count = 0;
@@ -355,9 +358,9 @@ ulint srv_n_lock_max_wait_time = 0;
*/
ibool srv_print_verbose_log = TRUE;
ibool srv_print_innodb_monitor = FALSE;
-ibool srv_print_innodb_lock_monitor = FALSE;
-ibool srv_print_innodb_tablespace_monitor = FALSE;
-ibool srv_print_innodb_table_monitor = FALSE;
+ibool srv_print_innodb_lock_monitor = FALSE;
+ibool srv_print_innodb_tablespace_monitor = FALSE;
+ibool srv_print_innodb_table_monitor = FALSE;
/* The parameters below are obsolete: */
@@ -370,7 +373,7 @@ ibool srv_sim_disk_wait_by_wait = FALSE;
ibool srv_measure_contention = FALSE;
ibool srv_measure_by_spin = FALSE;
-
+
ibool srv_test_extra_mutexes = FALSE;
ibool srv_test_nocache = FALSE;
ibool srv_test_cache_evict = FALSE;
@@ -397,6 +400,18 @@ mutex_t srv_innodb_monitor_mutex;
mutex_t srv_monitor_file_mutex;
/* Temporary file for innodb monitor output */
FILE* srv_monitor_file;
+/* Mutex for locking srv_dict_tmpfile.
+This mutex has a very high rank; threads reserving it should not
+be holding any InnoDB latches. */
+mutex_t srv_dict_tmpfile_mutex;
+/* Temporary file for output from the data dictionary */
+FILE* srv_dict_tmpfile;
+/* Mutex for locking srv_misc_tmpfile.
+This mutex has a very low rank; threads reserving it should not
+acquire any further latches or sleep before releasing this one. */
+mutex_t srv_misc_tmpfile_mutex;
+/* Temporary file for miscellanous diagnostic output */
+FILE* srv_misc_tmpfile;
ulint srv_main_thread_process_no = 0;
ulint srv_main_thread_id = 0;
@@ -423,7 +438,7 @@ kernel -- kernel;
query thread execution:
(a) without kernel mutex
-reserved -- process executing in user mode;
+reserved -- process executing in user mode;
(b) with kernel mutex reserved
-- process executing in kernel mode;
@@ -518,7 +533,7 @@ keep record of which thread owns which resource and
in the above case boost the priority of the background thread
so that it will be scheduled and it can release the resource.
This solution is called priority inheritance in real-time programming.
-A drawback of this solution is that the overhead of acquiring a mutex
+A drawback of this solution is that the overhead of acquiring a mutex
increases slightly, maybe 0.2 microseconds on a 100 MHz Pentium, because
the thread has to call os_thread_get_curr_id.
This may be compared to 0.5 microsecond overhead for a mutex lock-unlock
@@ -650,6 +665,7 @@ srv_table_get_nth_slot(
return(srv_sys->threads + index);
}
+#ifndef UNIV_HOTBACKUP
/*************************************************************************
Gets the number of threads in the system. */
@@ -663,7 +679,7 @@ srv_get_n_threads(void)
mutex_enter(&kernel_mutex);
for (i = SRV_COM; i < SRV_MASTER + 1; i++) {
-
+
n_threads += srv_n_threads[i];
}
@@ -685,7 +701,7 @@ srv_table_reserve_slot(
{
srv_slot_t* slot;
ulint i;
-
+
ut_a(type > 0);
ut_a(type <= SRV_MASTER);
@@ -698,7 +714,7 @@ srv_table_reserve_slot(
}
ut_a(slot->in_use == FALSE);
-
+
slot->in_use = TRUE;
slot->suspended = FALSE;
slot->id = os_thread_get_curr_id();
@@ -729,7 +745,7 @@ srv_suspend_thread(void)
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
-
+
slot_no = thr_local_get_slot_no(os_thread_get_curr_id());
if (srv_print_thread_releases) {
@@ -747,7 +763,7 @@ srv_suspend_thread(void)
ut_ad(type <= SRV_MASTER);
event = slot->event;
-
+
slot->suspended = TRUE;
ut_ad(srv_n_threads_active[type] > 0);
@@ -758,6 +774,7 @@ srv_suspend_thread(void)
return(event);
}
+#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Releases threads of the type given from suspension in the thread table.
@@ -782,13 +799,13 @@ srv_release_threads(
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
-
+
for (i = 0; i < OS_THREAD_MAX_N; i++) {
-
+
slot = srv_table_get_nth_slot(i);
if (slot->in_use && slot->type == type && slot->suspended) {
-
+
slot->suspended = FALSE;
srv_n_threads_active[type]++;
@@ -799,7 +816,7 @@ srv_release_threads(
fprintf(stderr,
"Releasing thread %lu type %lu from slot %lu meter %lu\n",
(ulong) slot->id, (ulong) type, (ulong) i,
- (ulong) srv_meter[SRV_RECOVERY]);
+ (ulong) srv_meter[SRV_RECOVERY]);
}
count++;
@@ -826,7 +843,7 @@ srv_get_thread_type(void)
ulint type;
mutex_enter(&kernel_mutex);
-
+
slot_no = thr_local_get_slot_no(os_thread_get_curr_id());
slot = srv_table_get_nth_slot(slot_no);
@@ -848,7 +865,7 @@ void
srv_init(void)
/*==========*/
{
- srv_conc_slot_t* conc_slot;
+ srv_conc_slot_t* conc_slot;
srv_slot_t* slot;
dict_table_t* table;
ulint i;
@@ -861,13 +878,13 @@ srv_init(void)
mutex_create(&srv_innodb_monitor_mutex);
mutex_set_level(&srv_innodb_monitor_mutex, SYNC_NO_ORDER_CHECK);
-
+
srv_sys->threads = mem_alloc(OS_THREAD_MAX_N * sizeof(srv_slot_t));
for (i = 0; i < OS_THREAD_MAX_N; i++) {
slot = srv_table_get_nth_slot(i);
slot->in_use = FALSE;
- slot->type=0; /* Avoid purify errors */
+ slot->type=0; /* Avoid purify errors */
slot->event = os_event_create(NULL);
ut_a(slot->event);
}
@@ -883,7 +900,7 @@ srv_init(void)
}
srv_lock_timeout_thread_event = os_event_create(NULL);
-
+
for (i = 0; i < SRV_MASTER + 1; i++) {
srv_n_threads_active[i] = 0;
srv_n_threads[i] = 0;
@@ -893,7 +910,7 @@ srv_init(void)
srv_meter_high_water2[i] = 200;
srv_meter_foreground[i] = 250;
}
-
+
srv_sys->operational = os_event_create(NULL);
ut_a(srv_sys->operational);
@@ -902,24 +919,24 @@ srv_init(void)
/* create dummy table and index for old-style infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY1",
- DICT_HDR_SPACE, 1, FALSE);
+ DICT_HDR_SPACE, 1, 0);
dict_mem_table_add_col(table, "DUMMY", DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8, 0);
srv_sys->dummy_ind1 = dict_mem_index_create("SYS_DUMMY1",
"SYS_DUMMY1", DICT_HDR_SPACE, 0, 1);
dict_index_add_col(srv_sys->dummy_ind1,
- dict_table_get_nth_col(table, 0), 0, 0);
+ dict_table_get_nth_col(table, 0), 0);
srv_sys->dummy_ind1->table = table;
/* create dummy table and index for new-style infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY2",
- DICT_HDR_SPACE, 1, TRUE);
+ DICT_HDR_SPACE, 1, DICT_TF_COMPACT);
dict_mem_table_add_col(table, "DUMMY", DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8, 0);
srv_sys->dummy_ind2 = dict_mem_index_create("SYS_DUMMY2",
"SYS_DUMMY2", DICT_HDR_SPACE, 0, 1);
dict_index_add_col(srv_sys->dummy_ind2,
- dict_table_get_nth_col(table, 0), 0, 0);
+ dict_table_get_nth_col(table, 0), 0);
srv_sys->dummy_ind2->table = table;
/* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */
@@ -928,7 +945,7 @@ srv_init(void)
/* Init the server concurrency restriction data structures */
os_fast_mutex_init(&srv_conc_mutex);
-
+
UT_LIST_INIT(srv_conc_queue);
srv_conc_slots = mem_alloc(OS_THREAD_MAX_N * sizeof(srv_conc_slot_t));
@@ -939,7 +956,7 @@ srv_init(void)
conc_slot->event = os_event_create(NULL);
ut_a(conc_slot->event);
}
-}
+}
/*************************************************************************
Frees the OS fast mutex created in srv_init(). */
@@ -996,7 +1013,7 @@ srv_conc_enter_innodb(
os_fast_mutex_lock(&srv_conc_mutex);
retry:
if (trx->declared_to_be_inside_innodb) {
- ut_print_timestamp(stderr);
+ ut_print_timestamp(stderr);
fputs(
" InnoDB: Error: trying to declare trx to enter InnoDB, but\n"
"InnoDB: it already is declared.\n", stderr);
@@ -1012,19 +1029,19 @@ retry:
srv_conc_n_threads++;
trx->declared_to_be_inside_innodb = TRUE;
trx->n_tickets_to_enter_innodb = SRV_FREE_TICKETS_TO_ENTER;
-
+
os_fast_mutex_unlock(&srv_conc_mutex);
return;
}
- /* If the transaction is not holding resources,
+ /* If the transaction is not holding resources,
let it sleep for SRV_THREAD_SLEEP_DELAY microseconds, and try again then */
-
+
if (!has_slept && !trx->has_search_latch
- && NULL == UT_LIST_GET_FIRST(trx->trx_locks)) {
+ && NULL == UT_LIST_GET_FIRST(trx->trx_locks)) {
- has_slept = TRUE; /* We let is sleep only once to avoid
+ has_slept = TRUE; /* We let is sleep only once to avoid
starvation */
srv_conc_n_waiting_threads++;
@@ -1038,10 +1055,9 @@ retry:
situations of lots of thread switches. Simply put some
threads aside for a while to reduce the number of thread
switches. */
- if (SRV_THREAD_SLEEP_DELAY > 0)
- {
- os_thread_sleep(SRV_THREAD_SLEEP_DELAY);
- }
+ if (SRV_THREAD_SLEEP_DELAY > 0) {
+ os_thread_sleep(SRV_THREAD_SLEEP_DELAY);
+ }
trx->op_info = "";
@@ -1050,7 +1066,7 @@ retry:
srv_conc_n_waiting_threads--;
goto retry;
- }
+ }
/* Too many threads inside: put the current thread to a queue */
@@ -1084,7 +1100,7 @@ retry:
/* Add to the queue */
slot->reserved = TRUE;
slot->wait_ended = FALSE;
-
+
UT_LIST_ADD_LAST(srv_conc_queue, srv_conc_queue, slot);
os_event_reset(slot->event);
@@ -1129,8 +1145,8 @@ srv_conc_force_enter_innodb(
trx_t* trx) /* in: transaction object associated with the
thread */
{
- if (srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD) {
-
+ if (UNIV_LIKELY(!srv_thread_concurrency)) {
+
return;
}
@@ -1155,13 +1171,13 @@ srv_conc_force_exit_innodb(
{
srv_conc_slot_t* slot = NULL;
- if (srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD) {
-
+ if (UNIV_LIKELY(!srv_thread_concurrency)) {
+
return;
}
if (trx->declared_to_be_inside_innodb == FALSE) {
-
+
return;
}
@@ -1174,7 +1190,7 @@ srv_conc_force_exit_innodb(
if (srv_conc_n_threads < (lint)srv_thread_concurrency) {
/* Look for a slot where a thread is waiting and no other
thread has yet released the thread */
-
+
slot = UT_LIST_GET_FIRST(srv_conc_queue);
while (slot && slot->wait_ended == TRUE) {
@@ -1235,15 +1251,15 @@ srv_normalize_init_values(void)
ulint i;
n = srv_n_data_files;
-
+
for (i = 0; i < n; i++) {
srv_data_file_sizes[i] = srv_data_file_sizes[i]
* ((1024 * 1024) / UNIV_PAGE_SIZE);
- }
+ }
srv_last_file_size_max = srv_last_file_size_max
* ((1024 * 1024) / UNIV_PAGE_SIZE);
-
+
srv_log_file_size = srv_log_file_size / UNIV_PAGE_SIZE;
srv_log_buffer_size = srv_log_buffer_size / UNIV_PAGE_SIZE;
@@ -1251,15 +1267,15 @@ srv_normalize_init_values(void)
srv_pool_size = srv_pool_size / (UNIV_PAGE_SIZE / 1024);
srv_awe_window_size = srv_awe_window_size / UNIV_PAGE_SIZE;
-
+
if (srv_use_awe) {
- /* If we are using AWE we must save memory in the 32-bit
+ /* If we are using AWE we must save memory in the 32-bit
address space of the process, and cannot bind the lock
table size to the real buffer pool size. */
- srv_lock_table_size = 20 * srv_awe_window_size;
+ srv_lock_table_size = 20 * srv_awe_window_size;
} else {
- srv_lock_table_size = 5 * srv_pool_size;
+ srv_lock_table_size = 5 * srv_pool_size;
}
return(DB_SUCCESS);
@@ -1277,16 +1293,16 @@ srv_boot(void)
/* Transform the init parameter values given by MySQL to
use units we use inside InnoDB: */
-
+
err = srv_normalize_init_values();
if (err != DB_SUCCESS) {
return(err);
}
-
+
/* Initialize synchronization primitives, memory management, and thread
local storage */
-
+
srv_general_init();
/* Initialize this module */
@@ -1321,9 +1337,9 @@ srv_table_reserve_slot_for_mysql(void)
if (i >= OS_THREAD_MAX_N) {
- ut_print_timestamp(stderr);
+ ut_print_timestamp(stderr);
- fprintf(stderr,
+ fprintf(stderr,
" InnoDB: There appear to be %lu MySQL threads currently waiting\n"
"InnoDB: inside InnoDB, which is the upper limit. Cannot continue operation.\n"
"InnoDB: We intentionally generate a seg fault to print a stack trace\n"
@@ -1331,9 +1347,9 @@ srv_table_reserve_slot_for_mysql(void)
for (i = 0; i < OS_THREAD_MAX_N; i++) {
- slot = srv_mysql_table + i;
+ slot = srv_mysql_table + i;
- fprintf(stderr,
+ fprintf(stderr,
"Slot %lu: thread id %lu, type %lu, in use %lu, susp %lu, time %lu\n",
(ulong) i, (ulong) os_thread_pf(slot->id),
(ulong) slot->type, (ulong) slot->in_use,
@@ -1341,14 +1357,14 @@ srv_table_reserve_slot_for_mysql(void)
(ulong) difftime(ut_time(), slot->suspend_time));
}
- ut_error;
+ ut_error;
}
-
+
slot = srv_mysql_table + i;
}
ut_a(slot->in_use == FALSE);
-
+
slot->in_use = TRUE;
slot->id = os_thread_get_curr_id();
slot->handle = os_thread_get_curr();
@@ -1388,7 +1404,7 @@ srv_suspend_mysql_thread(
#endif /* UNIV_SYNC_DEBUG */
trx = thr_get_trx(thr);
-
+
os_event_set(srv_lock_timeout_thread_event);
mutex_enter(&kernel_mutex);
@@ -1398,7 +1414,7 @@ srv_suspend_mysql_thread(
if (thr->state == QUE_THR_RUNNING) {
ut_ad(thr->is_active == TRUE);
-
+
/* The lock has already been released or this transaction
was chosen as a deadlock victim: no need to suspend */
@@ -1412,16 +1428,16 @@ srv_suspend_mysql_thread(
return;
}
-
+
ut_ad(thr->is_active == FALSE);
slot = srv_table_reserve_slot_for_mysql();
event = slot->event;
-
+
slot->thr = thr;
- os_event_reset(event);
+ os_event_reset(event);
slot->suspend_time = ut_time();
@@ -1435,17 +1451,17 @@ srv_suspend_mysql_thread(
/* Wake the lock timeout monitor thread, if it is suspended */
os_event_set(srv_lock_timeout_thread_event);
-
+
mutex_exit(&kernel_mutex);
if (trx->declared_to_be_inside_innodb) {
was_declared_inside_innodb = TRUE;
-
+
/* We must declare this OS thread to exit InnoDB, since a
possible other thread holding a lock which this thread waits
for must be allowed to enter, sooner or later */
-
+
srv_conc_force_exit_innodb(trx);
}
@@ -1460,7 +1476,7 @@ srv_suspend_mysql_thread(
ut_a(trx->dict_operation_lock_mode == 0);
/* Wait for the release */
-
+
os_event_wait(event);
if (had_dict_lock) {
@@ -1471,14 +1487,14 @@ srv_suspend_mysql_thread(
if (was_declared_inside_innodb) {
/* Return back inside InnoDB */
-
+
srv_conc_force_enter_innodb(trx);
}
mutex_enter(&kernel_mutex);
/* Release the slot for others to use */
-
+
slot->in_use = FALSE;
wait_time = ut_difftime(ut_time(), slot->suspend_time);
@@ -1488,7 +1504,7 @@ srv_suspend_mysql_thread(
finish_time = (ib_longlong)sec * 1000000 + ms;
diff_time = (ulint) (finish_time - start_time);
-
+
srv_n_lock_wait_current_count--;
srv_n_lock_wait_time = srv_n_lock_wait_time + diff_time;
if (diff_time > srv_n_lock_max_wait_time) {
@@ -1504,10 +1520,10 @@ srv_suspend_mysql_thread(
mutex_exit(&kernel_mutex);
- if (srv_lock_wait_timeout < 100000000 &&
- wait_time > (double)srv_lock_wait_timeout) {
+ if (srv_lock_wait_timeout < 100000000 &&
+ wait_time > (double)srv_lock_wait_timeout) {
- trx->error_state = DB_LOCK_WAIT_TIMEOUT;
+ trx->error_state = DB_LOCK_WAIT_TIMEOUT;
}
#else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in
@@ -1525,12 +1541,12 @@ void
srv_release_mysql_thread_if_suspended(
/*==================================*/
que_thr_t* thr) /* in: query thread associated with the
- MySQL OS thread */
+ MySQL OS thread */
{
#ifndef UNIV_HOTBACKUP
srv_slot_t* slot;
ulint i;
-
+
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
@@ -1575,7 +1591,7 @@ srv_refresh_innodb_monitor_stats(void)
btr_cur_n_non_sea_old = btr_cur_n_non_sea;
log_refresh_stats();
-
+
buf_refresh_io_stats();
srv_n_rows_inserted_old = srv_n_rows_inserted;
@@ -1600,7 +1616,7 @@ srv_printf_innodb_monitor(
{
double time_elapsed;
time_t current_time;
- ulint n_reserved;
+ ulint n_reserved;
mutex_enter(&srv_innodb_monitor_mutex);
@@ -1609,7 +1625,7 @@ srv_printf_innodb_monitor(
/* We add 0.001 seconds to time_elapsed to prevent division
by zero if two users happen to call SHOW INNODB STATUS at the same
time */
-
+
time_elapsed = difftime(current_time, srv_last_monitor_time)
+ 0.001;
@@ -1685,12 +1701,12 @@ srv_printf_innodb_monitor(
btr_cur_n_non_sea_old = btr_cur_n_non_sea;
fputs("---\n"
- "LOG\n"
+ "LOG\n"
"---\n", file);
log_print(file);
fputs("----------------------\n"
- "BUFFER POOL AND MEMORY\n"
+ "BUFFER POOL AND MEMORY\n"
"----------------------\n", file);
fprintf(file,
"Total memory allocated " ULINTPF
@@ -1703,31 +1719,31 @@ srv_printf_innodb_monitor(
"In addition to that %lu MB of AWE memory allocated\n",
(ulong) (srv_pool_size / ((1024 * 1024) / UNIV_PAGE_SIZE)));
}
-
+
buf_print_io(file);
fputs("--------------\n"
"ROW OPERATIONS\n"
"--------------\n", file);
fprintf(file, "%ld queries inside InnoDB, %lu queries in queue\n",
- (long) srv_conc_n_threads,
- (ulong) srv_conc_n_waiting_threads);
+ (long) srv_conc_n_threads,
+ (ulong) srv_conc_n_waiting_threads);
fprintf(file, "%lu read views open inside InnoDB\n",
UT_LIST_GET_LEN(trx_sys->view_list));
- n_reserved = fil_space_get_n_reserved_extents(0);
- if (n_reserved > 0) {
- fprintf(file,
- "%lu tablespace extents now reserved for B-tree split operations\n",
- (ulong) n_reserved);
- }
+ n_reserved = fil_space_get_n_reserved_extents(0);
+ if (n_reserved > 0) {
+ fprintf(file,
+ "%lu tablespace extents now reserved for B-tree split operations\n",
+ (ulong) n_reserved);
+ }
#ifdef UNIV_LINUX
fprintf(file, "Main thread process no. %lu, id %lu, state: %s\n",
- (ulong) srv_main_thread_process_no,
- (ulong) srv_main_thread_id,
- srv_main_thread_op_info);
+ (ulong) srv_main_thread_process_no,
+ (ulong) srv_main_thread_id,
+ srv_main_thread_op_info);
#else
fprintf(file, "Main thread id %lu, state: %s\n",
(ulong) srv_main_thread_id,
@@ -1736,9 +1752,9 @@ srv_printf_innodb_monitor(
fprintf(file,
"Number of rows inserted " ULINTPF
", updated " ULINTPF ", deleted " ULINTPF ", read " ULINTPF "\n",
- srv_n_rows_inserted,
- srv_n_rows_updated,
- srv_n_rows_deleted,
+ srv_n_rows_inserted,
+ srv_n_rows_updated,
+ srv_n_rows_deleted,
srv_n_rows_read);
fprintf(file,
"%.2f inserts/s, %.2f updates/s, %.2f deletes/s, %.2f reads/s\n",
@@ -1757,7 +1773,7 @@ srv_printf_innodb_monitor(
srv_n_rows_read_old = srv_n_rows_read;
fputs("----------------------------\n"
- "END OF INNODB MONITOR OUTPUT\n"
+ "END OF INNODB MONITOR OUTPUT\n"
"============================\n", file);
mutex_exit(&srv_innodb_monitor_mutex);
fflush(file);
@@ -1770,58 +1786,58 @@ void
srv_export_innodb_status(void)
{
- mutex_enter(&srv_innodb_monitor_mutex);
- export_vars.innodb_data_pending_reads= os_n_pending_reads;
- export_vars.innodb_data_pending_writes= os_n_pending_writes;
- export_vars.innodb_data_pending_fsyncs=
- fil_n_pending_log_flushes + fil_n_pending_tablespace_flushes;
- export_vars.innodb_data_fsyncs= os_n_fsyncs;
- export_vars.innodb_data_read= srv_data_read;
- export_vars.innodb_data_reads= os_n_file_reads;
- export_vars.innodb_data_writes= os_n_file_writes;
- export_vars.innodb_data_written= srv_data_written;
- export_vars.innodb_buffer_pool_read_requests= buf_pool->n_page_gets;
- export_vars.innodb_buffer_pool_write_requests= srv_buf_pool_write_requests;
- export_vars.innodb_buffer_pool_wait_free= srv_buf_pool_wait_free;
- export_vars.innodb_buffer_pool_pages_flushed= srv_buf_pool_flushed;
- export_vars.innodb_buffer_pool_reads= srv_buf_pool_reads;
- export_vars.innodb_buffer_pool_read_ahead_rnd= srv_read_ahead_rnd;
- export_vars.innodb_buffer_pool_read_ahead_seq= srv_read_ahead_seq;
- export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU);
- export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list);
- export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free);
- export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number();
- export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size;
- export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size -
- UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free);
- export_vars.innodb_page_size= UNIV_PAGE_SIZE;
- export_vars.innodb_log_waits= srv_log_waits;
- export_vars.innodb_os_log_written= srv_os_log_written;
- export_vars.innodb_os_log_fsyncs= fil_n_log_flushes;
- export_vars.innodb_os_log_pending_fsyncs= fil_n_pending_log_flushes;
- export_vars.innodb_os_log_pending_writes= srv_os_log_pending_writes;
- export_vars.innodb_log_write_requests= srv_log_write_requests;
- export_vars.innodb_log_writes= srv_log_writes;
- export_vars.innodb_dblwr_pages_written= srv_dblwr_pages_written;
- export_vars.innodb_dblwr_writes= srv_dblwr_writes;
- export_vars.innodb_pages_created= buf_pool->n_pages_created;
- export_vars.innodb_pages_read= buf_pool->n_pages_read;
- export_vars.innodb_pages_written= buf_pool->n_pages_written;
- export_vars.innodb_row_lock_waits= srv_n_lock_wait_count;
- export_vars.innodb_row_lock_current_waits= srv_n_lock_wait_current_count;
- export_vars.innodb_row_lock_time= srv_n_lock_wait_time / 10000;
+ mutex_enter(&srv_innodb_monitor_mutex);
+ export_vars.innodb_data_pending_reads= os_n_pending_reads;
+ export_vars.innodb_data_pending_writes= os_n_pending_writes;
+ export_vars.innodb_data_pending_fsyncs=
+ fil_n_pending_log_flushes + fil_n_pending_tablespace_flushes;
+ export_vars.innodb_data_fsyncs= os_n_fsyncs;
+ export_vars.innodb_data_read= srv_data_read;
+ export_vars.innodb_data_reads= os_n_file_reads;
+ export_vars.innodb_data_writes= os_n_file_writes;
+ export_vars.innodb_data_written= srv_data_written;
+ export_vars.innodb_buffer_pool_read_requests= buf_pool->n_page_gets;
+ export_vars.innodb_buffer_pool_write_requests= srv_buf_pool_write_requests;
+ export_vars.innodb_buffer_pool_wait_free= srv_buf_pool_wait_free;
+ export_vars.innodb_buffer_pool_pages_flushed= srv_buf_pool_flushed;
+ export_vars.innodb_buffer_pool_reads= srv_buf_pool_reads;
+ export_vars.innodb_buffer_pool_read_ahead_rnd= srv_read_ahead_rnd;
+ export_vars.innodb_buffer_pool_read_ahead_seq= srv_read_ahead_seq;
+ export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU);
+ export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list);
+ export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free);
+ export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number();
+ export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size;
+ export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size -
+ UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free);
+ export_vars.innodb_page_size= UNIV_PAGE_SIZE;
+ export_vars.innodb_log_waits= srv_log_waits;
+ export_vars.innodb_os_log_written= srv_os_log_written;
+ export_vars.innodb_os_log_fsyncs= fil_n_log_flushes;
+ export_vars.innodb_os_log_pending_fsyncs= fil_n_pending_log_flushes;
+ export_vars.innodb_os_log_pending_writes= srv_os_log_pending_writes;
+ export_vars.innodb_log_write_requests= srv_log_write_requests;
+ export_vars.innodb_log_writes= srv_log_writes;
+ export_vars.innodb_dblwr_pages_written= srv_dblwr_pages_written;
+ export_vars.innodb_dblwr_writes= srv_dblwr_writes;
+ export_vars.innodb_pages_created= buf_pool->n_pages_created;
+ export_vars.innodb_pages_read= buf_pool->n_pages_read;
+ export_vars.innodb_pages_written= buf_pool->n_pages_written;
+ export_vars.innodb_row_lock_waits= srv_n_lock_wait_count;
+ export_vars.innodb_row_lock_current_waits= srv_n_lock_wait_current_count;
+ export_vars.innodb_row_lock_time= srv_n_lock_wait_time / 10000;
if (srv_n_lock_wait_count > 0) {
export_vars.innodb_row_lock_time_avg = (ulint)
(srv_n_lock_wait_time / 10000 / srv_n_lock_wait_count);
} else {
export_vars.innodb_row_lock_time_avg = 0;
}
- export_vars.innodb_row_lock_time_max= srv_n_lock_max_wait_time / 10000;
- export_vars.innodb_rows_read= srv_n_rows_read;
- export_vars.innodb_rows_inserted= srv_n_rows_inserted;
- export_vars.innodb_rows_updated= srv_n_rows_updated;
- export_vars.innodb_rows_deleted= srv_n_rows_deleted;
- mutex_exit(&srv_innodb_monitor_mutex);
+ export_vars.innodb_row_lock_time_max= srv_n_lock_max_wait_time / 10000;
+ export_vars.innodb_rows_read= srv_n_rows_read;
+ export_vars.innodb_rows_inserted= srv_n_rows_inserted;
+ export_vars.innodb_rows_updated= srv_n_rows_updated;
+ export_vars.innodb_rows_deleted= srv_n_rows_deleted;
+ mutex_exit(&srv_innodb_monitor_mutex);
}
@@ -1843,7 +1859,7 @@ srv_lock_timeout_and_monitor_thread(
{
srv_slot_t* slot;
double time_elapsed;
- time_t current_time;
+ time_t current_time;
time_t last_table_monitor_time;
time_t last_monitor_time;
ibool some_waits;
@@ -1852,7 +1868,7 @@ srv_lock_timeout_and_monitor_thread(
#ifdef UNIV_DEBUG_THREAD_CREATION
fprintf(stderr, "Lock timeout thread starts, id %lu\n",
- os_thread_pf(os_thread_get_curr_id()));
+ os_thread_pf(os_thread_get_curr_id()));
#endif
UT_NOT_USED(arg);
srv_last_monitor_time = time(NULL);
@@ -1869,71 +1885,71 @@ loop:
/* In case mutex_exit is not a memory barrier, it is
theoretically possible some threads are left waiting though
the semaphore is already released. Wake up those threads: */
-
+
sync_arr_wake_threads_if_sema_free();
current_time = time(NULL);
time_elapsed = difftime(current_time, last_monitor_time);
-
+
if (time_elapsed > 15) {
- last_monitor_time = time(NULL);
+ last_monitor_time = time(NULL);
- if (srv_print_innodb_monitor) {
- srv_printf_innodb_monitor(stderr, NULL, NULL);
- }
+ if (srv_print_innodb_monitor) {
+ srv_printf_innodb_monitor(stderr, NULL, NULL);
+ }
- if (srv_innodb_status) {
- mutex_enter(&srv_monitor_file_mutex);
- rewind(srv_monitor_file);
- srv_printf_innodb_monitor(srv_monitor_file, NULL, NULL);
- os_file_set_eof(srv_monitor_file);
- mutex_exit(&srv_monitor_file_mutex);
- }
+ if (srv_innodb_status) {
+ mutex_enter(&srv_monitor_file_mutex);
+ rewind(srv_monitor_file);
+ srv_printf_innodb_monitor(srv_monitor_file, NULL, NULL);
+ os_file_set_eof(srv_monitor_file);
+ mutex_exit(&srv_monitor_file_mutex);
+ }
- if (srv_print_innodb_tablespace_monitor
- && difftime(current_time, last_table_monitor_time) > 60) {
+ if (srv_print_innodb_tablespace_monitor
+ && difftime(current_time, last_table_monitor_time) > 60) {
- last_table_monitor_time = time(NULL);
+ last_table_monitor_time = time(NULL);
- fputs("================================================\n",
- stderr);
+ fputs("================================================\n",
+ stderr);
- ut_print_timestamp(stderr);
+ ut_print_timestamp(stderr);
- fputs(" INNODB TABLESPACE MONITOR OUTPUT\n"
- "================================================\n",
- stderr);
-
- fsp_print(0);
- fputs("Validating tablespace\n", stderr);
- fsp_validate(0);
- fputs("Validation ok\n"
- "---------------------------------------\n"
- "END OF INNODB TABLESPACE MONITOR OUTPUT\n"
- "=======================================\n",
- stderr);
- }
+ fputs(" INNODB TABLESPACE MONITOR OUTPUT\n"
+ "================================================\n",
+ stderr);
- if (srv_print_innodb_table_monitor
- && difftime(current_time, last_table_monitor_time) > 60) {
+ fsp_print(0);
+ fputs("Validating tablespace\n", stderr);
+ fsp_validate(0);
+ fputs("Validation ok\n"
+ "---------------------------------------\n"
+ "END OF INNODB TABLESPACE MONITOR OUTPUT\n"
+ "=======================================\n",
+ stderr);
+ }
- last_table_monitor_time = time(NULL);
+ if (srv_print_innodb_table_monitor
+ && difftime(current_time, last_table_monitor_time) > 60) {
- fputs("===========================================\n", stderr);
+ last_table_monitor_time = time(NULL);
- ut_print_timestamp(stderr);
+ fputs("===========================================\n", stderr);
+
+ ut_print_timestamp(stderr);
- fputs(" INNODB TABLE MONITOR OUTPUT\n"
- "===========================================\n",
- stderr);
- dict_print();
+ fputs(" INNODB TABLE MONITOR OUTPUT\n"
+ "===========================================\n",
+ stderr);
+ dict_print();
- fputs("-----------------------------------\n"
- "END OF INNODB TABLE MONITOR OUTPUT\n"
- "==================================\n",
- stderr);
- }
+ fputs("-----------------------------------\n"
+ "END OF INNODB TABLE MONITOR OUTPUT\n"
+ "==================================\n",
+ stderr);
+ }
}
mutex_enter(&kernel_mutex);
@@ -1942,7 +1958,7 @@ loop:
/* Check of all slots if a thread is waiting there, and if it
has exceeded the time limit */
-
+
for (i = 0; i < OS_THREAD_MAX_N; i++) {
slot = srv_mysql_table + i;
@@ -1951,9 +1967,9 @@ loop:
some_waits = TRUE;
wait_time = ut_difftime(ut_time(), slot->suspend_time);
-
- if (srv_lock_wait_timeout < 100000000 &&
- (wait_time > (double) srv_lock_wait_timeout
+
+ if (srv_lock_wait_timeout < 100000000 &&
+ (wait_time > (double) srv_lock_wait_timeout
|| wait_time < 0)) {
/* Timeout exceeded or a wrap-around in system
@@ -1963,10 +1979,10 @@ loop:
possible that the lock has already been
granted: in that case do nothing */
- if (thr_get_trx(slot->thr)->wait_lock) {
- lock_cancel_waiting_and_release(
- thr_get_trx(slot->thr)->wait_lock);
- }
+ if (thr_get_trx(slot->thr)->wait_lock) {
+ lock_cancel_waiting_and_release(
+ thr_get_trx(slot->thr)->wait_lock);
+ }
}
}
}
@@ -2037,7 +2053,7 @@ srv_error_monitor_thread(
#ifdef UNIV_DEBUG_THREAD_CREATION
fprintf(stderr, "Error monitor thread starts, id %lu\n",
- os_thread_pf(os_thread_get_curr_id()));
+ os_thread_pf(os_thread_get_curr_id()));
#endif
loop:
srv_error_monitor_active = TRUE;
@@ -2121,7 +2137,7 @@ srv_active_wake_master_thread(void)
/*===============================*/
{
srv_activity_count++;
-
+
if (srv_n_threads_active[SRV_MASTER] == 0) {
mutex_enter(&kernel_mutex);
@@ -2140,7 +2156,7 @@ srv_wake_master_thread(void)
/*========================*/
{
srv_activity_count++;
-
+
mutex_enter(&kernel_mutex);
srv_release_threads(SRV_MASTER, 1);
@@ -2164,8 +2180,8 @@ srv_master_thread(
os_thread_create */
{
os_event_t event;
- time_t last_flush_time;
- time_t current_time;
+ time_t last_flush_time;
+ time_t current_time;
ulint old_activity_count;
ulint n_pages_purged;
ulint n_bytes_merged;
@@ -2178,15 +2194,15 @@ srv_master_thread(
ulint n_pend_ios;
ibool skip_sleep = FALSE;
ulint i;
-
+
#ifdef UNIV_DEBUG_THREAD_CREATION
fprintf(stderr, "Master thread starts, id %lu\n",
- os_thread_pf(os_thread_get_curr_id()));
+ os_thread_pf(os_thread_get_curr_id()));
#endif
srv_main_thread_process_no = os_proc_get_number();
srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
-
- srv_table_reserve_slot(SRV_MASTER);
+
+ srv_table_reserve_slot(SRV_MASTER);
mutex_enter(&kernel_mutex);
@@ -2225,10 +2241,10 @@ loop:
n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read
+ buf_pool->n_pages_written;
srv_main_thread_op_info = "sleeping";
-
+
if (!skip_sleep) {
- os_thread_sleep(1000000);
+ os_thread_sleep(1000000);
}
skip_sleep = FALSE;
@@ -2277,19 +2293,19 @@ loop:
}
if (buf_get_modified_ratio_pct() >
- srv_max_buf_pool_modified_pct) {
+ srv_max_buf_pool_modified_pct) {
/* Try to keep the number of modified pages in the
buffer pool under the limit wished by the user */
-
+
n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100,
ut_dulint_max);
- /* If we had to do the flush, it may have taken
+ /* If we had to do the flush, it may have taken
even more than 1 second, and also, there may be more
to flush. Do not sleep 1 second during the next
iteration of this loop. */
-
+
skip_sleep = TRUE;
}
@@ -2309,7 +2325,7 @@ loop:
/* Check magic numbers of every allocated mem block once in 10
seconds */
mem_validate_all_blocks();
-#endif
+#endif
/* If there were less than 200 i/os during the 10 second period,
we assume that there is free disk i/o capacity available, and it
makes sense to flush 100 pages. */
@@ -2337,7 +2353,7 @@ loop:
/* We run a full purge every 10 seconds, even if the server
were active */
-
+
n_pages_purged = 1;
last_flush_time = time(NULL);
@@ -2357,11 +2373,11 @@ loop:
if (difftime(current_time, last_flush_time) > 1) {
srv_main_thread_op_info = "flushing log";
- log_buffer_flush_to_disk();
+ log_buffer_flush_to_disk();
last_flush_time = current_time;
}
}
-
+
srv_main_thread_op_info = "flushing buffer pool pages";
/* Flush a few oldest pages to make a new checkpoint younger */
@@ -2372,14 +2388,14 @@ loop:
(> 70 %), we assume we can afford reserving the disk(s) for
the time it requires to flush 100 pages */
- n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100,
+ n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100,
ut_dulint_max);
} else {
- /* Otherwise, we only flush a small number of pages so that
+ /* Otherwise, we only flush a small number of pages so that
we do not unnecessarily use much disk i/o capacity from
other work */
- n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 10,
+ n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 10,
ut_dulint_max);
}
@@ -2392,7 +2408,7 @@ loop:
srv_main_thread_op_info = "reserving kernel mutex";
mutex_enter(&kernel_mutex);
-
+
/* ---- When there is database activity, we jump from here back to
the start of loop */
@@ -2400,7 +2416,7 @@ loop:
mutex_exit(&kernel_mutex);
goto loop;
}
-
+
mutex_exit(&kernel_mutex);
/* If the database is quiet, we enter the background loop */
@@ -2413,24 +2429,24 @@ background_loop:
/* The server has been quiet for a while: start running background
operations */
-
+
srv_main_thread_op_info = "doing background drop tables";
n_tables_to_drop = row_drop_tables_for_mysql_in_background();
if (n_tables_to_drop > 0) {
- /* Do not monopolize the CPU even if there are tables waiting
+ /* Do not monopolize the CPU even if there are tables waiting
in the background drop queue. (It is essentially a bug if
MySQL tries to drop a table while there are still open handles
to it and we had to put it to the background drop queue.) */
os_thread_sleep(100000);
}
-
+
srv_main_thread_op_info = "purging";
/* Run a full purge */
-
+
n_pages_purged = 1;
last_flush_time = time(NULL);
@@ -2449,7 +2465,7 @@ background_loop:
if (difftime(current_time, last_flush_time) > 1) {
srv_main_thread_op_info = "flushing log";
- log_buffer_flush_to_disk();
+ log_buffer_flush_to_disk();
last_flush_time = current_time;
}
}
@@ -2466,9 +2482,9 @@ background_loop:
srv_main_thread_op_info = "doing insert buffer merge";
if (srv_fast_shutdown && srv_shutdown_state > 0) {
- n_bytes_merged = 0;
+ n_bytes_merged = 0;
} else {
- n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20);
+ n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20);
}
srv_main_thread_op_info = "reserving kernel mutex";
@@ -2479,7 +2495,7 @@ background_loop:
goto loop;
}
mutex_exit(&kernel_mutex);
-
+
flush_loop:
srv_main_thread_op_info = "flushing buffer pool pages";
@@ -2501,7 +2517,7 @@ flush_loop:
goto loop;
}
mutex_exit(&kernel_mutex);
-
+
srv_main_thread_op_info = "waiting for buffer pool flush to end";
buf_flush_wait_batch_end(BUF_FLUSH_LIST);
@@ -2517,7 +2533,7 @@ flush_loop:
/* Try to keep the number of modified pages in the
buffer pool under the limit wished by the user */
-
+
goto flush_loop;
}
@@ -2531,7 +2547,7 @@ flush_loop:
mutex_exit(&kernel_mutex);
/*
srv_main_thread_op_info = "archiving log (if log archive is on)";
-
+
log_archive_do(FALSE, &n_bytes_archived);
*/
n_bytes_archived = 0;
@@ -2559,10 +2575,10 @@ flush_loop:
goto background_loop;
}
-
+
/* There is no work for background operations either: suspend
master thread to wait for more server activity */
-
+
suspend_thread:
srv_main_thread_op_info = "suspending";
@@ -2583,10 +2599,10 @@ suspend_thread:
os_event_wait(event);
if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
- /* This is only extra safety, the thread should exit
+ /* This is only extra safety, the thread should exit
already when the event wait ends */
- os_thread_exit(NULL);
+ os_thread_exit(NULL);
}
/* When there is user activity, InnoDB will set the event and the main
@@ -2598,11 +2614,11 @@ suspend_thread:
thread should always use that to exit and not use return() to exit.
The thread actually never comes here because it is exited in an
os_event_wait(). */
-
+
os_thread_exit(NULL);
#ifndef __WIN__
- return(NULL); /* Not reached */
+ return(NULL); /* Not reached */
#else
return(0);
#endif
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index e5151ebf631..c792d600500 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -66,22 +66,22 @@ dulint srv_shutdown_lsn;
ibool srv_have_fullfsync = FALSE;
#endif
-ibool srv_start_raw_disk_in_use = FALSE;
+ibool srv_start_raw_disk_in_use = FALSE;
-static ibool srv_start_has_been_called = FALSE;
+ulint srv_sizeof_trx_t_in_ha_innodb_cc;
-ulint srv_sizeof_trx_t_in_ha_innodb_cc;
-
-ibool srv_startup_is_before_trx_rollback_phase = FALSE;
-ibool srv_is_being_started = FALSE;
-static ibool srv_was_started = FALSE;
+ibool srv_startup_is_before_trx_rollback_phase = FALSE;
+ibool srv_is_being_started = FALSE;
+#ifndef UNIV_HOTBACKUP
+static ibool srv_start_has_been_called = FALSE;
+static ibool srv_was_started = FALSE;
+#endif /* !UNIV_HOTBACKUP */
/* At a shutdown the value first climbs to SRV_SHUTDOWN_CLEANUP
and then to SRV_SHUTDOWN_LAST_PHASE */
ulint srv_shutdown_state = 0;
-ibool measure_cont = FALSE;
-
+#ifndef UNIV_HOTBACKUP
static os_file_t files[1000];
static mutex_t ios_mutex;
@@ -96,8 +96,9 @@ static os_fast_mutex_t srv_os_test_mutex;
/* Name of srv_monitor_file */
static char* srv_monitor_file_name;
+#endif /* !UNIV_HOTBACKUP */
-#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
+#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
#define SRV_MAX_N_PENDING_SYNC_IOS 100
@@ -105,7 +106,7 @@ static char* srv_monitor_file_name;
#ifdef HAVE_purify
static int inno_bcmp(register const char *s1, register const char *s2,
- register uint len)
+ register uint len)
{
while (len-- != 0 && *s1++ == *s2++) ;
return len+1;
@@ -146,7 +147,7 @@ srv_parse_data_file_paths_and_sizes(
*max_auto_extend_size = 0;
input_str = str;
-
+
/* First calculate the number of data files and check syntax:
path:size[M | G];path:size[M | G]... . Note that a Windows path may
contain a drive name and a ':'. */
@@ -155,9 +156,9 @@ srv_parse_data_file_paths_and_sizes(
path = str;
while ((*str != ':' && *str != '\0')
- || (*str == ':'
- && (*(str + 1) == '\\' || *(str + 1) == '/'
- || *(str + 1) == ':'))) {
+ || (*str == ':'
+ && (*(str + 1) == '\\' || *(str + 1) == '/'
+ || *(str + 1) == ':'))) {
str++;
}
@@ -174,17 +175,17 @@ srv_parse_data_file_paths_and_sizes(
if (*str != 'M' && *str != 'G') {
size = size / (1024 * 1024);
} else if (*str == 'G') {
- size = size * 1024;
+ size = size * 1024;
str++;
} else {
- str++;
+ str++;
}
- if (0 == memcmp(str, ":autoextend", (sizeof ":autoextend") - 1)) {
+ if (0 == memcmp(str, ":autoextend", (sizeof ":autoextend") - 1)) {
str += (sizeof ":autoextend") - 1;
- if (0 == memcmp(str, ":max:", (sizeof ":max:") - 1)) {
+ if (0 == memcmp(str, ":max:", (sizeof ":max:") - 1)) {
str += (sizeof ":max:") - 1;
@@ -195,10 +196,10 @@ srv_parse_data_file_paths_and_sizes(
if (*str != 'M' && *str != 'G') {
size = size / (1024 * 1024);
} else if (*str == 'G') {
- size = size * 1024;
+ size = size * 1024;
str++;
} else {
- str++;
+ str++;
}
}
@@ -208,15 +209,15 @@ srv_parse_data_file_paths_and_sizes(
}
}
- if (strlen(str) >= 6
+ if (strlen(str) >= 6
&& *str == 'n'
- && *(str + 1) == 'e'
- && *(str + 2) == 'w') {
- str += 3;
+ && *(str + 1) == 'e'
+ && *(str + 2) == 'w') {
+ str += 3;
}
- if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') {
- str += 3;
+ if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') {
+ str += 3;
}
if (size == 0) {
@@ -233,6 +234,13 @@ srv_parse_data_file_paths_and_sizes(
}
}
+ if (i == 0) {
+ /* If innodb_data_file_path was defined it must contain
+ at least one data file definition */
+
+ return(FALSE);
+ }
+
*data_file_names = (char**)ut_malloc(i * sizeof(void*));
*data_file_sizes = (ulint*)ut_malloc(i * sizeof(ulint));
*data_file_is_raw_partition = (ulint*)ut_malloc(i * sizeof(ulint));
@@ -253,9 +261,9 @@ srv_parse_data_file_paths_and_sizes(
\\.\C::1Gnewraw or \\.\PHYSICALDRIVE2:1Gnewraw */
while ((*str != ':' && *str != '\0')
- || (*str == ':'
- && (*(str + 1) == '\\' || *(str + 1) == '/'
- || *(str + 1) == ':'))) {
+ || (*str == ':'
+ && (*(str + 1) == '\\' || *(str + 1) == '/'
+ || *(str + 1) == ':'))) {
str++;
}
@@ -272,22 +280,22 @@ srv_parse_data_file_paths_and_sizes(
if ((*str != 'M') && (*str != 'G')) {
size = size / (1024 * 1024);
} else if (*str == 'G') {
- size = size * 1024;
+ size = size * 1024;
str++;
} else {
- str++;
+ str++;
}
(*data_file_names)[i] = path;
(*data_file_sizes)[i] = size;
- if (0 == memcmp(str, ":autoextend", (sizeof ":autoextend") - 1)) {
+ if (0 == memcmp(str, ":autoextend", (sizeof ":autoextend") - 1)) {
*is_auto_extending = TRUE;
str += (sizeof ":autoextend") - 1;
- if (0 == memcmp(str, ":max:", (sizeof ":max:") - 1)) {
+ if (0 == memcmp(str, ":max:", (sizeof ":max:") - 1)) {
str += (sizeof ":max:") - 1;
@@ -298,10 +306,10 @@ srv_parse_data_file_paths_and_sizes(
if (*str != 'M' && *str != 'G') {
size = size / (1024 * 1024);
} else if (*str == 'G') {
- size = size * 1024;
+ size = size * 1024;
str++;
} else {
- str++;
+ str++;
}
*max_auto_extend_size = size;
@@ -312,23 +320,23 @@ srv_parse_data_file_paths_and_sizes(
return(FALSE);
}
}
-
+
(*data_file_is_raw_partition)[i] = 0;
- if (strlen(str) >= 6
+ if (strlen(str) >= 6
&& *str == 'n'
- && *(str + 1) == 'e'
- && *(str + 2) == 'w') {
- str += 3;
- (*data_file_is_raw_partition)[i] = SRV_NEW_RAW;
+ && *(str + 1) == 'e'
+ && *(str + 2) == 'w') {
+ str += 3;
+ (*data_file_is_raw_partition)[i] = SRV_NEW_RAW;
}
if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') {
- str += 3;
-
- if ((*data_file_is_raw_partition)[i] == 0) {
- (*data_file_is_raw_partition)[i] = SRV_OLD_RAW;
- }
+ str += 3;
+
+ if ((*data_file_is_raw_partition)[i] == 0) {
+ (*data_file_is_raw_partition)[i] = SRV_OLD_RAW;
+ }
}
i++;
@@ -358,7 +366,7 @@ srv_parse_log_group_home_dirs(
ulint i = 0;
input_str = str;
-
+
/* First calculate the number of directories and check syntax:
path;path;... */
@@ -379,6 +387,13 @@ srv_parse_log_group_home_dirs(
}
}
+ if (i != 1) {
+ /* If innodb_log_group_home_dir was defined it must
+ contain exactly one path definition under current MySQL */
+
+ return(FALSE);
+ }
+
*log_group_home_dirs = (char**) ut_malloc(i * sizeof(void*));
/* Then store the actual values to our array */
@@ -406,6 +421,7 @@ srv_parse_log_group_home_dirs(
return(TRUE);
}
+#ifndef UNIV_HOTBACKUP
/************************************************************************
I/o-handler thread function. */
static
@@ -421,7 +437,7 @@ io_handler_thread(
{
ulint segment;
ulint i;
-
+
segment = *((ulint*)arg);
#ifdef UNIV_DEBUG_THREAD_CREATION
@@ -449,6 +465,7 @@ io_handler_thread(
return(0);
#endif
}
+#endif /* !UNIV_HOTBACKUP */
#ifdef __WIN__
#define SRV_PATH_SEPARATOR '\\'
@@ -474,7 +491,7 @@ srv_normalize_path_for_win(
}
#endif
}
-
+
/*************************************************************************
Adds a slash or a backslash to the end of a string if it is missing
and the string is not empty. */
@@ -502,6 +519,7 @@ srv_add_path_separator_if_needed(
return(out_str);
}
+#ifndef UNIV_HOTBACKUP
/*************************************************************************
Calculates the low 32 bits when a file size which is given as a number
database pages is converted to the number of bytes. */
@@ -530,7 +548,6 @@ srv_calc_high32(
return(file_size >> (32 - UNIV_PAGE_SIZE_SHIFT));
}
-#ifndef UNIV_HOTBACKUP
/*************************************************************************
Creates or opens the log files and closes them. */
static
@@ -538,8 +555,8 @@ ulint
open_or_create_log_file(
/*====================*/
/* out: DB_SUCCESS or error code */
- ibool create_new_db, /* in: TRUE if we should create a
- new database */
+ ibool create_new_db, /* in: TRUE if we should create a
+ new database */
ibool* log_file_created, /* out: TRUE if new log file
created */
ibool log_file_has_been_opened,/* in: TRUE if a log file has been
@@ -570,7 +587,7 @@ open_or_create_log_file(
if (ret == FALSE) {
if (os_file_get_last_error(FALSE) != OS_FILE_ALREADY_EXISTS
#ifdef UNIV_AIX
- /* AIX 5.1 after security patch ML7 may have errno set
+ /* AIX 5.1 after security patch ML7 may have errno set
to 0 here, which causes our function to return 100;
work around that AIX problem */
&& os_file_get_last_error(FALSE) != 100
@@ -578,7 +595,7 @@ open_or_create_log_file(
) {
fprintf(stderr,
"InnoDB: Error in creating or opening %s\n", name);
-
+
return(DB_ERROR);
}
@@ -587,29 +604,29 @@ open_or_create_log_file(
if (!ret) {
fprintf(stderr,
"InnoDB: Error in opening %s\n", name);
-
+
return(DB_ERROR);
}
ret = os_file_get_size(files[i], &size, &size_high);
ut_a(ret);
-
+
if (size != srv_calc_low32(srv_log_file_size)
- || size_high != srv_calc_high32(srv_log_file_size)) {
-
+ || size_high != srv_calc_high32(srv_log_file_size)) {
+
fprintf(stderr,
"InnoDB: Error: log file %s is of different size %lu %lu bytes\n"
"InnoDB: than specified in the .cnf file %lu %lu bytes!\n",
name, (ulong) size_high, (ulong) size,
(ulong) srv_calc_high32(srv_log_file_size),
(ulong) srv_calc_low32(srv_log_file_size));
-
+
return(DB_ERROR);
- }
+ }
} else {
*log_file_created = TRUE;
- ut_print_timestamp(stderr);
+ ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Log file %s did not exist: new to be created\n",
@@ -620,11 +637,11 @@ open_or_create_log_file(
}
fprintf(stderr, "InnoDB: Setting log file %s size to %lu MB\n",
- name, (ulong) srv_log_file_size
+ name, (ulong) srv_log_file_size
>> (20 - UNIV_PAGE_SIZE_SHIFT));
fprintf(stderr,
- "InnoDB: Database physically writes the file full: wait...\n");
+ "InnoDB: Database physically writes the file full: wait...\n");
ret = os_file_set_size(name, files[i],
srv_calc_low32(srv_log_file_size),
@@ -644,7 +661,7 @@ open_or_create_log_file(
if (i == 0) {
/* Create in memory the file space object
which is for this log group */
-
+
fil_space_create(name,
2 * k + SRV_LOG_SPACE_FIRST_ID, FIL_LOG);
}
@@ -661,7 +678,7 @@ open_or_create_log_file(
if (k == 0 && i == 0) {
arch_space_id = 2 * k + 1 + SRV_LOG_SPACE_FIRST_ID;
- fil_space_create("arch_log_space", arch_space_id, FIL_LOG);
+ fil_space_create("arch_log_space", arch_space_id, FIL_LOG);
} else {
arch_space_id = ULINT_UNDEFINED;
}
@@ -713,7 +730,7 @@ open_or_create_data_files(
}
*sum_of_new_sizes = 0;
-
+
*create_new_db = FALSE;
srv_normalize_path_for_win(srv_data_home);
@@ -725,7 +742,7 @@ open_or_create_data_files(
ut_a(strlen(srv_data_home) + strlen(srv_data_file_names[i])
< (sizeof name) - 1);
sprintf(name, "%s%s", srv_data_home, srv_data_file_names[i]);
-
+
if (srv_data_file_is_raw_partition[i] == 0) {
/* First we try to create the file: if it already
@@ -737,10 +754,10 @@ open_or_create_data_files(
if (ret == FALSE && os_file_get_last_error(FALSE) !=
OS_FILE_ALREADY_EXISTS
#ifdef UNIV_AIX
- /* AIX 5.1 after security patch ML7 may have
+ /* AIX 5.1 after security patch ML7 may have
errno set to 0 here, which causes our function
to return 100; work around that AIX problem */
- && os_file_get_last_error(FALSE) != 100
+ && os_file_get_last_error(FALSE) != 100
#endif
) {
fprintf(stderr,
@@ -784,7 +801,7 @@ open_or_create_data_files(
name);
return(DB_ERROR);
}
-
+
if (srv_data_file_is_raw_partition[i] == SRV_OLD_RAW) {
files[i] = os_file_create(
name, OS_FILE_OPEN_RAW, OS_FILE_NORMAL,
@@ -816,20 +833,20 @@ open_or_create_data_files(
ret = os_file_get_size(files[i], &size, &size_high);
ut_a(ret);
/* Round size downward to megabytes */
-
+
rounded_size_pages = (size / (1024 * 1024)
- + 4096 * size_high)
- << (20 - UNIV_PAGE_SIZE_SHIFT);
+ + 4096 * size_high)
+ << (20 - UNIV_PAGE_SIZE_SHIFT);
if (i == srv_n_data_files - 1
- && srv_auto_extend_last_data_file) {
+ && srv_auto_extend_last_data_file) {
if (srv_data_file_sizes[i] >
- rounded_size_pages
- || (srv_last_file_size_max > 0
- && srv_last_file_size_max <
- rounded_size_pages)) {
-
+ rounded_size_pages
+ || (srv_last_file_size_max > 0
+ && srv_last_file_size_max <
+ rounded_size_pages)) {
+
fprintf(stderr,
"InnoDB: Error: auto-extending data file %s is of a different size\n"
"InnoDB: %lu pages (rounded down to MB) than specified in the .cnf file:\n"
@@ -840,19 +857,19 @@ open_or_create_data_files(
return(DB_ERROR);
}
-
+
srv_data_file_sizes[i] = rounded_size_pages;
}
-
+
if (rounded_size_pages != srv_data_file_sizes[i]) {
fprintf(stderr,
"InnoDB: Error: data file %s is of a different size\n"
"InnoDB: %lu pages (rounded down to MB)\n"
"InnoDB: than specified in the .cnf file %lu pages!\n", name,
- (ulong) rounded_size_pages,
- (ulong) srv_data_file_sizes[i]);
-
+ (ulong) rounded_size_pages,
+ (ulong) srv_data_file_sizes[i]);
+
return(DB_ERROR);
}
skip_size_check:
@@ -864,28 +881,28 @@ skip_size_check:
min_flushed_lsn, max_flushed_lsn);
one_opened = TRUE;
} else {
- /* We created the data file and now write it full of
+ /* We created the data file and now write it full of
zeros */
one_created = TRUE;
if (i > 0) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
" InnoDB: Data file %s did not exist: new to be created\n",
name);
} else {
- fprintf(stderr,
- "InnoDB: The first specified data file %s did not exist:\n"
+ fprintf(stderr,
+ "InnoDB: The first specified data file %s did not exist:\n"
"InnoDB: a new database to be created!\n", name);
*create_new_db = TRUE;
}
-
- ut_print_timestamp(stderr);
- fprintf(stderr,
+
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
" InnoDB: Setting file %s size to %lu MB\n",
- name, (ulong) (srv_data_file_sizes[i]
- >> (20 - UNIV_PAGE_SIZE_SHIFT)));
+ name, (ulong) (srv_data_file_sizes[i]
+ >> (20 - UNIV_PAGE_SIZE_SHIFT)));
fprintf(stderr,
"InnoDB: Database physically writes the file full: wait...\n");
@@ -895,7 +912,7 @@ skip_size_check:
srv_calc_high32(srv_data_file_sizes[i]));
if (!ret) {
- fprintf(stderr,
+ fprintf(stderr,
"InnoDB: Error in creating %s: probably out of disk space\n", name);
return(DB_ERROR);
@@ -916,9 +933,9 @@ skip_size_check:
if (srv_data_file_is_raw_partition[i]) {
- fil_node_create(name, srv_data_file_sizes[i], 0, TRUE);
+ fil_node_create(name, srv_data_file_sizes[i], 0, TRUE);
} else {
- fil_node_create(name, srv_data_file_sizes[i], 0,
+ fil_node_create(name, srv_data_file_sizes[i], 0,
FALSE);
}
}
@@ -952,13 +969,13 @@ innobase_start_or_create_for_mysql(void)
ulint min_arch_log_no;
ulint max_arch_log_no;
#endif /* UNIV_LOG_ARCHIVE */
- ulint sum_of_new_sizes;
+ ulint sum_of_new_sizes;
ulint sum_of_data_file_sizes;
ulint tablespace_size_in_header;
ulint err;
ulint i;
ibool srv_file_per_table_original_value = srv_file_per_table;
- mtr_t mtr;
+ mtr_t mtr;
#ifdef HAVE_DARWIN_THREADS
# ifdef F_FULLFSYNC
/* This executable has been compiled on Mac OS X 10.3 or later.
@@ -994,30 +1011,30 @@ innobase_start_or_create_for_mysql(void)
0 */
#ifdef UNIV_DEBUG
fprintf(stderr,
-"InnoDB: !!!!!!!!!!!!!! UNIV_DEBUG switched on !!!!!!!!!!!!!!!\n");
+"InnoDB: !!!!!!!!!!!!!! UNIV_DEBUG switched on !!!!!!!!!!!!!!!\n");
#endif
#ifdef UNIV_SYNC_DEBUG
fprintf(stderr,
-"InnoDB: !!!!!!!!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!!!!!!!\n");
+"InnoDB: !!!!!!!!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!!!!!!!\n");
#endif
#ifdef UNIV_SEARCH_DEBUG
fprintf(stderr,
-"InnoDB: !!!!!!!!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!!!!!!!\n");
+"InnoDB: !!!!!!!!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!!!!!!!\n");
#endif
#ifdef UNIV_MEM_DEBUG
fprintf(stderr,
-"InnoDB: !!!!!!!!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!!!!!!!\n");
+"InnoDB: !!!!!!!!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!!!!!!!\n");
#endif
#ifdef UNIV_SIMULATE_AWE
fprintf(stderr,
"InnoDB: !!!!!!!!!!!!!! UNIV_SIMULATE_AWE switched on !!!!!!!!!!!!!!!!!\n");
#endif
- if (srv_sizeof_trx_t_in_ha_innodb_cc != (ulint)sizeof(trx_t)) {
- fprintf(stderr,
+ if (srv_sizeof_trx_t_in_ha_innodb_cc != (ulint)sizeof(trx_t)) {
+ fprintf(stderr,
"InnoDB: Error: trx_t size is %lu in ha_innodb.cc but %lu in srv0start.c\n"
"InnoDB: Check that pthread_mutex_t is defined in the same way in these\n"
"InnoDB: compilation modules. Cannot continue.\n",
@@ -1032,7 +1049,7 @@ innobase_start_or_create_for_mysql(void)
second time during the process lifetime. */
if (srv_start_has_been_called) {
- fprintf(stderr,
+ 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");
@@ -1046,83 +1063,83 @@ innobase_start_or_create_for_mysql(void)
/* yydebug = TRUE; */
srv_is_being_started = TRUE;
- srv_startup_is_before_trx_rollback_phase = TRUE;
+ srv_startup_is_before_trx_rollback_phase = TRUE;
os_aio_use_native_aio = FALSE;
#if !defined(__WIN2000__) && !defined(UNIV_SIMULATE_AWE)
if (srv_use_awe) {
- fprintf(stderr,
+ fprintf(stderr,
"InnoDB: Error: You have specified innodb_buffer_pool_awe_mem_mb\n"
"InnoDB: in my.cnf, but AWE can only be used in Windows 2000 and later.\n"
"InnoDB: To use AWE, InnoDB must be compiled with __WIN2000__ defined.\n");
- return(DB_ERROR);
+ return(DB_ERROR);
}
#endif
#ifdef __WIN__
if (os_get_os_version() == OS_WIN95
- || os_get_os_version() == OS_WIN31
- || os_get_os_version() == OS_WINNT) {
+ || os_get_os_version() == OS_WIN31
+ || os_get_os_version() == OS_WINNT) {
- /* On Win 95, 98, ME, Win32 subsystem for Windows 3.1,
+ /* On Win 95, 98, ME, Win32 subsystem for Windows 3.1,
and NT use simulated aio. In NT Windows provides async i/o,
but when run in conjunction with InnoDB Hot Backup, it seemed
to corrupt the data files. */
- os_aio_use_native_aio = FALSE;
+ os_aio_use_native_aio = FALSE;
} else {
- /* On Win 2000 and XP use async i/o */
- os_aio_use_native_aio = TRUE;
+ /* On Win 2000 and XP use async i/o */
+ os_aio_use_native_aio = TRUE;
}
-#endif
- if (srv_file_flush_method_str == NULL) {
- /* These are the default options */
+#endif
+ if (srv_file_flush_method_str == NULL) {
+ /* These are the default options */
srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
-#ifndef __WIN__
+#ifndef __WIN__
} else if (0 == ut_strcmp(srv_file_flush_method_str, "fdatasync")) {
- srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
+ srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
} else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DSYNC")) {
- srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
+ srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
} else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
- srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
+ srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
} else if (0 == ut_strcmp(srv_file_flush_method_str, "littlesync")) {
- srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
+ srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
} else if (0 == ut_strcmp(srv_file_flush_method_str, "nosync")) {
- srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
+ srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
#else
} else if (0 == ut_strcmp(srv_file_flush_method_str, "normal")) {
- srv_win_file_flush_method = SRV_WIN_IO_NORMAL;
- os_aio_use_native_aio = FALSE;
+ srv_win_file_flush_method = SRV_WIN_IO_NORMAL;
+ os_aio_use_native_aio = FALSE;
} else if (0 == ut_strcmp(srv_file_flush_method_str, "unbuffered")) {
- srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
- os_aio_use_native_aio = FALSE;
+ srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
+ os_aio_use_native_aio = FALSE;
} else if (0 == ut_strcmp(srv_file_flush_method_str,
"async_unbuffered")) {
- srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
+ srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
#endif
} else {
- fprintf(stderr,
- "InnoDB: Unrecognized value %s for innodb_flush_method\n",
- srv_file_flush_method_str);
- return(DB_ERROR);
+ fprintf(stderr,
+ "InnoDB: Unrecognized value %s for innodb_flush_method\n",
+ srv_file_flush_method_str);
+ return(DB_ERROR);
}
/* Note that the call srv_boot() also changes the values of
srv_pool_size etc. to the units used by InnoDB internally */
- /* Set the maximum number of threads which can wait for a semaphore
- inside InnoDB: this is the 'sync wait array' size, as well as the
+ /* Set the maximum number of threads which can wait for a semaphore
+ inside InnoDB: this is the 'sync wait array' size, as well as the
maximum number of threads that can wait in the 'srv_conc array' for
their time to enter InnoDB. */
@@ -1132,24 +1149,24 @@ innobase_start_or_create_for_mysql(void)
40000 event semaphores.
Comment from Novell, Inc.: also, these just take a lot of memory on
NetWare. */
- srv_max_n_threads = 1000;
+ srv_max_n_threads = 1000;
#else
- if (srv_pool_size >= 1000 * 1024) {
- /* Here we still have srv_pool_size counted
- in kilobytes (in 4.0 this was in bytes)
+ if (srv_pool_size >= 1000 * 1024) {
+ /* Here we still have srv_pool_size counted
+ in kilobytes (in 4.0 this was in bytes)
srv_boot() converts the value to
- pages; if buffer pool is less than 1000 MB,
- assume fewer threads. */
- srv_max_n_threads = 50000;
-
- } else if (srv_pool_size >= 8 * 1024) {
-
- srv_max_n_threads = 10000;
- } else {
- srv_max_n_threads = 1000; /* saves several MB of memory,
- especially in 64-bit
- computers */
- }
+ pages; if buffer pool is less than 1000 MB,
+ assume fewer threads. */
+ srv_max_n_threads = 50000;
+
+ } else if (srv_pool_size >= 8 * 1024) {
+
+ srv_max_n_threads = 10000;
+ } else {
+ srv_max_n_threads = 1000; /* saves several MB of memory,
+ especially in 64-bit
+ computers */
+ }
#endif
err = srv_boot(); /* This changes srv_pool_size to units of a page */
@@ -1180,6 +1197,20 @@ NetWare. */
}
}
+ mutex_create(&srv_dict_tmpfile_mutex);
+ mutex_set_level(&srv_dict_tmpfile_mutex, SYNC_DICT_OPERATION);
+ srv_dict_tmpfile = os_file_create_tmpfile();
+ if (!srv_dict_tmpfile) {
+ return(DB_ERROR);
+ }
+
+ mutex_create(&srv_misc_tmpfile_mutex);
+ mutex_set_level(&srv_misc_tmpfile_mutex, SYNC_ANY_LATCH);
+ srv_misc_tmpfile = os_file_create_tmpfile();
+ if (!srv_misc_tmpfile) {
+ return(DB_ERROR);
+ }
+
/* Restrict the maximum number of file i/o threads */
if (srv_n_file_io_threads > SRV_MAX_N_IO_THREADS) {
@@ -1187,7 +1218,7 @@ NetWare. */
}
if (!os_aio_use_native_aio) {
- /* In simulated aio we currently have use only for 4 threads */
+ /* In simulated aio we currently have use only for 4 threads */
srv_n_file_io_threads = 4;
os_aio_init(8 * SRV_N_PENDING_IOS_PER_THREAD
@@ -1200,7 +1231,7 @@ NetWare. */
srv_n_file_io_threads,
SRV_MAX_N_PENDING_SYNC_IOS);
}
-
+
fil_init(srv_max_n_open_files);
if (srv_use_awe) {
@@ -1211,7 +1242,7 @@ NetWare. */
/* We must disable adaptive hash indexes because they do not
tolerate remapping of pages in AWE */
-
+
srv_use_adaptive_hash_indexes = FALSE;
ret = buf_pool_init(srv_pool_size, srv_pool_size,
srv_awe_window_size);
@@ -1229,7 +1260,7 @@ NetWare. */
fsp_init();
log_init();
-
+
lock_sys_create(srv_lock_table_size);
/* Create i/o-handler threads: */
@@ -1238,7 +1269,7 @@ NetWare. */
n[i] = i;
os_thread_create(io_handler_thread, n + i, thread_ids + i);
- }
+ }
#ifdef UNIV_LOG_ARCHIVE
if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) {
@@ -1258,15 +1289,15 @@ NetWare. */
}
sum_of_new_sizes = 0;
-
+
for (i = 0; i < srv_n_data_files; i++) {
#ifndef __WIN__
if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
- fprintf(stderr,
+ fprintf(stderr,
"InnoDB: Error: file size must be < 4 GB with this MySQL binary\n"
"InnoDB: and operating system combination, in some OS's < 2 GB\n");
- return(DB_ERROR);
+ return(DB_ERROR);
}
#endif
sum_of_new_sizes += srv_data_file_sizes[i];
@@ -1286,7 +1317,7 @@ NetWare. */
&min_flushed_lsn, &max_flushed_lsn,
&sum_of_new_sizes);
if (err != DB_SUCCESS) {
- fprintf(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"
@@ -1302,10 +1333,10 @@ NetWare. */
srv_normalize_path_for_win(srv_arch_dir);
srv_arch_dir = srv_add_path_separator_if_needed(srv_arch_dir);
#endif /* UNIV_LOG_ARCHIVE */
-
+
for (i = 0; i < srv_n_log_files; i++) {
err = open_or_create_log_file(create_new_db, &log_file_created,
- log_opened, 0, i);
+ log_opened, 0, i);
if (err != DB_SUCCESS) {
return((int) err);
@@ -1317,8 +1348,8 @@ NetWare. */
log_opened = TRUE;
}
if ((log_opened && create_new_db)
- || (log_opened && log_created)) {
- fprintf(stderr,
+ || (log_opened && log_created)) {
+ 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"
@@ -1345,7 +1376,7 @@ NetWare. */
|| max_arch_log_no != min_arch_log_no
#endif /* UNIV_LOG_ARCHIVE */
) {
- fprintf(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");
@@ -1354,8 +1385,8 @@ NetWare. */
}
if (ut_dulint_cmp(max_flushed_lsn, ut_dulint_create(0, 1000))
- < 0) {
- fprintf(stderr,
+ < 0) {
+ 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"
@@ -1381,13 +1412,13 @@ NetWare. */
if (create_new_db) {
mtr_start(&mtr);
- fsp_header_init(0, sum_of_new_sizes, &mtr);
+ fsp_header_init(0, sum_of_new_sizes, &mtr);
mtr_commit(&mtr);
trx_sys_create();
dict_create();
- srv_startup_is_before_trx_rollback_phase = FALSE;
+ srv_startup_is_before_trx_rollback_phase = FALSE;
#ifdef UNIV_LOG_ARCHIVE
} else if (srv_archive_recovery) {
@@ -1406,7 +1437,7 @@ NetWare. */
dict_boot();
trx_sys_init_at_db_start();
- srv_startup_is_before_trx_rollback_phase = FALSE;
+ srv_startup_is_before_trx_rollback_phase = FALSE;
/* Initialize the fsp free limit global variable in the log
system */
@@ -1417,7 +1448,7 @@ NetWare. */
} else {
/* We always try to do a recovery, even if the database had
been shut down normally: this is the normal startup path */
-
+
err = recv_recovery_from_checkpoint_start(LOG_CHECKPOINT,
ut_dulint_max,
min_flushed_lsn,
@@ -1450,7 +1481,7 @@ NetWare. */
In a normal startup, we create the space objects for
every table in the InnoDB data dictionary that has
an .ibd file.
-
+
We also determine the maximum tablespace id used.
TODO: We may have incomplete transactions in the
@@ -1461,7 +1492,7 @@ NetWare. */
recv_needed_recovery);
}
- srv_startup_is_before_trx_rollback_phase = FALSE;
+ srv_startup_is_before_trx_rollback_phase = FALSE;
/* Initialize the fsp free limit global variable in the log
system */
@@ -1472,12 +1503,12 @@ NetWare. */
recv_recovery_from_checkpoint_finish();
}
-
+
if (!create_new_db && sum_of_new_sizes > 0) {
/* New data file(s) were added */
mtr_start(&mtr);
- fsp_header_inc_size(0, sum_of_new_sizes, &mtr);
+ fsp_header_inc_size(0, sum_of_new_sizes, &mtr);
mtr_commit(&mtr);
@@ -1510,8 +1541,8 @@ NetWare. */
#endif /* UNIV_LOG_ARCHIVE */
if (srv_measure_contention) {
- /* os_thread_create(&test_measure_cont, NULL, thread_ids +
- SRV_MAX_N_IO_THREADS); */
+ /* os_thread_create(&test_measure_cont, NULL, thread_ids +
+ SRV_MAX_N_IO_THREADS); */
}
/* fprintf(stderr, "Max allowed record size %lu\n",
@@ -1519,28 +1550,28 @@ NetWare. */
/* Create the thread which watches the timeouts for lock waits
and prints InnoDB monitor info */
-
+
os_thread_create(&srv_lock_timeout_and_monitor_thread, NULL,
- thread_ids + 2 + SRV_MAX_N_IO_THREADS);
+ thread_ids + 2 + SRV_MAX_N_IO_THREADS);
/* Create the thread which warns of long semaphore waits */
os_thread_create(&srv_error_monitor_thread, NULL,
- thread_ids + 3 + SRV_MAX_N_IO_THREADS);
+ thread_ids + 3 + SRV_MAX_N_IO_THREADS);
srv_was_started = TRUE;
srv_is_being_started = FALSE;
#ifdef UNIV_DEBUG
- /* Wait a while so that the created threads have time to suspend
+ /* Wait a while so that the created threads have time to suspend
themselves before we switch sync debugging on; otherwise a thread may
execute mutex_enter() before the checks are on, and mutex_exit() after
the checks are on, which will cause an assertion failure in sync
debug. */
- os_thread_sleep(3000000);
+ os_thread_sleep(3000000);
#endif
sync_order_checks_on = TRUE;
- if (trx_doublewrite == NULL) {
+ if (trx_doublewrite == NULL) {
/* Create the doublewrite buffer to a new tablespace */
trx_sys_create_doublewrite_buf();
@@ -1551,7 +1582,7 @@ NetWare. */
if (err != DB_SUCCESS) {
return((int)DB_ERROR);
}
-
+
/* Create the master thread which does purge and other utility
operations */
@@ -1561,7 +1592,7 @@ NetWare. */
/* buf_debug_prints = TRUE; */
#endif /* UNIV_DEBUG */
sum_of_data_file_sizes = 0;
-
+
for (i = 0; i < srv_n_data_files; i++) {
sum_of_data_file_sizes += srv_data_file_sizes[i];
}
@@ -1574,11 +1605,11 @@ NetWare. */
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) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0
- && sum_of_data_file_sizes < tablespace_size_in_header) {
+ && sum_of_data_file_sizes < tablespace_size_in_header) {
/* This is a fatal error, the tail of a tablespace is
missing */
@@ -1599,7 +1630,7 @@ NetWare. */
fprintf(stderr,
"InnoDB: Error: tablespace size stored in header is %lu pages, but\n"
"InnoDB: the sum of data file sizes is only %lu pages\n",
- (ulong) tablespace_size_in_header,
+ (ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0) {
@@ -1619,23 +1650,23 @@ NetWare. */
os_fast_mutex_init(&srv_os_test_mutex);
if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) {
- fprintf(stderr,
+ fprintf(stderr,
"InnoDB: Error: pthread_mutex_trylock returns an unexpected value on\n"
"InnoDB: success! Cannot continue.\n");
- exit(1);
+ exit(1);
}
os_fast_mutex_unlock(&srv_os_test_mutex);
- os_fast_mutex_lock(&srv_os_test_mutex);
+ os_fast_mutex_lock(&srv_os_test_mutex);
os_fast_mutex_unlock(&srv_os_test_mutex);
os_fast_mutex_free(&srv_os_test_mutex);
if (srv_print_verbose_log) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
" InnoDB: Started; log sequence number %lu %lu\n",
(ulong) ut_dulint_get_high(srv_start_lsn),
(ulong) ut_dulint_get_low(srv_start_lsn));
@@ -1658,7 +1689,7 @@ NetWare. */
history list in all cases so that it would become empty
after a full purge. That mean that we may purge 4.0 type
undo log even after this phase.
-
+
The insert buffer record format changed between 4.0 and
4.1.1. It is essential that the insert buffer is emptied
here! */
@@ -1674,14 +1705,14 @@ NetWare. */
"waiting for server activity")) {
ut_a(ibuf_is_empty());
-
+
break;
}
}
fprintf(stderr,
"InnoDB: Full purge and insert buffer merge completed.\n");
- trx_sys_mark_upgraded_to_multiple_tablespaces();
+ trx_sys_mark_upgraded_to_multiple_tablespaces();
fprintf(stderr,
"InnoDB: You have now successfully upgraded to the multiple tablespaces\n"
@@ -1709,23 +1740,23 @@ NetWare. */
Shuts down the InnoDB database. */
int
-innobase_shutdown_for_mysql(void)
+innobase_shutdown_for_mysql(void)
/*=============================*/
/* out: DB_SUCCESS or error code */
{
- ulint i;
+ ulint i;
#ifdef __NETWARE__
extern ibool panic_shutdown;
#endif
- if (!srv_was_started) {
- if (srv_is_being_started) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
+ if (!srv_was_started) {
+ if (srv_is_being_started) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
" InnoDB: Warning: shutting down a not properly started\n"
" InnoDB: or created database!\n");
- }
+ }
- return(DB_SUCCESS);
+ return(DB_SUCCESS);
}
/* 1. Flush the buffer pool to disk, write the current lsn to
@@ -1735,7 +1766,7 @@ innobase_shutdown_for_mysql(void)
if (srv_fast_shutdown == 2) {
- ut_print_timestamp(stderr);
+ ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: MySQL has requested a very fast shutdown without flushing "
"the InnoDB buffer pool to data files. At the next mysqld startup "
@@ -1744,7 +1775,7 @@ innobase_shutdown_for_mysql(void)
#ifdef __NETWARE__
if(!panic_shutdown)
-#endif
+#endif
logs_empty_and_mark_files_at_shutdown();
if (srv_conc_n_threads != 0) {
@@ -1758,9 +1789,9 @@ innobase_shutdown_for_mysql(void)
srv_shutdown_state = SRV_SHUTDOWN_EXIT_THREADS;
- /* In a 'very fast' shutdown, we do not need to wait for these threads
- to die; all which counts is that we flushed the log; a 'very fast'
- shutdown is essentially a crash. */
+ /* In a 'very fast' shutdown, we do not need to wait for these threads
+ to die; all which counts is that we flushed the log; a 'very fast'
+ shutdown is essentially a crash. */
if (srv_fast_shutdown == 2) {
return(DB_SUCCESS);
@@ -1771,11 +1802,11 @@ innobase_shutdown_for_mysql(void)
os_thread_event_wait(). */
for (i = 0; i < 1000; i++) {
- /* NOTE: IF YOU CREATE THREADS IN INNODB, YOU MUST EXIT THEM
- HERE OR EARLIER */
-
+ /* NOTE: IF YOU CREATE THREADS IN INNODB, YOU MUST EXIT THEM
+ HERE OR EARLIER */
+
/* a. Let the lock timeout thread exit */
- os_event_set(srv_lock_timeout_thread_event);
+ os_event_set(srv_lock_timeout_thread_event);
/* b. srv error monitor thread exits automatically, no need
to do anything here */
@@ -1790,7 +1821,7 @@ innobase_shutdown_for_mysql(void)
os_mutex_enter(os_sync_mutex);
if (os_thread_count == 0) {
- /* All the threads have exited or are just exiting;
+ /* All the threads have exited or are just exiting;
NOTE that the threads may not have completed their
exit yet. Should we use pthread_join() to make sure
they have exited? Now we just sleep 0.1 seconds and
@@ -1809,9 +1840,9 @@ innobase_shutdown_for_mysql(void)
}
if (i == 1000) {
- fprintf(stderr,
+ fprintf(stderr,
"InnoDB: Warning: %lu threads created by InnoDB had not exited at shutdown!\n",
- (ulong) os_thread_count);
+ (ulong) os_thread_count);
}
if (srv_monitor_file) {
@@ -1822,8 +1853,19 @@ innobase_shutdown_for_mysql(void)
mem_free(srv_monitor_file_name);
}
}
-
+ if (srv_dict_tmpfile) {
+ fclose(srv_dict_tmpfile);
+ srv_dict_tmpfile = 0;
+ }
+
+ if (srv_misc_tmpfile) {
+ fclose(srv_misc_tmpfile);
+ srv_misc_tmpfile = 0;
+ }
+
mutex_free(&srv_monitor_file_mutex);
+ mutex_free(&srv_dict_tmpfile_mutex);
+ mutex_free(&srv_misc_tmpfile_mutex);
/* 3. Free all InnoDB's own mutexes and the os_fast_mutexes inside
them */
@@ -1838,7 +1880,7 @@ innobase_shutdown_for_mysql(void)
by a purge. */
if (UT_LIST_GET_LEN(trx_sys->view_list) > 1) {
- fprintf(stderr,
+ fprintf(stderr,
"InnoDB: Error: all read views were not closed before shutdown:\n"
"InnoDB: %lu read views open \n",
UT_LIST_GET_LEN(trx_sys->view_list) - 1);
@@ -1850,10 +1892,10 @@ innobase_shutdown_for_mysql(void)
ut_free_all_mem();
if (os_thread_count != 0
- || os_event_count != 0
- || os_mutex_count != 0
- || os_fast_mutex_count != 0) {
- fprintf(stderr,
+ || os_event_count != 0
+ || os_mutex_count != 0
+ || os_fast_mutex_count != 0) {
+ fprintf(stderr,
"InnoDB: Warning: some resources were not cleaned up in shutdown:\n"
"InnoDB: threads %lu, events %lu, os_mutexes %lu, os_fast_mutexes %lu\n",
(ulong) os_thread_count, (ulong) os_event_count,
@@ -1868,11 +1910,11 @@ innobase_shutdown_for_mysql(void)
}
if (srv_print_verbose_log) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
" InnoDB: Shutdown completed; log sequence number %lu %lu\n",
- (ulong) ut_dulint_get_high(srv_shutdown_lsn),
- (ulong) ut_dulint_get_low(srv_shutdown_lsn));
+ (ulong) ut_dulint_get_high(srv_shutdown_lsn),
+ (ulong) ut_dulint_get_low(srv_shutdown_lsn));
}
return((int) DB_SUCCESS);