mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Applying InnoDB snapshot
Detailed revision comments: r6348 | marko | 2009-12-22 11:04:34 +0200 (Tue, 22 Dec 2009) | 37 lines branches/zip: Merge a change from MySQL: r6351 | marko | 2009-12-22 11:11:18 +0200 (Tue, 22 Dec 2009) | 1 line branches/zip: Remove an obsolete declaration of LOCK_thread_count. r6352 | marko | 2009-12-22 12:33:01 +0200 (Tue, 22 Dec 2009) | 104 lines branches/zip: Merge revisions 6206:6350 from branches/5.1, except r6347, r6349, r6350 which were committed separately to both branches, and r6310, which was backported from zip to 5.1. ------------------------------------------------------------------------ r6206 | jyang | 2009-11-20 09:38:43 +0200 (Fri, 20 Nov 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Non-functional change, fix formatting. ------------------------------------------------------------------------ r6230 | sunny | 2009-11-24 23:52:43 +0200 (Tue, 24 Nov 2009) | 3 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result branches/5.1: Fix autoinc failing test results. (this should be skipped when merging 5.1 into zip) ------------------------------------------------------------------------ r6231 | sunny | 2009-11-25 10:26:27 +0200 (Wed, 25 Nov 2009) | 7 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0sel.c branches/5.1: Fix BUG#49032 - auto_increment field does not initialize to last value in InnoDB Storage Engine. We use the appropriate function to read the column value for non-integer autoinc column types, namely float and double. rb://208. Approved by Marko. ------------------------------------------------------------------------ r6232 | sunny | 2009-11-25 10:27:39 +0200 (Wed, 25 Nov 2009) | 2 lines Changed paths: M /branches/5.1/row/row0sel.c branches/5.1: This is an interim fix, fix white space errors. ------------------------------------------------------------------------ r6233 | sunny | 2009-11-25 10:28:35 +0200 (Wed, 25 Nov 2009) | 2 lines Changed paths: M /branches/5.1/include/mach0data.h M /branches/5.1/include/mach0data.ic M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0sel.c branches/5.1: This is an interim fix, fix tests and make read float/double arg const. ------------------------------------------------------------------------ r6234 | sunny | 2009-11-25 10:29:03 +0200 (Wed, 25 Nov 2009) | 2 lines Changed paths: M /branches/5.1/row/row0sel.c branches/5.1: This is an interim fix, fix whitepsace issues. ------------------------------------------------------------------------ r6235 | sunny | 2009-11-26 01:14:42 +0200 (Thu, 26 Nov 2009) | 9 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Fix Bug#47720 - REPLACE INTO Autoincrement column with negative values. This bug is similiar to the negative autoinc filter patch from earlier, with the additional handling of filtering out the negative column values set explicitly by the user. rb://184 Approved by Heikki. ------------------------------------------------------------------------ r6242 | vasil | 2009-11-27 22:07:12 +0200 (Fri, 27 Nov 2009) | 4 lines Changed paths: M /branches/5.1/export.sh branches/5.1: Minor changes to support plugin snapshots. ------------------------------------------------------------------------ r6306 | calvin | 2009-12-14 15:12:46 +0200 (Mon, 14 Dec 2009) | 5 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: fix bug#49267: innodb-autoinc.test fails on windows because of different case mode There is no change to the InnoDB code, only to fix test case by changing "T1" to "t1". ------------------------------------------------------------------------ r6324 | jyang | 2009-12-17 06:54:24 +0200 (Thu, 17 Dec 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/lock0lock.h M /branches/5.1/include/srv0srv.h M /branches/5.1/lock/lock0lock.c M /branches/5.1/log/log0log.c M /branches/5.1/srv/srv0srv.c M /branches/5.1/srv/srv0start.c branches/5.1: Fix bug #47814 - Diagnostics are frequently not printed after a long lock wait in InnoDB. Separate out the lock wait timeout check thread from monitor information printing thread. rb://200 Approved by Marko. ------------------------------------------------------------------------ r6364 | marko | 2009-12-26 21:06:31 +0200 (Sat, 26 Dec 2009) | 4 lines branches/zip: ibuf_bitmap_get_map_page(): Define a wrapper macro that passes __FILE__, __LINE__ of the caller to buf_page_get_gen(). This will ease the diagnosis of the likes of Issue #135.
This commit is contained in:
@@ -119,7 +119,8 @@ UNIV_INTERN ulint srv_fatal_semaphore_wait_threshold = 600;
|
||||
in microseconds, in order to reduce the lagging of the purge thread. */
|
||||
UNIV_INTERN ulint srv_dml_needed_delay = 0;
|
||||
|
||||
UNIV_INTERN ibool srv_lock_timeout_and_monitor_active = FALSE;
|
||||
UNIV_INTERN ibool srv_lock_timeout_active = FALSE;
|
||||
UNIV_INTERN ibool srv_monitor_active = FALSE;
|
||||
UNIV_INTERN ibool srv_error_monitor_active = FALSE;
|
||||
|
||||
UNIV_INTERN const char* srv_main_thread_op_info = "";
|
||||
@@ -188,7 +189,17 @@ UNIV_INTERN ulong srv_flush_log_at_trx_commit = 1;
|
||||
the checkpoints. */
|
||||
UNIV_INTERN char srv_adaptive_flushing = TRUE;
|
||||
|
||||
/* The sort order table of the MySQL latin1_swedish_ci character set
|
||||
/** Maximum number of times allowed to conditionally acquire
|
||||
mutex before switching to blocking wait on the mutex */
|
||||
#define MAX_MUTEX_NOWAIT 20
|
||||
|
||||
/** Check whether the number of failed nonblocking mutex
|
||||
acquisition attempts exceeds maximum allowed value. If so,
|
||||
srv_printf_innodb_monitor() will request mutex acquisition
|
||||
with mutex_enter(), which will wait until it gets the mutex. */
|
||||
#define MUTEX_NOWAIT(mutex_skipped) ((mutex_skipped) < MAX_MUTEX_NOWAIT)
|
||||
|
||||
/** The sort order table of the MySQL latin1_swedish_ci character set
|
||||
collation */
|
||||
UNIV_INTERN const byte* srv_latin1_ordering;
|
||||
|
||||
@@ -1683,12 +1694,15 @@ srv_refresh_innodb_monitor_stats(void)
|
||||
}
|
||||
|
||||
/******************************************************************//**
|
||||
Outputs to a file the output of the InnoDB Monitor. */
|
||||
Outputs to a file the output of the InnoDB Monitor.
|
||||
@return FALSE if not all information printed
|
||||
due to failure to obtain necessary mutex */
|
||||
UNIV_INTERN
|
||||
void
|
||||
ibool
|
||||
srv_printf_innodb_monitor(
|
||||
/*======================*/
|
||||
FILE* file, /*!< in: output stream */
|
||||
ibool nowait, /*!< in: whether to wait for kernel mutex */
|
||||
ulint* trx_start, /*!< out: file position of the start of
|
||||
the list of active transactions */
|
||||
ulint* trx_end) /*!< out: file position of the end of
|
||||
@@ -1697,6 +1711,7 @@ srv_printf_innodb_monitor(
|
||||
double time_elapsed;
|
||||
time_t current_time;
|
||||
ulint n_reserved;
|
||||
ibool ret;
|
||||
|
||||
mutex_enter(&srv_innodb_monitor_mutex);
|
||||
|
||||
@@ -1746,24 +1761,31 @@ srv_printf_innodb_monitor(
|
||||
|
||||
mutex_exit(&dict_foreign_err_mutex);
|
||||
|
||||
lock_print_info_summary(file);
|
||||
if (trx_start) {
|
||||
long t = ftell(file);
|
||||
if (t < 0) {
|
||||
*trx_start = ULINT_UNDEFINED;
|
||||
} else {
|
||||
*trx_start = (ulint) t;
|
||||
}
|
||||
}
|
||||
lock_print_info_all_transactions(file);
|
||||
if (trx_end) {
|
||||
long t = ftell(file);
|
||||
if (t < 0) {
|
||||
*trx_end = ULINT_UNDEFINED;
|
||||
} else {
|
||||
*trx_end = (ulint) t;
|
||||
/* Only if lock_print_info_summary proceeds correctly,
|
||||
before we call the lock_print_info_all_transactions
|
||||
to print all the lock information. */
|
||||
ret = lock_print_info_summary(file, nowait);
|
||||
|
||||
if (ret) {
|
||||
if (trx_start) {
|
||||
long t = ftell(file);
|
||||
if (t < 0) {
|
||||
*trx_start = ULINT_UNDEFINED;
|
||||
} else {
|
||||
*trx_start = (ulint) t;
|
||||
}
|
||||
}
|
||||
lock_print_info_all_transactions(file);
|
||||
if (trx_end) {
|
||||
long t = ftell(file);
|
||||
if (t < 0) {
|
||||
*trx_end = ULINT_UNDEFINED;
|
||||
} else {
|
||||
*trx_end = (ulint) t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fputs("--------\n"
|
||||
"FILE I/O\n"
|
||||
"--------\n", file);
|
||||
@@ -1861,6 +1883,8 @@ srv_printf_innodb_monitor(
|
||||
"============================\n", file);
|
||||
mutex_exit(&srv_innodb_monitor_mutex);
|
||||
fflush(file);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/******************************************************************//**
|
||||
@@ -1948,26 +1972,23 @@ srv_export_innodb_status(void)
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
A thread which wakes up threads whose lock wait may have lasted too long.
|
||||
This also prints the info output by various InnoDB monitors.
|
||||
A thread which prints the info output by various InnoDB monitors.
|
||||
@return a dummy parameter */
|
||||
UNIV_INTERN
|
||||
os_thread_ret_t
|
||||
srv_lock_timeout_and_monitor_thread(
|
||||
/*================================*/
|
||||
srv_monitor_thread(
|
||||
/*===============*/
|
||||
void* arg __attribute__((unused)))
|
||||
/*!< in: a dummy parameter required by
|
||||
os_thread_create */
|
||||
{
|
||||
srv_slot_t* slot;
|
||||
double time_elapsed;
|
||||
time_t current_time;
|
||||
time_t last_table_monitor_time;
|
||||
time_t last_tablespace_monitor_time;
|
||||
time_t last_monitor_time;
|
||||
ibool some_waits;
|
||||
double wait_time;
|
||||
ulint i;
|
||||
ulint mutex_skipped;
|
||||
ibool last_srv_print_monitor;
|
||||
|
||||
#ifdef UNIV_DEBUG_THREAD_CREATION
|
||||
fprintf(stderr, "Lock timeout thread starts, id %lu\n",
|
||||
@@ -1978,13 +1999,15 @@ srv_lock_timeout_and_monitor_thread(
|
||||
last_table_monitor_time = time(NULL);
|
||||
last_tablespace_monitor_time = time(NULL);
|
||||
last_monitor_time = time(NULL);
|
||||
mutex_skipped = 0;
|
||||
last_srv_print_monitor = srv_print_innodb_monitor;
|
||||
loop:
|
||||
srv_lock_timeout_and_monitor_active = TRUE;
|
||||
srv_monitor_active = TRUE;
|
||||
|
||||
/* When someone is waiting for a lock, we wake up every second
|
||||
and check if a timeout has passed for a lock wait */
|
||||
/* Wake up every 5 seconds to see if we need to print
|
||||
monitor information. */
|
||||
|
||||
os_thread_sleep(1000000);
|
||||
os_thread_sleep(5000000);
|
||||
|
||||
current_time = time(NULL);
|
||||
|
||||
@@ -1994,14 +2017,40 @@ loop:
|
||||
last_monitor_time = time(NULL);
|
||||
|
||||
if (srv_print_innodb_monitor) {
|
||||
srv_printf_innodb_monitor(stderr, NULL, NULL);
|
||||
/* Reset mutex_skipped counter everytime
|
||||
srv_print_innodb_monitor changes. This is to
|
||||
ensure we will not be blocked by kernel_mutex
|
||||
for short duration information printing,
|
||||
such as requested by sync_array_print_long_waits() */
|
||||
if (!last_srv_print_monitor) {
|
||||
mutex_skipped = 0;
|
||||
last_srv_print_monitor = TRUE;
|
||||
}
|
||||
|
||||
if (!srv_printf_innodb_monitor(stderr,
|
||||
MUTEX_NOWAIT(mutex_skipped),
|
||||
NULL, NULL)) {
|
||||
mutex_skipped++;
|
||||
} else {
|
||||
/* Reset the counter */
|
||||
mutex_skipped = 0;
|
||||
}
|
||||
} else {
|
||||
last_srv_print_monitor = FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (srv_innodb_status) {
|
||||
mutex_enter(&srv_monitor_file_mutex);
|
||||
rewind(srv_monitor_file);
|
||||
srv_printf_innodb_monitor(srv_monitor_file, NULL,
|
||||
NULL);
|
||||
if (!srv_printf_innodb_monitor(srv_monitor_file,
|
||||
MUTEX_NOWAIT(mutex_skipped),
|
||||
NULL, NULL)) {
|
||||
mutex_skipped++;
|
||||
} else {
|
||||
mutex_skipped = 0;
|
||||
}
|
||||
|
||||
os_file_set_eof(srv_monitor_file);
|
||||
mutex_exit(&srv_monitor_file_mutex);
|
||||
}
|
||||
@@ -2054,6 +2103,56 @@ loop:
|
||||
}
|
||||
}
|
||||
|
||||
if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
|
||||
goto exit_func;
|
||||
}
|
||||
|
||||
if (srv_print_innodb_monitor
|
||||
|| srv_print_innodb_lock_monitor
|
||||
|| srv_print_innodb_tablespace_monitor
|
||||
|| srv_print_innodb_table_monitor) {
|
||||
goto loop;
|
||||
}
|
||||
|
||||
srv_monitor_active = FALSE;
|
||||
|
||||
goto loop;
|
||||
|
||||
exit_func:
|
||||
srv_monitor_active = FALSE;
|
||||
|
||||
/* We count the number of threads in os_thread_exit(). A created
|
||||
thread should always use that to exit and not use return() to exit. */
|
||||
|
||||
os_thread_exit(NULL);
|
||||
|
||||
OS_THREAD_DUMMY_RETURN;
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
A thread which wakes up threads whose lock wait may have lasted too long.
|
||||
@return a dummy parameter */
|
||||
UNIV_INTERN
|
||||
os_thread_ret_t
|
||||
srv_lock_timeout_thread(
|
||||
/*====================*/
|
||||
void* arg __attribute__((unused)))
|
||||
/* in: a dummy parameter required by
|
||||
os_thread_create */
|
||||
{
|
||||
srv_slot_t* slot;
|
||||
ibool some_waits;
|
||||
double wait_time;
|
||||
ulint i;
|
||||
|
||||
loop:
|
||||
/* When someone is waiting for a lock, we wake up every second
|
||||
and check if a timeout has passed for a lock wait */
|
||||
|
||||
os_thread_sleep(1000000);
|
||||
|
||||
srv_lock_timeout_active = TRUE;
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
|
||||
some_waits = FALSE;
|
||||
@@ -2104,17 +2203,11 @@ loop:
|
||||
goto exit_func;
|
||||
}
|
||||
|
||||
if (some_waits || srv_print_innodb_monitor
|
||||
|| srv_print_innodb_lock_monitor
|
||||
|| srv_print_innodb_tablespace_monitor
|
||||
|| srv_print_innodb_table_monitor) {
|
||||
if (some_waits) {
|
||||
goto loop;
|
||||
}
|
||||
|
||||
/* No one was waiting for a lock and no monitor was active:
|
||||
suspend this thread */
|
||||
|
||||
srv_lock_timeout_and_monitor_active = FALSE;
|
||||
srv_lock_timeout_active = FALSE;
|
||||
|
||||
#if 0
|
||||
/* The following synchronisation is disabled, since
|
||||
@@ -2124,7 +2217,7 @@ loop:
|
||||
goto loop;
|
||||
|
||||
exit_func:
|
||||
srv_lock_timeout_and_monitor_active = FALSE;
|
||||
srv_lock_timeout_active = FALSE;
|
||||
|
||||
/* We count the number of threads in os_thread_exit(). A created
|
||||
thread should always use that to exit and not use return() to exit. */
|
||||
|
Reference in New Issue
Block a user