From 413cadc7e83ea5bfb2aa0a31983fdb66c50e2959 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Sun, 3 Jul 2011 19:54:48 +0000 Subject: [PATCH] - rel 3; percona fixes Changed files: innodb_bug60788.patch -> 1.2 innodb_extend_slow.patch -> 1.7 innodb_fix_misc.patch -> 1.8 innodb_io_patches.patch -> 1.6 innodb_pass_corrupt_table.patch -> 1.8 innodb_recovery_patches.patch -> 1.7 innodb_separate_doublewrite.patch -> 1.8 mysql.spec -> 1.553 --- innodb_bug60788.patch | 16 +- innodb_extend_slow.patch | 24 +-- innodb_fix_misc.patch | 30 +-- innodb_io_patches.patch | 324 +++++++++++++++++++++++++++++- innodb_pass_corrupt_table.patch | 4 +- innodb_recovery_patches.patch | 2 +- innodb_separate_doublewrite.patch | 6 +- mysql.spec | 2 +- 8 files changed, 362 insertions(+), 46 deletions(-) diff --git a/innodb_bug60788.patch b/innodb_bug60788.patch index d1e2cc4..21e9b10 100644 --- a/innodb_bug60788.patch +++ b/innodb_bug60788.patch @@ -10,7 +10,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c --- a/storage/innobase/os/os0file.c 2011-04-20 12:09:57.000000000 +0400 +++ b/storage/innobase/os/os0file.c 2011-04-20 12:10:04.000000000 +0400 -@@ -2083,6 +2083,9 @@ +@@ -2092,6 +2092,9 @@ failures++; retry = TRUE; @@ -20,7 +20,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c } else { retry = FALSE; -@@ -2212,6 +2215,7 @@ +@@ -2222,6 +2225,7 @@ off_t offs; #if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD) ssize_t n_bytes; @@ -28,7 +28,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c #endif /* HAVE_PREAD && !HAVE_BROKEN_PREAD */ ulint sec; ulint ms; -@@ -2252,7 +2256,18 @@ +@@ -2262,7 +2266,18 @@ os_n_pending_reads++; os_mutex_exit(os_file_count_mutex); @@ -48,7 +48,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c os_mutex_enter(os_file_count_mutex); os_file_n_pending_preads--; -@@ -2271,6 +2286,7 @@ +@@ -2281,6 +2296,7 @@ { off_t ret_offset; ssize_t ret; @@ -56,7 +56,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c #ifndef UNIV_HOTBACKUP ulint i; #endif /* !UNIV_HOTBACKUP */ -@@ -2291,7 +2307,17 @@ +@@ -2301,7 +2317,17 @@ if (ret_offset < 0) { ret = -1; } else { @@ -75,7 +75,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c } #ifndef UNIV_HOTBACKUP -@@ -2330,6 +2356,7 @@ +@@ -2340,6 +2366,7 @@ offset */ { ssize_t ret; @@ -83,7 +83,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c off_t offs; ut_a((offset & 0xFFFFFFFFUL) == offset); -@@ -2357,7 +2384,18 @@ +@@ -2367,7 +2394,18 @@ os_n_pending_writes++; os_mutex_exit(os_file_count_mutex); @@ -103,7 +103,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c os_mutex_enter(os_file_count_mutex); os_file_n_pending_pwrites--; -@@ -2404,7 +2442,17 @@ +@@ -2414,7 +2452,17 @@ goto func_exit; } diff --git a/innodb_extend_slow.patch b/innodb_extend_slow.patch index e7ca2ae..a7c84ac 100644 --- a/innodb_extend_slow.patch +++ b/innodb_extend_slow.patch @@ -578,7 +578,7 @@ diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0fil const char* src_file,/*!< in: file name where func invoked */ ulint src_line);/*!< in: line where the func invoked */ /*******************************************************************//** -@@ -887,7 +897,8 @@ +@@ -889,7 +899,8 @@ offset where to read */ ulint offset_high,/*!< in: most significant 32 bits of offset */ @@ -588,7 +588,7 @@ diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0fil /*******************************************************************//** Rewind file to its start, read at most size - 1 bytes from it to str, and NUL-terminate str. All errors are silently ignored. This function is -@@ -1046,10 +1057,11 @@ +@@ -1048,10 +1059,11 @@ (can be used to identify a completed aio operation); ignored if mode is OS_AIO_SYNC */ @@ -727,7 +727,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c #include "log0recv.h" #ifndef UNIV_HOTBACKUP # include "os0sync.h" -@@ -2202,13 +2204,18 @@ +@@ -2212,13 +2214,18 @@ ulint n, /*!< in: number of bytes to read */ ulint offset, /*!< in: least significant 32 bits of file offset from where to read */ @@ -747,7 +747,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c ut_a((offset & 0xFFFFFFFFUL) == offset); -@@ -2229,6 +2236,15 @@ +@@ -2239,6 +2246,15 @@ os_n_file_reads++; @@ -763,7 +763,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c #if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD) os_mutex_enter(os_file_count_mutex); os_file_n_pending_preads++; -@@ -2242,6 +2258,13 @@ +@@ -2252,6 +2268,13 @@ os_n_pending_reads--; os_mutex_exit(os_file_count_mutex); @@ -777,7 +777,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c return(n_bytes); #else { -@@ -2278,6 +2301,13 @@ +@@ -2288,6 +2311,13 @@ os_n_pending_reads--; os_mutex_exit(os_file_count_mutex); @@ -791,7 +791,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c return(ret); } #endif -@@ -2418,7 +2448,8 @@ +@@ -2428,7 +2458,8 @@ offset where to read */ ulint offset_high, /*!< in: most significant 32 bits of offset */ @@ -801,7 +801,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c { #ifdef __WIN__ BOOL ret; -@@ -2493,7 +2524,7 @@ +@@ -2503,7 +2534,7 @@ os_bytes_read_since_printout += n; try_again: @@ -810,7 +810,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c if ((ulint)ret == n) { -@@ -2622,7 +2653,7 @@ +@@ -2632,7 +2663,7 @@ os_bytes_read_since_printout += n; try_again: @@ -819,7 +819,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c if ((ulint)ret == n) { -@@ -4016,10 +4047,11 @@ +@@ -4026,10 +4057,11 @@ (can be used to identify a completed aio operation); ignored if mode is OS_AIO_SYNC */ @@ -832,7 +832,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c { os_aio_array_t* array; os_aio_slot_t* slot; -@@ -4060,8 +4092,8 @@ +@@ -4070,8 +4102,8 @@ wait in the Windows case. */ if (type == OS_FILE_READ) { @@ -843,7 +843,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c } ut_a(type == OS_FILE_WRITE); -@@ -4101,6 +4133,11 @@ +@@ -4111,6 +4143,11 @@ array = NULL; /* Eliminate compiler warning */ } diff --git a/innodb_fix_misc.patch b/innodb_fix_misc.patch index a9e6539..1e931a1 100644 --- a/innodb_fix_misc.patch +++ b/innodb_fix_misc.patch @@ -204,7 +204,7 @@ diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c mutex_exit(&fil_system->mutex); + mutex_exit(&fil_system->file_extend_mutex); - fil_flush(space_id); + fil_flush(space_id, TRUE); @@ -5182,6 +5199,22 @@ srv_data_written+= len; @@ -407,7 +407,7 @@ diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0fil trx_t* trx, const char* src_file,/*!< in: file name where func invoked */ ulint src_line);/*!< in: line where the func invoked */ -@@ -1063,6 +1064,7 @@ +@@ -1065,6 +1066,7 @@ (can be used to identify a completed aio operation); ignored if mode is OS_AIO_SYNC */ @@ -415,7 +415,7 @@ diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0fil trx_t* trx); /************************************************************************//** Wakes up all async i/o threads so that they know to exit themselves in -@@ -1123,7 +1125,8 @@ +@@ -1125,7 +1127,8 @@ parameters are valid and can be used to restart the operation, for example */ void** message2, @@ -425,7 +425,7 @@ diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0fil #endif /**********************************************************************//** -@@ -1145,7 +1148,8 @@ +@@ -1147,7 +1150,8 @@ parameters are valid and can be used to restart the operation, for example */ void** message2, @@ -435,7 +435,7 @@ diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0fil /**********************************************************************//** Validates the consistency of the aio system. @return TRUE if ok */ -@@ -1224,7 +1228,8 @@ +@@ -1226,7 +1230,8 @@ aio operation failed, these output parameters are valid and can be used to restart the operation. */ @@ -524,7 +524,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c fil_node_t* message1; /*!< message which is given by the */ void* message2; /*!< the requester of an aio operation and which can be used to identify -@@ -3675,7 +3676,8 @@ +@@ -3685,7 +3686,8 @@ offset */ ulint offset_high, /*!< in: most significant 32 bits of offset */ @@ -534,7 +534,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c { os_aio_slot_t* slot = NULL; #ifdef WIN_ASYNC_IO -@@ -3764,6 +3766,7 @@ +@@ -3774,6 +3776,7 @@ slot->offset = offset; slot->offset_high = offset_high; slot->io_already_done = FALSE; @@ -542,7 +542,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c #ifdef WIN_ASYNC_IO control = &(slot->control); -@@ -4051,6 +4054,7 @@ +@@ -4061,6 +4064,7 @@ (can be used to identify a completed aio operation); ignored if mode is OS_AIO_SYNC */ @@ -550,7 +550,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c trx_t* trx) { os_aio_array_t* array; -@@ -4139,7 +4143,7 @@ +@@ -4149,7 +4153,7 @@ trx->io_read += n; } slot = os_aio_array_reserve_slot(type, array, message1, message2, file, @@ -559,7 +559,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c if (type == OS_FILE_READ) { if (srv_use_native_aio) { os_n_file_reads++; -@@ -4258,7 +4262,8 @@ +@@ -4268,7 +4272,8 @@ parameters are valid and can be used to restart the operation, for example */ void** message2, @@ -569,7 +569,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c { ulint orig_seg = segment; os_aio_array_t* array; -@@ -4337,6 +4342,7 @@ +@@ -4347,6 +4352,7 @@ *message2 = slot->message2; *type = slot->type; @@ -577,7 +577,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c if (ret && len == slot->len) { ret_val = TRUE; -@@ -4565,7 +4571,8 @@ +@@ -4575,7 +4581,8 @@ aio operation failed, these output parameters are valid and can be used to restart the operation. */ @@ -587,7 +587,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c { ulint segment; os_aio_array_t* array; -@@ -4638,6 +4645,7 @@ +@@ -4648,6 +4655,7 @@ *message2 = slot->message2; *type = slot->type; @@ -595,7 +595,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c if ((slot->ret == 0) && (slot->n_bytes == (long)slot->len)) { ret = TRUE; -@@ -4691,7 +4699,8 @@ +@@ -4701,7 +4709,8 @@ parameters are valid and can be used to restart the operation, for example */ void** message2, @@ -605,7 +605,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c { os_aio_array_t* array; ulint segment; -@@ -4987,6 +4996,7 @@ +@@ -4997,6 +5006,7 @@ *message2 = slot->message2; *type = slot->type; diff --git a/innodb_io_patches.patch b/innodb_io_patches.patch index c81c909..716ea8e 100644 --- a/innodb_io_patches.patch +++ b/innodb_io_patches.patch @@ -27,6 +27,15 @@ diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c diff -ruN a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c --- a/storage/innobase/buf/buf0flu.c 2010-11-03 07:01:13.000000000 +0900 +++ b/storage/innobase/buf/buf0flu.c 2010-12-03 15:10:08.934990091 +0900 +@@ -855,7 +855,7 @@ + flush: + /* Now flush the doublewrite buffer data to disk */ + +- fil_flush(TRX_SYS_SPACE); ++ fil_flush(TRX_SYS_SPACE, FALSE); + + /* We know that the writes have been flushed to disk now + and in recovery we will find them in the doublewrite buffer @@ -1376,7 +1376,7 @@ ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST); @@ -50,6 +59,83 @@ diff -ruN a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c if (UNIV_UNLIKELY(srv_startup_is_before_trx_rollback_phase)) { /* No read-ahead to avoid thread deadlocks */ return(0); +diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c +--- a/storage/innobase/fil/fil0fil.c 2011-06-29 17:48:24.797971571 +0900 ++++ b/storage/innobase/fil/fil0fil.c 2011-06-29 18:04:02.548053286 +0900 +@@ -2600,7 +2600,7 @@ + + os_thread_sleep(20000); + +- fil_flush(id); ++ fil_flush(id, TRUE); + + goto retry; + +@@ -2814,7 +2814,7 @@ + goto error_exit; + } + +- ret = os_file_flush(file); ++ ret = os_file_flush(file, TRUE); + + if (!ret) { + fputs("InnoDB: Error: file flush of tablespace ", stderr); +@@ -3000,7 +3000,7 @@ + } + } + +- success = os_file_flush(file); ++ success = os_file_flush(file, TRUE); + if (!success) { + + goto func_exit; +@@ -3022,7 +3022,7 @@ + + goto func_exit; + } +- success = os_file_flush(file); ++ success = os_file_flush(file, TRUE); + func_exit: + os_file_close(file); + ut_free(buf2); +@@ -4005,7 +4005,7 @@ + size_after_extend, *actual_size); */ + mutex_exit(&fil_system->mutex); + +- fil_flush(space_id); ++ fil_flush(space_id, TRUE); + + return(success); + } +@@ -4576,8 +4576,9 @@ + void + fil_flush( + /*======*/ +- ulint space_id) /*!< in: file space id (this can be a group of ++ ulint space_id, /*!< in: file space id (this can be a group of + log files or a tablespace of the database) */ ++ ibool metadata) + { + fil_space_t* space; + fil_node_t* node; +@@ -4648,7 +4649,7 @@ + /* fprintf(stderr, "Flushing to file %s\n", + node->name); */ + +- os_file_flush(file); ++ os_file_flush(file, metadata); + + mutex_enter(&fil_system->mutex); + +@@ -4731,7 +4732,7 @@ + a non-existing space id. */ + for (i = 0; i < n_space_ids; i++) { + +- fil_flush(space_ids[i]); ++ fil_flush(space_ids[i], TRUE); + } + + mem_free(space_ids); diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc --- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:09:51.283956391 +0900 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:10:08.963980444 +0900 @@ -296,6 +382,20 @@ diff -ruN a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0re /** @name Modes used in read-ahead @{ */ /** read only pages belonging to the insert buffer tree */ +diff -ruN a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h +--- a/storage/innobase/include/fil0fil.h 2011-06-29 17:48:24.818969583 +0900 ++++ b/storage/innobase/include/fil0fil.h 2011-06-29 17:58:49.215971540 +0900 +@@ -658,8 +658,9 @@ + void + fil_flush( + /*======*/ +- ulint space_id); /*!< in: file space id (this can be a group of ++ ulint space_id, /*!< in: file space id (this can be a group of + log files or a tablespace of the database) */ ++ ibool metadata); + /**********************************************************************//** + Flushes to disk writes in file spaces of the given type possibly cached by + the OS. */ diff -ruN a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h --- a/storage/innobase/include/ha_prototypes.h 2010-11-03 07:01:13.000000000 +0900 +++ b/storage/innobase/include/ha_prototypes.h 2010-12-03 15:10:09.078026360 +0900 @@ -313,6 +413,67 @@ diff -ruN a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ /**********************************************************************//** Get the current setting of the lower_case_table_names global parameter from +diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h +--- a/storage/innobase/include/os0file.h 2011-05-11 20:54:12.000000000 +0900 ++++ b/storage/innobase/include/os0file.h 2011-06-29 17:55:21.947041132 +0900 +@@ -296,8 +296,8 @@ + pfs_os_file_write_func(name, file, buf, offset, offset_high, \ + n, __FILE__, __LINE__) + +-# define os_file_flush(file) \ +- pfs_os_file_flush_func(file, __FILE__, __LINE__) ++# define os_file_flush(file, metadata) \ ++ pfs_os_file_flush_func(file, metadata, __FILE__, __LINE__) + + # define os_file_rename(key, oldpath, newpath) \ + pfs_os_file_rename_func(key, oldpath, newpath, __FILE__, __LINE__) +@@ -333,7 +333,7 @@ + # define os_file_write(name, file, buf, offset, offset_high, n) \ + os_file_write_func(name, file, buf, offset, offset_high, n) + +-# define os_file_flush(file) os_file_flush_func(file) ++# define os_file_flush(file, metadata) os_file_flush_func(file, metadata) + + # define os_file_rename(key, oldpath, newpath) \ + os_file_rename_func(oldpath, newpath) +@@ -781,6 +781,7 @@ + pfs_os_file_flush_func( + /*===================*/ + os_file_t file, /*!< in, own: handle to a file */ ++ ibool metadata, + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line);/*!< in: line where the func invoked */ + +@@ -860,7 +861,8 @@ + ibool + os_file_flush_func( + /*===============*/ +- os_file_t file); /*!< in, own: handle to a file */ ++ os_file_t file, /*!< in, own: handle to a file */ ++ ibool metadata); + /***********************************************************************//** + Retrieves the last error number if an error occurs in a file io function. + The number should be retrieved before any other OS calls (because they may +diff -ruN a/storage/innobase/include/os0file.ic b/storage/innobase/include/os0file.ic +--- a/storage/innobase/include/os0file.ic 2011-05-11 20:54:12.000000000 +0900 ++++ b/storage/innobase/include/os0file.ic 2011-06-29 17:56:01.510958172 +0900 +@@ -369,6 +369,7 @@ + pfs_os_file_flush_func( + /*===================*/ + os_file_t file, /*!< in, own: handle to a file */ ++ ibool metadata, + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line)/*!< in: line where the func invoked */ + { +@@ -378,7 +379,7 @@ + + register_pfs_file_io_begin(&state, locker, file, 0, PSI_FILE_SYNC, + src_file, src_line); +- result = os_file_flush_func(file); ++ result = os_file_flush_func(file, metadata); + + register_pfs_file_io_end(locker, 0); + diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h --- a/storage/innobase/include/srv0srv.h 2010-12-03 15:09:51.291955835 +0900 +++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:10:09.079029047 +0900 @@ -419,15 +580,19 @@ diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c log->check_flush_or_checkpoint = TRUE; } -@@ -1100,6 +1128,7 @@ +@@ -1100,9 +1128,10 @@ group = (log_group_t*)((ulint)group - 1); if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC + && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT && srv_unix_file_flush_method != SRV_UNIX_NOSYNC) { - fil_flush(group->space_id); -@@ -1121,8 +1150,9 @@ +- fil_flush(group->space_id); ++ fil_flush(group->space_id, FALSE); + } + + #ifdef UNIV_DEBUG +@@ -1121,10 +1150,11 @@ logs and cannot end up here! */ if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC @@ -436,8 +601,11 @@ diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c - && srv_flush_log_at_trx_commit != 2) { + && thd_flush_log_at_trx_commit(NULL) != 2) { - fil_flush(group->space_id); +- fil_flush(group->space_id); ++ fil_flush(group->space_id, FALSE); } + + mutex_enter(&(log_sys->mutex)); @@ -1501,7 +1531,8 @@ mutex_exit(&(log_sys->mutex)); @@ -448,6 +616,15 @@ diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c /* O_DSYNC means the OS did not buffer the log file at all: so we have also flushed to disk what we have written */ +@@ -1511,7 +1542,7 @@ + + group = UT_LIST_GET_FIRST(log_sys->log_groups); + +- fil_flush(group->space_id); ++ fil_flush(group->space_id, FALSE); + log_sys->flushed_to_disk_lsn = log_sys->write_lsn; + } + @@ -2120,10 +2151,10 @@ sync = TRUE; @@ -470,6 +647,15 @@ diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c /* A checkpoint is not urgent: do it asynchronously */ do_checkpoint = TRUE; +@@ -2607,7 +2638,7 @@ + + mutex_exit(&(log_sys->mutex)); + +- fil_flush(group->archive_space_id); ++ fil_flush(group->archive_space_id, TRUE); + + mutex_enter(&(log_sys->mutex)); + @@ -3349,6 +3380,17 @@ log_sys->flushed_to_disk_lsn, log_sys->last_checkpoint_lsn); @@ -505,6 +691,24 @@ diff -ruN a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c #ifdef UNIV_LOG_ARCHIVE ut_ad(type != LOG_CHECKPOINT || limit_lsn == IB_ULONGLONG_MAX); /** TRUE when recovering from a checkpoint */ +@@ -3468,7 +3471,7 @@ + exit(1); + } + +- os_file_flush(log_file); ++ os_file_flush(log_file, TRUE); + os_file_close(log_file); + } + +@@ -3492,7 +3495,7 @@ + + os_file_write(name, log_file, buf, 0, 0, + LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE); +- os_file_flush(log_file); ++ os_file_flush(log_file, TRUE); + os_file_close(log_file); + + ut_free(buf); diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c --- a/storage/innobase/os/os0file.c 2010-11-03 07:01:13.000000000 +0900 +++ b/storage/innobase/os/os0file.c 2010-12-03 15:10:09.093023540 +0900 @@ -538,6 +742,118 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c #ifdef USE_FILE_LOCK if (create_mode != OS_FILE_OPEN_RAW && os_file_lock(file, name)) { +@@ -2008,7 +2013,7 @@ + + ut_free(buf2); + +- ret = os_file_flush(file); ++ ret = os_file_flush(file, TRUE); + + if (ret) { + return(TRUE); +@@ -2046,7 +2051,8 @@ + int + os_file_fsync( + /*==========*/ +- os_file_t file) /*!< in: handle to a file */ ++ os_file_t file, /*!< in: handle to a file */ ++ ibool metadata) + { + int ret; + int failures; +@@ -2055,7 +2061,15 @@ + failures = 0; + + do { ++#ifdef HAVE_FDATASYNC ++ if (metadata) { ++ ret = fsync(file); ++ } else { ++ ret = fdatasync(file); ++ } ++#else + ret = fsync(file); ++#endif + + os_n_fsyncs++; + +@@ -2092,7 +2106,8 @@ + ibool + os_file_flush_func( + /*===============*/ +- os_file_t file) /*!< in, own: handle to a file */ ++ os_file_t file, /*!< in, own: handle to a file */ ++ ibool metadata) + { + #ifdef __WIN__ + BOOL ret; +@@ -2142,18 +2157,18 @@ + /* If we are not on an operating system that supports this, + then fall back to a plain fsync. */ + +- ret = os_file_fsync(file); ++ ret = os_file_fsync(file, metadata); + } else { + ret = fcntl(file, F_FULLFSYNC, NULL); + + if (ret) { + /* If we are not on a file system that supports this, + then fall back to a plain fsync. */ +- ret = os_file_fsync(file); ++ ret = os_file_fsync(file, metadata); + } + } + #else +- ret = os_file_fsync(file); ++ ret = os_file_fsync(file, metadata); + #endif + + if (ret == 0) { +@@ -2336,7 +2351,7 @@ + the OS crashes, a database page is only partially + physically written to disk. */ + +- ut_a(TRUE == os_file_flush(file)); ++ ut_a(TRUE == os_file_flush(file, TRUE)); + } + # endif /* UNIV_DO_FLUSH */ + +@@ -2378,7 +2393,7 @@ + the OS crashes, a database page is only partially + physically written to disk. */ + +- ut_a(TRUE == os_file_flush(file)); ++ ut_a(TRUE == os_file_flush(file, TRUE)); + } + # endif /* UNIV_DO_FLUSH */ + +@@ -2750,7 +2765,7 @@ + + # ifdef UNIV_DO_FLUSH + if (!os_do_not_call_flush_at_each_write) { +- ut_a(TRUE == os_file_flush(file)); ++ ut_a(TRUE == os_file_flush(file, TRUE)); + } + # endif /* UNIV_DO_FLUSH */ + +@@ -4289,7 +4304,7 @@ + #ifdef UNIV_DO_FLUSH + if (slot->type == OS_FILE_WRITE + && !os_do_not_call_flush_at_each_write) { +- if (!os_file_flush(slot->file)) { ++ if (!os_file_flush(slot->file, TRUE)) { + ut_error; + } + } +@@ -4590,7 +4605,7 @@ + #ifdef UNIV_DO_FLUSH + if (slot->type == OS_FILE_WRITE + && !os_do_not_call_flush_at_each_write) +- && !os_file_flush(slot->file) { ++ && !os_file_flush(slot->file, TRUE) { + ut_error; + } + #endif /* UNIV_DO_FLUSH */ diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c --- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:09:51.301987792 +0900 +++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:13:29.369986988 +0900 diff --git a/innodb_pass_corrupt_table.patch b/innodb_pass_corrupt_table.patch index d7f8a20..b111727 100644 --- a/innodb_pass_corrupt_table.patch +++ b/innodb_pass_corrupt_table.patch @@ -637,7 +637,7 @@ diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c ut_a(ret); if (mode == OS_AIO_SYNC) { -@@ -5780,3 +5813,46 @@ +@@ -5781,3 +5814,46 @@ return 0; } } @@ -1193,7 +1193,7 @@ diff -ruN a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0 diff -ruN a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h --- a/storage/innobase/include/fil0fil.h 2010-12-04 15:35:29.175520016 +0900 +++ b/storage/innobase/include/fil0fil.h 2010-12-04 15:38:18.172483391 +0900 -@@ -749,6 +749,19 @@ +@@ -750,6 +750,19 @@ fil_system_hash_nodes(void); /*========================*/ diff --git a/innodb_recovery_patches.patch b/innodb_recovery_patches.patch index d836a8a..e2927da 100644 --- a/innodb_recovery_patches.patch +++ b/innodb_recovery_patches.patch @@ -441,7 +441,7 @@ diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c #ifndef UNIV_HOTBACKUP # include "os0sync.h" # include "os0thread.h" -@@ -4260,6 +4261,18 @@ +@@ -4270,6 +4271,18 @@ INFINITE); } diff --git a/innodb_separate_doublewrite.patch b/innodb_separate_doublewrite.patch index 7f10b0d..70199d0 100644 --- a/innodb_separate_doublewrite.patch +++ b/innodb_separate_doublewrite.patch @@ -45,8 +45,8 @@ diff -ruN a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c flush: /* Now flush the doublewrite buffer data to disk */ -- fil_flush(TRX_SYS_SPACE); -+ fil_flush(srv_doublewrite_file ? TRX_DOUBLEWRITE_SPACE : TRX_SYS_SPACE); +- fil_flush(TRX_SYS_SPACE, FALSE); ++ fil_flush(srv_doublewrite_file ? TRX_DOUBLEWRITE_SPACE : TRX_SYS_SPACE, FALSE); /* We know that the writes have been flushed to disk now and in recovery we will find them in the doublewrite buffer @@ -303,7 +303,7 @@ diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c /* The node must be put back to the LRU list */ UT_LIST_ADD_FIRST(LRU, system->LRU, node); } -@@ -5644,7 +5654,7 @@ +@@ -5645,7 +5655,7 @@ ut_a(fil_node->n_pending == 0); ut_a(fil_node->open); ut_a(fil_node->space->purpose == FIL_TABLESPACE); diff --git a/mysql.spec b/mysql.spec index 664a0b5..49d4795 100644 --- a/mysql.spec +++ b/mysql.spec @@ -36,7 +36,7 @@ Summary(uk.UTF-8): MySQL - швидкий SQL-сервер Summary(zh_CN.UTF-8): MySQL数据库服务器 Name: mysql Version: 5.5.13 -Release: 2 +Release: 3 License: GPL + MySQL FLOSS Exception Group: Applications/Databases # Source0Download: http://dev.mysql.com/downloads/mysql/5.5.html#downloads -- 2.44.0