Merge lp:~percona-dev/percona-server/fb_changes_auto_lru_dump into lp:percona-server/release-5.1.54-12

Proposed by Alexey Kopytov on 2011-01-12
Status: Work in progress
Proposed branch: lp:~percona-dev/percona-server/fb_changes_auto_lru_dump
Merge into: lp:percona-server/release-5.1.54-12
Diff against target: 1684 lines (+481/-217)
16 files modified
innodb_adjust_defaults.patch (+4/-4)
innodb_buffer_pool_shm.patch (+7/-7)
innodb_deadlock_count.patch (+3/-3)
innodb_fast_checksum.patch (+4/-4)
innodb_fast_shutdown.patch (+15/-9)
innodb_files_extend.patch (+4/-4)
innodb_fix_misc.patch (+1/-1)
innodb_lru_dump_restore.patch (+375/-114)
innodb_pass_corrupt_table.patch (+27/-27)
innodb_separate_doublewrite.patch (+3/-3)
innodb_show_sys_tables.patch (+8/-11)
profiling_slow.patch (+2/-2)
response-time-distribution.patch (+1/-1)
show_slave_status_nolock.patch (+2/-2)
show_temp_51.patch (+2/-2)
userstat.patch (+23/-23)
To merge this branch: bzr merge lp:~percona-dev/percona-server/fb_changes_auto_lru_dump
Reviewer Review Type Date Requested Status
Vadim Tkachenko 2011-01-12 Needs Fixing on 2011-01-12
Fred Linhoss documentation 2011-01-12 Pending
Yasufumi Kinoshita 2011-01-12 Pending
Review via email: mp+46012@code.launchpad.net
To post a comment you must log in.
190. By Alexey Kopytov on 2011-01-12

Merged Facebook's changes to innodb_lru_dump_restore.patch:

LRU is dumped to a temporary file first to avoid partially written files
in backups or in case of a crash.

Release the LRU mutex while doing memset and file IO. Should mimimize
the impact on the host during scheduled LRU dump. Basic detection of
LRU cycling should the next page to dump be put back at the head of the
LRU during the unlocked window.

Added option innodb_lru_dump_old_pages to control whether old pages are
included in the LRU dump. The default is to only dump young pages.

Added option innodb_lru_load_max_entries specifying the maximum number
of LRU entries to restore. The default is 512k entries (8GB).
Consecutive pages are merged and only count as one, so you will probably
load more pages than this number of LRU entries.

Switched to writing out LRU in priority order.

Load in LRU priority order, but always merge consecutive pages.

Add status vars for LRU restore progress: lru_restore_total_pages and
lru_restore_loaded_pages.

Added restore rate limiting (restore no more than innodb_io_capacity
pages per second). In my testing, a value of 5000 is fine for a
pre-up-ip warmup, but this should be reduced to 500 before serving
traffic to ensure adequate IO capacity is available for foreground
threads.

Vadim Tkachenko (vadim-tk) wrote :

The same should be made for 5.5

review: Needs Fixing
Vadim Tkachenko (vadim-tk) wrote :

KAlexey, we had sorted pre-load in sequantual order, and it provided fast read from disks. I am not sure how fast is load in LRU order
KAlexey, we may want to have it as option which method to use

Alexey Kopytov (akopytov) wrote :

I think loading in LRU order will be slower in most cases, even though this new approach tries to merge sequential records if they appear in the LRU-ordered list.

OK, will make that optional and resubmit.

Unmerged revisions

190. By Alexey Kopytov on 2011-01-12

Merged Facebook's changes to innodb_lru_dump_restore.patch:

LRU is dumped to a temporary file first to avoid partially written files
in backups or in case of a crash.

Release the LRU mutex while doing memset and file IO. Should mimimize
the impact on the host during scheduled LRU dump. Basic detection of
LRU cycling should the next page to dump be put back at the head of the
LRU during the unlocked window.

Added option innodb_lru_dump_old_pages to control whether old pages are
included in the LRU dump. The default is to only dump young pages.

Added option innodb_lru_load_max_entries specifying the maximum number
of LRU entries to restore. The default is 512k entries (8GB).
Consecutive pages are merged and only count as one, so you will probably
load more pages than this number of LRU entries.

Switched to writing out LRU in priority order.

Load in LRU priority order, but always merge consecutive pages.

Add status vars for LRU restore progress: lru_restore_total_pages and
lru_restore_loaded_pages.

Added restore rate limiting (restore no more than innodb_io_capacity
pages per second). In my testing, a value of 5000 is fine for a
pre-up-ip warmup, but this should be reduced to 500 before serving
traffic to ensure adequate IO capacity is available for foreground
threads.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'innodb_adjust_defaults.patch'
--- innodb_adjust_defaults.patch 2010-12-16 11:35:26 +0000
+++ innodb_adjust_defaults.patch 2011-01-12 17:48:16 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc8diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
9--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:39:14.000000000 +09009--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:39:14.000000000 +0900
10+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:43:26.000000000 +090010+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:43:26.000000000 +0900
11@@ -11210,7 +11210,7 @@11@@ -11214,7 +11214,7 @@
12 static MYSQL_SYSVAR_ULONG(use_purge_thread, srv_use_purge_thread,12 static MYSQL_SYSVAR_ULONG(use_purge_thread, srv_use_purge_thread,
13 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,13 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
14 "Number of purge devoted threads. #### over 1 is EXPERIMENTAL ####",14 "Number of purge devoted threads. #### over 1 is EXPERIMENTAL ####",
@@ -17,7 +17,7 @@
17 17
18 static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info,18 static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info,
19 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,19 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
20@@ -11310,7 +11310,7 @@20@@ -11314,7 +11314,7 @@
21 static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,21 static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
22 PLUGIN_VAR_NOCMDARG,22 PLUGIN_VAR_NOCMDARG,
23 "Attempt flushing dirty pages to avoid IO bursts at checkpoints.",23 "Attempt flushing dirty pages to avoid IO bursts at checkpoints.",
@@ -26,7 +26,7 @@
26 26
27 static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,27 static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
28 PLUGIN_VAR_RQCMDARG,28 PLUGIN_VAR_RQCMDARG,
29@@ -11555,7 +11555,7 @@29@@ -11559,7 +11559,7 @@
30 static MYSQL_SYSVAR_ULONG(ibuf_active_contract, srv_ibuf_active_contract,30 static MYSQL_SYSVAR_ULONG(ibuf_active_contract, srv_ibuf_active_contract,
31 PLUGIN_VAR_RQCMDARG,31 PLUGIN_VAR_RQCMDARG,
32 "Enable/Disable active_contract of insert buffer. 0:disable 1:enable",32 "Enable/Disable active_contract of insert buffer. 0:disable 1:enable",
@@ -35,7 +35,7 @@
35 35
36 static MYSQL_SYSVAR_ULONG(ibuf_accel_rate, srv_ibuf_accel_rate,36 static MYSQL_SYSVAR_ULONG(ibuf_accel_rate, srv_ibuf_accel_rate,
37 PLUGIN_VAR_RQCMDARG,37 PLUGIN_VAR_RQCMDARG,
38@@ -11635,8 +11635,8 @@38@@ -11639,8 +11639,8 @@
39 };39 };
40 static MYSQL_SYSVAR_ENUM(adaptive_checkpoint, srv_adaptive_checkpoint,40 static MYSQL_SYSVAR_ENUM(adaptive_checkpoint, srv_adaptive_checkpoint,
41 PLUGIN_VAR_RQCMDARG,41 PLUGIN_VAR_RQCMDARG,
4242
=== modified file 'innodb_buffer_pool_shm.patch'
--- innodb_buffer_pool_shm.patch 2010-12-16 11:35:26 +0000
+++ innodb_buffer_pool_shm.patch 2011-01-12 17:48:16 +0000
@@ -675,7 +675,7 @@
675 675
676 static char* internal_innobase_data_file_path = NULL;676 static char* internal_innobase_data_file_path = NULL;
677 677
678@@ -2457,6 +2458,7 @@678@@ -2461,6 +2462,7 @@
679 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;679 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
680 srv_use_checksums = (ibool) innobase_use_checksums;680 srv_use_checksums = (ibool) innobase_use_checksums;
681 srv_fast_checksum = (ibool) innobase_fast_checksum;681 srv_fast_checksum = (ibool) innobase_fast_checksum;
@@ -683,7 +683,7 @@
683 683
684 #ifdef HAVE_LARGE_PAGES684 #ifdef HAVE_LARGE_PAGES
685 if ((os_use_large_pages = (ibool) my_use_large_pages))685 if ((os_use_large_pages = (ibool) my_use_large_pages))
686@@ -11405,6 +11407,16 @@686@@ -11409,6 +11411,16 @@
687 "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",687 "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
688 NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);688 NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);
689 689
@@ -700,7 +700,7 @@
700 static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,700 static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
701 PLUGIN_VAR_RQCMDARG,701 PLUGIN_VAR_RQCMDARG,
702 "Helps in performance tuning in heavily concurrent environments.",702 "Helps in performance tuning in heavily concurrent environments.",
703@@ -11680,6 +11692,8 @@703@@ -11699,6 +11711,8 @@
704 MYSQL_SYSVAR(additional_mem_pool_size),704 MYSQL_SYSVAR(additional_mem_pool_size),
705 MYSQL_SYSVAR(autoextend_increment),705 MYSQL_SYSVAR(autoextend_increment),
706 MYSQL_SYSVAR(buffer_pool_size),706 MYSQL_SYSVAR(buffer_pool_size),
@@ -774,11 +774,10 @@
774 #ifndef UNIV_HOTBACKUP774 #ifndef UNIV_HOTBACKUP
775 /*************************************************************//**775 /*************************************************************//**
776 Creates a mutex array to protect a hash table. */776 Creates a mutex array to protect a hash table. */
777@@ -327,6 +349,33 @@777@@ -328,6 +350,33 @@
778 }\
779 }\778 }\
780 } while (0)779 } while (0)
781+780
782+/********************************************************************//**781+/********************************************************************//**
783+Align nodes with moving location.*/782+Align nodes with moving location.*/
784+#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \783+#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \
@@ -805,9 +804,10 @@
805+ }\804+ }\
806+ }\805+ }\
807+} while (0)806+} while (0)
808 807+
809 /************************************************************//**808 /************************************************************//**
810 Gets the mutex index for a fold value in a hash table.809 Gets the mutex index for a fold value in a hash table.
810 @return mutex number */
811diff -ruN a/storage/innodb_plugin/include/os0proc.h b/storage/innodb_plugin/include/os0proc.h811diff -ruN a/storage/innodb_plugin/include/os0proc.h b/storage/innodb_plugin/include/os0proc.h
812--- a/storage/innodb_plugin/include/os0proc.h 2010-06-04 00:49:59.000000000 +0900812--- a/storage/innodb_plugin/include/os0proc.h 2010-06-04 00:49:59.000000000 +0900
813+++ b/storage/innodb_plugin/include/os0proc.h 2010-07-14 16:40:16.169321536 +0900813+++ b/storage/innodb_plugin/include/os0proc.h 2010-07-14 16:40:16.169321536 +0900
814814
=== modified file 'innodb_deadlock_count.patch'
--- innodb_deadlock_count.patch 2010-12-13 11:43:12 +0000
+++ innodb_deadlock_count.patch 2011-01-12 17:48:16 +0000
@@ -31,7 +31,7 @@
31diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h31diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
32--- a/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.478241628 +040032--- a/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.478241628 +0400
33+++ b/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.936991959 +040033+++ b/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.936991959 +0400
34@@ -673,6 +673,7 @@34@@ -687,6 +687,7 @@
35 ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */35 ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */
36 ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */36 ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */
37 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/37 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/
@@ -53,7 +53,7 @@
53diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c53diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
54--- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.478241628 +040054--- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.478241628 +0400
55+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.936991959 +040055+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.936991959 +0400
56@@ -438,7 +438,7 @@56@@ -452,7 +452,7 @@
57 static ulint srv_n_rows_updated_old = 0;57 static ulint srv_n_rows_updated_old = 0;
58 static ulint srv_n_rows_deleted_old = 0;58 static ulint srv_n_rows_deleted_old = 0;
59 static ulint srv_n_rows_read_old = 0;59 static ulint srv_n_rows_read_old = 0;
@@ -62,7 +62,7 @@
62 UNIV_INTERN ulint srv_n_lock_wait_count = 0;62 UNIV_INTERN ulint srv_n_lock_wait_count = 0;
63 UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;63 UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;
64 UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0;64 UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0;
65@@ -2149,6 +2149,8 @@65@@ -2163,6 +2163,8 @@
66 = UT_LIST_GET_LEN(buf_pool->flush_list);66 = UT_LIST_GET_LEN(buf_pool->flush_list);
67 export_vars.innodb_buffer_pool_pages_free67 export_vars.innodb_buffer_pool_pages_free
68 = UT_LIST_GET_LEN(buf_pool->free);68 = UT_LIST_GET_LEN(buf_pool->free);
6969
=== modified file 'innodb_fast_checksum.patch'
--- innodb_fast_checksum.patch 2010-12-16 11:35:26 +0000
+++ innodb_fast_checksum.patch 2011-01-12 17:48:16 +0000
@@ -170,7 +170,7 @@
170 static my_bool innobase_extra_undoslots = FALSE;170 static my_bool innobase_extra_undoslots = FALSE;
171 static my_bool innobase_fast_recovery = FALSE;171 static my_bool innobase_fast_recovery = FALSE;
172 static my_bool innobase_recovery_stats = TRUE;172 static my_bool innobase_recovery_stats = TRUE;
173@@ -2394,6 +2395,7 @@173@@ -2398,6 +2399,7 @@
174 174
175 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;175 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
176 srv_use_checksums = (ibool) innobase_use_checksums;176 srv_use_checksums = (ibool) innobase_use_checksums;
@@ -178,7 +178,7 @@
178 178
179 #ifdef HAVE_LARGE_PAGES179 #ifdef HAVE_LARGE_PAGES
180 if ((os_use_large_pages = (ibool) my_use_large_pages))180 if ((os_use_large_pages = (ibool) my_use_large_pages))
181@@ -11105,6 +11107,15 @@181@@ -11109,6 +11111,15 @@
182 "Disable with --skip-innodb-checksums.",182 "Disable with --skip-innodb-checksums.",
183 NULL, NULL, TRUE);183 NULL, NULL, TRUE);
184 184
@@ -194,7 +194,7 @@
194 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,194 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
195 PLUGIN_VAR_READONLY,195 PLUGIN_VAR_READONLY,
196 "The common part for InnoDB table spaces.",196 "The common part for InnoDB table spaces.",
197@@ -11597,6 +11608,7 @@197@@ -11616,6 +11627,7 @@
198 MYSQL_SYSVAR(autoextend_increment),198 MYSQL_SYSVAR(autoextend_increment),
199 MYSQL_SYSVAR(buffer_pool_size),199 MYSQL_SYSVAR(buffer_pool_size),
200 MYSQL_SYSVAR(checksums),200 MYSQL_SYSVAR(checksums),
@@ -301,7 +301,7 @@
301diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c301diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
302--- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:40:36.599058304 +0900302--- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:40:36.599058304 +0900
303+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:42:03.647012289 +0900303+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:42:03.647012289 +0900
304@@ -383,6 +383,7 @@304@@ -397,6 +397,7 @@
305 305
306 UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE;306 UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE;
307 UNIV_INTERN ibool srv_use_checksums = TRUE;307 UNIV_INTERN ibool srv_use_checksums = TRUE;
308308
=== modified file 'innodb_fast_shutdown.patch'
--- innodb_fast_shutdown.patch 2010-12-13 11:43:12 +0000
+++ innodb_fast_shutdown.patch 2011-01-12 17:48:16 +0000
@@ -11,6 +11,7 @@
11# suite.11# suite.
12#12#
13# The patch also implements os_event_wait_time() for POSIX systems.13# The patch also implements os_event_wait_time() for POSIX systems.
14diff -ruN /dev/null b/COPYING.innodb_fast_shutdown
14--- /dev/null 1970-01-01 00:00:00.000000000 +000015--- /dev/null 1970-01-01 00:00:00.000000000 +0000
15+++ b/COPYING.innodb_fast_shutdown 2010-11-16 21:37:51.000000000 +030016+++ b/COPYING.innodb_fast_shutdown 2010-11-16 21:37:51.000000000 +0300
16@@ -0,0 +1,10 @@17@@ -0,0 +1,10 @@
@@ -24,6 +25,7 @@
24+ * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.25+ * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
25+26+
26+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28diff -ruN a/storage/innodb_plugin/include/os0sync.h b/storage/innodb_plugin/include/os0sync.h
27--- a/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:33:00.000000000 +030029--- a/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:33:00.000000000 +0300
28+++ b/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:34:06.000000000 +030030+++ b/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:34:06.000000000 +0300
29@@ -189,14 +189,14 @@31@@ -189,14 +189,14 @@
@@ -43,6 +45,7 @@
43 OS_SYNC_INFINITE_TIME */45 OS_SYNC_INFINITE_TIME */
44 #ifdef __WIN__46 #ifdef __WIN__
45 /**********************************************************//**47 /**********************************************************//**
48diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
46--- a/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:33:00.000000000 +030049--- a/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:33:00.000000000 +0300
47+++ b/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:34:06.000000000 +030050+++ b/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:34:06.000000000 +0300
48@@ -57,6 +57,9 @@51@@ -57,6 +57,9 @@
@@ -55,6 +58,7 @@
55 /* If the last data file is auto-extended, we add this many pages to it58 /* If the last data file is auto-extended, we add this many pages to it
56 at a time */59 at a time */
57 #define SRV_AUTO_EXTEND_INCREMENT \60 #define SRV_AUTO_EXTEND_INCREMENT \
61diff -ruN a/storage/innodb_plugin/log/log0log.c b/storage/innodb_plugin/log/log0log.c
58--- a/storage/innodb_plugin/log/log0log.c 2010-11-16 21:33:00.000000000 +030062--- a/storage/innodb_plugin/log/log0log.c 2010-11-16 21:33:00.000000000 +0300
59+++ b/storage/innodb_plugin/log/log0log.c 2010-11-16 21:34:06.000000000 +030063+++ b/storage/innodb_plugin/log/log0log.c 2010-11-16 21:34:06.000000000 +0300
60@@ -3103,6 +3103,7 @@64@@ -3103,6 +3103,7 @@
@@ -65,6 +69,7 @@
65 loop:69 loop:
66 os_thread_sleep(100000);70 os_thread_sleep(100000);
67 71
72diff -ruN a/storage/innodb_plugin/os/os0sync.c b/storage/innodb_plugin/os/os0sync.c
68--- a/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:33:00.000000000 +030073--- a/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:33:00.000000000 +0300
69+++ b/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:34:06.000000000 +030074+++ b/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:34:06.000000000 +0300
70@@ -31,6 +31,9 @@75@@ -31,6 +31,9 @@
@@ -157,9 +162,10 @@
157 #endif162 #endif
158 }163 }
159 164
165diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
160--- a/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:33:00.000000000 +0300166--- a/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:33:00.000000000 +0300
161+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:34:06.000000000 +0300167+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:34:06.000000000 +0300
162@@ -707,6 +707,8 @@168@@ -721,6 +721,8 @@
163 169
164 UNIV_INTERN os_event_t srv_lock_timeout_thread_event;170 UNIV_INTERN os_event_t srv_lock_timeout_thread_event;
165 171
@@ -168,7 +174,7 @@
168 UNIV_INTERN srv_sys_t* srv_sys = NULL;174 UNIV_INTERN srv_sys_t* srv_sys = NULL;
169 175
170 /* padding to prevent other memory update hotspots from residing on176 /* padding to prevent other memory update hotspots from residing on
171@@ -1012,6 +1014,7 @@177@@ -1026,6 +1028,7 @@
172 }178 }
173 179
174 srv_lock_timeout_thread_event = os_event_create(NULL);180 srv_lock_timeout_thread_event = os_event_create(NULL);
@@ -176,7 +182,7 @@
176 182
177 for (i = 0; i < SRV_MASTER + 1; i++) {183 for (i = 0; i < SRV_MASTER + 1; i++) {
178 srv_n_threads_active[i] = 0;184 srv_n_threads_active[i] = 0;
179@@ -2239,7 +2242,7 @@185@@ -2257,7 +2260,7 @@
180 /* Wake up every 5 seconds to see if we need to print186 /* Wake up every 5 seconds to see if we need to print
181 monitor information. */187 monitor information. */
182 188
@@ -185,7 +191,7 @@
185 191
186 current_time = time(NULL);192 current_time = time(NULL);
187 193
188@@ -2381,7 +2384,7 @@194@@ -2399,7 +2402,7 @@
189 /* When someone is waiting for a lock, we wake up every second195 /* When someone is waiting for a lock, we wake up every second
190 and check if a timeout has passed for a lock wait */196 and check if a timeout has passed for a lock wait */
191 197
@@ -194,7 +200,7 @@
194 200
195 srv_lock_timeout_active = TRUE;201 srv_lock_timeout_active = TRUE;
196 202
197@@ -2546,7 +2549,7 @@203@@ -2564,7 +2567,7 @@
198 204
199 fflush(stderr);205 fflush(stderr);
200 206
@@ -203,16 +209,16 @@
203 209
204 if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {210 if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
205 211
206@@ -2590,7 +2593,7 @@212@@ -2612,7 +2615,7 @@
207 last_dump_time = time(NULL);213 last_dump_time = time(NULL);
208 214
209 loop:215 loop:
210- os_thread_sleep(5000000);216- os_thread_sleep(1000000);
211+ os_event_wait_time(srv_shutdown_event, 5000000);217+ os_event_wait_time(srv_shutdown_event, 5000000);
212 218
213 if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {219 if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
214 goto exit_func;220 goto exit_func;
215@@ -2770,7 +2773,7 @@221@@ -2792,7 +2795,7 @@
216 if (!skip_sleep) {222 if (!skip_sleep) {
217 if (next_itr_time > cur_time) {223 if (next_itr_time > cur_time) {
218 224
@@ -221,7 +227,7 @@
221 srv_main_sleeps++;227 srv_main_sleeps++;
222 228
223 /*229 /*
224@@ -3476,9 +3479,10 @@230@@ -3498,9 +3501,10 @@
225 mutex_exit(&kernel_mutex);231 mutex_exit(&kernel_mutex);
226 232
227 sleep_ms = 10;233 sleep_ms = 10;
228234
=== modified file 'innodb_files_extend.patch'
--- innodb_files_extend.patch 2010-12-16 11:35:26 +0000
+++ innodb_files_extend.patch 2011-01-12 17:48:16 +0000
@@ -89,7 +89,7 @@
89 static my_bool innobase_thread_concurrency_timer_based;89 static my_bool innobase_thread_concurrency_timer_based;
90 static long long innobase_buffer_pool_size, innobase_log_file_size;90 static long long innobase_buffer_pool_size, innobase_log_file_size;
91 91
92@@ -2084,6 +2087,62 @@92@@ -2088,6 +2091,62 @@
93 }93 }
94 #endif /* UNIV_DEBUG */94 #endif /* UNIV_DEBUG */
95 95
@@ -152,7 +152,7 @@
152 #ifndef MYSQL_SERVER152 #ifndef MYSQL_SERVER
153 innodb_overwrite_relay_log_info = FALSE;153 innodb_overwrite_relay_log_info = FALSE;
154 #endif154 #endif
155@@ -7004,9 +7063,9 @@155@@ -7008,9 +7067,9 @@
156 | DICT_TF_COMPACT156 | DICT_TF_COMPACT
157 | DICT_TF_FORMAT_ZIP157 | DICT_TF_FORMAT_ZIP
158 << DICT_TF_FORMAT_SHIFT;158 << DICT_TF_FORMAT_SHIFT;
@@ -165,7 +165,7 @@
165 }165 }
166 }166 }
167 167
168@@ -11116,6 +11175,16 @@168@@ -11120,6 +11179,16 @@
169 "#### Attention: The checksum is not compatible for normal or disabled version! ####",169 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
170 NULL, NULL, FALSE);170 NULL, NULL, FALSE);
171 171
@@ -182,7 +182,7 @@
182 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,182 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
183 PLUGIN_VAR_READONLY,183 PLUGIN_VAR_READONLY,
184 "The common part for InnoDB table spaces.",184 "The common part for InnoDB table spaces.",
185@@ -11604,6 +11673,8 @@185@@ -11623,6 +11692,8 @@
186 NULL, NULL, 0, 0, 1, 0);186 NULL, NULL, 0, 0, 1, 0);
187 187
188 static struct st_mysql_sys_var* innobase_system_variables[]= {188 static struct st_mysql_sys_var* innobase_system_variables[]= {
189189
=== modified file 'innodb_fix_misc.patch'
--- innodb_fix_misc.patch 2010-12-20 21:54:44 +0000
+++ innodb_fix_misc.patch 2011-01-12 17:48:16 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc8diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
9--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:50:59.626327847 +09009--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:50:59.626327847 +0900
10+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:55:20.281021252 +090010+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:55:20.281021252 +0900
11@@ -11770,7 +11770,7 @@11@@ -11791,7 +11791,7 @@
12 &innobase_storage_engine,12 &innobase_storage_engine,
13 innobase_hton_name,13 innobase_hton_name,
14 "Innobase Oy",14 "Innobase Oy",
1515
=== modified file 'innodb_lru_dump_restore.patch'
--- innodb_lru_dump_restore.patch 2010-12-22 18:24:52 +0000
+++ innodb_lru_dump_restore.patch 2011-01-12 17:48:16 +0000
@@ -5,50 +5,67 @@
5#!!! notice !!!5#!!! notice !!!
6# Any small change to this file in the main branch6# Any small change to this file in the main branch
7# should be done or reviewed by the maintainer!7# should be done or reviewed by the maintainer!
8diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result
8--- /dev/null 1970-01-01 00:00:00.000000000 +00009--- /dev/null 1970-01-01 00:00:00.000000000 +0000
9+++ b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result 2010-12-22 20:48:19.000000000 +030010+++ b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result 2011-01-12 19:38:48.000000000 +0300
10@@ -0,0 +1,7 @@11@@ -0,0 +1,7 @@
11+#12+#
12+# LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't 13+# LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't
13+# exist14+# exist
14+#15+#
15+SELECT @@innodb_auto_lru_dump;16+SELECT @@innodb_auto_lru_dump;
16+@@innodb_auto_lru_dump17+@@innodb_auto_lru_dump
17+30018+300
19diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt
18--- /dev/null 1970-01-01 00:00:00.000000000 +000020--- /dev/null 1970-01-01 00:00:00.000000000 +0000
19+++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt 2010-12-22 20:25:59.000000000 +030021+++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt 2011-01-11 19:07:54.000000000 +0300
20@@ -0,0 +1 @@22@@ -0,0 +1 @@
21+--innodb_auto_lru_dump=30023+--innodb_auto_lru_dump=300
24diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test
22--- /dev/null 1970-01-01 00:00:00.000000000 +000025--- /dev/null 1970-01-01 00:00:00.000000000 +0000
23+++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test 2010-12-22 20:17:57.000000000 +030026+++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test 2011-01-12 19:38:37.000000000 +0300
24@@ -0,0 +1,17 @@27@@ -0,0 +1,17 @@
25+--source include/have_innodb_plugin.inc28+--source include/have_innodb_plugin.inc
26+29+
27+--echo #30+--echo #
28+--echo # LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't 31+--echo # LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't
29+--echo # exist32+--echo # exist
30+--echo #33+--echo #
31+34+
32+SELECT @@innodb_auto_lru_dump;35+SELECT @@innodb_auto_lru_dump;
33+36+
34+# We want to check that the server does not crash on startup when there is no 37+# We want to check that the server does not crash on startup when there is no
35+# ib_lru_dump in the datadir. If we are here, we have already started up38+# ib_lru_dump in the datadir. If we are here, we have already started up
36+# successfully. So we only have to check that there is no ib_lru_dump in the 39+# successfully. So we only have to check that there is no ib_lru_dump in the
37+# datadir.40+# datadir.
38+41+
39+--let $MYSQLD_DATADIR= `SELECT @@datadir`42+--let $MYSQLD_DATADIR= `SELECT @@datadir`
40+--error 143+--error 1
41+--file_exists $MYSQLD_DATADIR/ib_lru_dump;44+--file_exists $MYSQLD_DATADIR/ib_lru_dump;
42diff -ruN a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c45diff -ruN a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c
43--- a/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:13:11.070058073 +090046--- a/storage/innodb_plugin/buf/buf0lru.c 2011-01-11 19:07:52.000000000 +0300
44+++ b/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:34:33.860400549 +090047+++ b/storage/innodb_plugin/buf/buf0lru.c 2011-01-12 19:37:29.000000000 +0300
45@@ -2122,6 +2122,278 @@48@@ -48,6 +48,7 @@
49 #include "page0zip.h"
50 #include "log0recv.h"
51 #include "srv0srv.h"
52+#include "srv0start.h"
53
54 /** The number of blocks from the LRU_old pointer onward, including
55 the block pointed to, must be buf_LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV
56@@ -2122,6 +2123,445 @@
46 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);57 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);
47 }58 }
48 59
49+/********************************************************************//**60+/********************************************************************//**
50+Dump the LRU page list to the specific file. */61+Dump the LRU page list to the specific file.
62+
63+The format of the file is a list of (space id, page id) pairs, written in
64+big-endian format, followed by the pair (0xFFFFFFFF, 0xFFFFFFFF). The order of
65+the pages is the order in which they appear in the LRU, from most recent access
66+to oldest access. */
51+#define LRU_DUMP_FILE "ib_lru_dump"67+#define LRU_DUMP_FILE "ib_lru_dump"
68+#define LRU_DUMP_TEMP_FILE "ib_lru_dump.tmp"
52+69+
53+UNIV_INTERN70+UNIV_INTERN
54+ibool71+ibool
@@ -60,10 +77,13 @@
60+ byte* buffer_base = NULL;77+ byte* buffer_base = NULL;
61+ byte* buffer = NULL;78+ byte* buffer = NULL;
62+ buf_page_t* bpage;79+ buf_page_t* bpage;
80+ buf_page_t* first_bpage;
63+ ulint buffers;81+ ulint buffers;
64+ ulint offset;82+ ulint offset;
65+ ibool ret = FALSE;83+ ulint pages_written;
66+ ulint i;84+ ulint i;
85+ ulint total_pages;
86+ mutex_t* next_block_mutex;
67+87+
68+ for (i = 0; i < srv_n_data_files; i++) {88+ for (i = 0; i < srv_n_data_files; i++) {
69+ if (strstr(srv_data_file_names[i], LRU_DUMP_FILE) != NULL) {89+ if (strstr(srv_data_file_names[i], LRU_DUMP_FILE) != NULL) {
@@ -83,8 +103,8 @@
83+ goto end;103+ goto end;
84+ }104+ }
85+105+
86+ dump_file = os_file_create(LRU_DUMP_FILE, OS_FILE_OVERWRITE,106+ dump_file = os_file_create(LRU_DUMP_TEMP_FILE, OS_FILE_OVERWRITE,
87+ OS_FILE_NORMAL, OS_DATA_FILE, &success);107+ OS_FILE_NORMAL, OS_DATA_FILE, &success);
88+ if (!success) {108+ if (!success) {
89+ os_file_get_last_error(TRUE);109+ os_file_get_last_error(TRUE);
90+ fprintf(stderr,110+ fprintf(stderr,
@@ -92,13 +112,27 @@
92+ goto end;112+ goto end;
93+ }113+ }
94+114+
115+ memset(buffer, 0, UNIV_PAGE_SIZE);
116+
117+ /* walk the buffer pool from most recent to oldest */
95+ mutex_enter(&LRU_list_mutex);118+ mutex_enter(&LRU_list_mutex);
96+ bpage = UT_LIST_GET_LAST(buf_pool->LRU);119+ bpage = first_bpage = UT_LIST_GET_FIRST(buf_pool->LRU);
97+120+ total_pages = UT_LIST_GET_LEN(buf_pool->LRU);
98+ buffers = offset = 0;121+
99+ while (bpage != NULL) {122+ buffers = offset = pages_written = 0;
100+ if (offset == 0) {123+ while (bpage != NULL &&
101+ memset(buffer, 0, UNIV_PAGE_SIZE);124+ (srv_lru_dump_old_pages || !buf_page_is_old(bpage)) &&
125+ (pages_written++ < total_pages)) {
126+
127+ buf_page_t* next_bpage = UT_LIST_GET_NEXT(LRU, bpage);
128+
129+ if (next_bpage == first_bpage) {
130+ buf_pool_mutex_exit();
131+ fprintf(stderr,
132+ " InnoDB: detected cycle in LRU, skipping "
133+ "dump\n");
134+ success = FALSE;
135+ goto end;
102+ }136+ }
103+137+
104+ mach_write_to_4(buffer + offset * 4, bpage->space);138+ mach_write_to_4(buffer + offset * 4, bpage->space);
@@ -106,51 +140,84 @@
106+ mach_write_to_4(buffer + offset * 4, bpage->offset);140+ mach_write_to_4(buffer + offset * 4, bpage->offset);
107+ offset++;141+ offset++;
108+142+
109+ if (offset == UNIV_PAGE_SIZE/4) {143+ /* write out one page of data at a time */
110+ success = os_file_write(LRU_DUMP_FILE, dump_file, buffer,144+ if (offset < UNIV_PAGE_SIZE / 4) {
111+ (buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL,145+ bpage = next_bpage;
112+ (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)),146+ continue;
147+ }
148+
149+ /* while writing file, release buffer pool mutex but
150+ keep the next page fixed so we don't worry about
151+ our list iterator becoming invalid */
152+ if (next_bpage) {
153+ next_block_mutex = buf_page_get_mutex(next_bpage);
154+
155+ mutex_enter(next_block_mutex);
156+ next_bpage->buf_fix_count++;
157+ mutex_exit(next_block_mutex);
158+ }
159+ mutex_exit(&LRU_list_mutex);
160+
161+ success = os_file_write(LRU_DUMP_TEMP_FILE, dump_file,
162+ buffer,
163+ (buffers << UNIV_PAGE_SIZE_SHIFT) &
164+ 0xFFFFFFFFUL,
165+ (buffers >>
166+ (32 - UNIV_PAGE_SIZE_SHIFT)),
113+ UNIV_PAGE_SIZE);167+ UNIV_PAGE_SIZE);
114+ if (!success) {168+ memset(buffer, 0, UNIV_PAGE_SIZE);
115+ mutex_exit(&LRU_list_mutex);169+
116+ fprintf(stderr,170+ buf_pool_mutex_enter();
117+ " InnoDB: cannot write page %lu of %s\n",171+ if (next_bpage) {
118+ buffers, LRU_DUMP_FILE);172+ mutex_enter(next_block_mutex);
119+ goto end;173+ next_bpage->buf_fix_count--;
120+ }174+ mutex_exit(next_block_mutex);
121+ buffers++;175+ }
122+ offset = 0;176+ if (!success) {
123+ }177+ mutex_exit(&LRU_list_mutex);
124+178+ fprintf(stderr,
125+ bpage = UT_LIST_GET_PREV(LRU, bpage);179+ " InnoDB: cannot write page %lu of %s\n",
180+ buffers, LRU_DUMP_TEMP_FILE);
181+ goto end;
182+ }
183+ buffers++;
184+ offset = 0;
185+
186+ bpage = next_bpage;
126+ }187+ }
127+ mutex_exit(&LRU_list_mutex);188+ mutex_exit(&LRU_list_mutex);
128+189+
129+ if (offset == 0) {190+ /* mark end of file with 0xFFFFFFFF */
130+ memset(buffer, 0, UNIV_PAGE_SIZE);191+ mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);
131+ }192+ offset++;
132+193+ mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);
133+ mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);194+ offset++;
134+ offset++;195+
135+ mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);196+ success = os_file_write(LRU_DUMP_TEMP_FILE, dump_file, buffer,
136+ offset++;197+ (buffers << UNIV_PAGE_SIZE_SHIFT) &
137+198+ 0xFFFFFFFFUL,
138+ success = os_file_write(LRU_DUMP_FILE, dump_file, buffer,199+ (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)),
139+ (buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL,200+ UNIV_PAGE_SIZE);
140+ (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)),
141+ UNIV_PAGE_SIZE);
142+ if (!success) {201+ if (!success) {
143+ goto end;202+ goto end;
144+ }203+ }
145+204+
146+ ret = TRUE;
147+end:205+end:
148+ if (dump_file != -1)206+ if (dump_file != -1) {
207+ if (success) {
208+ success = os_file_flush(dump_file);
209+ }
149+ os_file_close(dump_file);210+ os_file_close(dump_file);
150+ if (buffer_base)211+ }
212+ if (success) {
213+ success = os_file_rename(LRU_DUMP_TEMP_FILE,
214+ LRU_DUMP_FILE);
215+ }
216+ if (buffer_base) {
151+ ut_free(buffer_base);217+ ut_free(buffer_base);
218+ }
152+219+
153+ return(ret);220+ return(success);
154+}221+}
155+222+
156+typedef struct {223+typedef struct {
@@ -173,7 +240,16 @@
173+}240+}
174+241+
175+/********************************************************************//**242+/********************************************************************//**
176+Read the pages based on the specific file.*/243+Read the pages based on the specific file.
244+
245+Pre-warms the buffer pool by loading the buffer pool pages recorded in
246+LRU_DUMP_FILE by automatic or manual invocation of buf_LRU_file_dump.
247+
248+The pages are loaded in LRU priority order to ensure the most frequently
249+accessed pages are loaded first. While loading in LRU priority order, any
250+lower priority pages that are logically adjacent to higher priority pages are
251+loaded along with the higher priority page. The goal is to maximize the size
252+of the data reads without introducing many additional seeks.*/
177+UNIV_INTERN253+UNIV_INTERN
178+ibool254+ibool
179+buf_LRU_file_restore(void)255+buf_LRU_file_restore(void)
@@ -190,9 +266,17 @@
190+ ibool terminated = FALSE;266+ ibool terminated = FALSE;
191+ ibool ret = FALSE;267+ ibool ret = FALSE;
192+ dump_record_t* records = NULL;268+ dump_record_t* records = NULL;
269+ dump_record_t* sorted_records = NULL;
270+ dump_record_t* current_record;
271+ dump_record_t* prev_record;
272+ dump_record_t* next_record;
273+ unsigned char* records_loaded = NULL;
193+ ulint size;274+ ulint size;
194+ ulint size_high;275+ ulint size_high;
195+ ulint length;276+ ulint length;
277+ ulint nrecs;
278+ ulint recsize = sizeof(dump_record_t);
279+ ullint loop_timer;
196+280+
197+ dump_file = os_file_create_simple_no_error_handling(281+ dump_file = os_file_create_simple_no_error_handling(
198+ LRU_DUMP_FILE, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);282+ LRU_DUMP_FILE, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
@@ -202,16 +286,20 @@
202+ " InnoDB: cannot open %s\n", LRU_DUMP_FILE);286+ " InnoDB: cannot open %s\n", LRU_DUMP_FILE);
203+ goto end;287+ goto end;
204+ }288+ }
205+ if (size == 0 || size_high > 0 || size % 8) {289+ if (size == 0 || size_high > 0 || size % recsize) {
206+ fprintf(stderr, " InnoDB: broken LRU dump file\n");290+ fprintf(stderr, " InnoDB: broken LRU dump file\n");
207+ goto end;291+ goto end;
208+ }292+ }
209+ buffer_base = ut_malloc(2 * UNIV_PAGE_SIZE);293+ buffer_base = ut_malloc(2 * UNIV_PAGE_SIZE);
210+ buffer = ut_align(buffer_base, UNIV_PAGE_SIZE);294+ buffer = ut_align(buffer_base, UNIV_PAGE_SIZE);
211+ records = ut_malloc(size);295+
212+ if (!buffer || !records) {296+ nrecs = size / recsize;
297+ records = ut_malloc(nrecs * recsize);
298+ sorted_records = ut_malloc(nrecs * recsize);
299+ records_loaded = ut_malloc(nrecs * sizeof(unsigned char));
300+ if (!buffer || !records || !sorted_records || !records_loaded) {
213+ fprintf(stderr,301+ fprintf(stderr,
214+ " InnoDB: cannot allocate buffer.\n");302+ " InnoDB: cannot allocate buffer(s).\n");
215+ goto end;303+ goto end;
216+ }304+ }
217+305+
@@ -236,6 +324,7 @@
236+324+
237+ space_id = mach_read_from_4(buffer + offset * 4);325+ space_id = mach_read_from_4(buffer + offset * 4);
238+ page_no = mach_read_from_4(buffer + (offset + 1) * 4);326+ page_no = mach_read_from_4(buffer + (offset + 1) * 4);
327+ /* found list terminator value 0xFFFFFFFF */
239+ if (space_id == 0xFFFFFFFFUL328+ if (space_id == 0xFFFFFFFFUL
240+ || page_no == 0xFFFFFFFFUL) {329+ || page_no == 0xFFFFFFFFUL) {
241+ terminated = TRUE;330+ terminated = TRUE;
@@ -263,9 +352,26 @@
263+ buffers++;352+ buffers++;
264+ }353+ }
265+354+
266+ qsort(records, length, sizeof(dump_record_t), dump_record_cmp);355+ srv_lru_restore_total_pages = length;
267+356+ srv_lru_restore_loaded_pages = 0;
268+ for (offset = 0; offset < length; offset++) {357+
358+ /* Copy the records into a second array and sort them, this will
359+ allow us to identify sequential records so we can load contiguous
360+ data while still prioritizing based on LRU order in the original */
361+ memcpy(sorted_records, records, length * recsize);
362+ qsort(sorted_records, length, recsize, dump_record_cmp);
363+
364+ /* As we will be loading data in a new order, we use this array to
365+ track which records have already been loaded */
366+ memset(records_loaded, 0, length * sizeof(unsigned char));
367+
368+ /* start time */
369+ loop_timer= ut_time_us(NULL);
370+
371+ /* iterate over the LRU in priority order */
372+ for (offset = 0;
373+ offset < ut_min(length, srv_lru_load_max_entries);
374+ offset++) {
269+ ulint space_id;375+ ulint space_id;
270+ ulint page_no;376+ ulint page_no;
271+ ulint zip_size;377+ ulint zip_size;
@@ -273,29 +379,97 @@
273+ ib_int64_t tablespace_version;379+ ib_int64_t tablespace_version;
274+380+
275+ space_id = records[offset].space_id;381+ space_id = records[offset].space_id;
276+ page_no = records[offset].page_no;
277+
278+ if (offset % 16 == 15) {
279+ os_aio_simulated_wake_handler_threads();
280+ buf_flush_free_margin(FALSE);
281+ }
282+
283+ zip_size = fil_space_get_zip_size(space_id);382+ zip_size = fil_space_get_zip_size(space_id);
284+ if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {383+ if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
285+ continue;384+ continue;
286+ }385+ }
287+386+
288+ if (fil_area_is_exist(space_id, zip_size, page_no, 0,387+ /* we iterate over the LRU in priority order, but want to find
289+ zip_size ? zip_size : UNIV_PAGE_SIZE)) {388+ the record's position in the sorted array so we can look for
389+ consecutive runs */
390+ current_record = bsearch(records + offset, sorted_records,
391+ length, sizeof(dump_record_t),
392+ dump_record_cmp);
393+ ut_ad(current_record);
394+
395+ /* check if we already loaded this record as part of another
396+ consecutive run */
397+ if (records_loaded[current_record - sorted_records]) {
398+ continue;
399+ }
400+
401+ /* step backwards in the sorted array until we find the start
402+ of this run of consecutive pages */
403+ while (current_record > sorted_records) {
404+ prev_record = current_record - 1;
405+
406+ if (prev_record->space_id != current_record->space_id ||
407+ prev_record->page_no + 1 !=
408+ current_record->page_no) {
409+ break;
410+ }
411+
412+ current_record = prev_record;
413+ }
414+
415+ /* now step forwards requesting consecutive pages */
416+ while (current_record < sorted_records + length) {
417+ if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
418+ os_aio_simulated_wake_handler_threads();
419+ goto end;
420+ }
421+
422+ records_loaded[current_record - sorted_records] = TRUE;
423+
424+ page_no = current_record->page_no;
425+
426+ if (!fil_area_is_exist(space_id, zip_size, page_no, 0,
427+ zip_size ?
428+ zip_size : UNIV_PAGE_SIZE)) {
429+ break;
430+ }
290+431+
291+ tablespace_version = fil_space_get_version(space_id);432+ tablespace_version = fil_space_get_version(space_id);
292+433+
293+ req++;434+ req++;
294+ reads += buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE435+
295+ | OS_AIO_SIMULATED_WAKE_LATER,436+ /* do not issue more than srv_io_capacity requests per
437+ second */
438+ if (req % srv_io_capacity == 0) {
439+ os_aio_simulated_wake_handler_threads();
440+ buf_flush_free_margin(FALSE);
441+
442+ ullint loop_usecs = ut_time_us(NULL) -
443+ loop_timer;
444+
445+ if (loop_usecs < 1000000) {
446+ os_thread_sleep(1000000 - loop_usecs);
447+ }
448+
449+ loop_timer = ut_time_us(NULL);
450+ }
451+
452+ reads += buf_read_page_low(&err,
453+ FALSE,
454+ BUF_READ_ANY_PAGE |
455+ OS_AIO_SIMULATED_WAKE_LATER,
296+ space_id, zip_size, TRUE,456+ space_id, zip_size, TRUE,
297+ tablespace_version, page_no, NULL);457+ tablespace_version, page_no,
458+ NULL);
298+ buf_LRU_stat_inc_io();459+ buf_LRU_stat_inc_io();
460+
461+ srv_lru_restore_loaded_pages++;
462+
463+ next_record = current_record + 1;
464+
465+ if (next_record >= sorted_records + length ||
466+ current_record->space_id != next_record->space_id ||
467+ current_record->page_no + 1 !=
468+ next_record->page_no) {
469+ break;
470+ }
471+
472+ current_record = next_record;
299+ }473+ }
300+ }474+ }
301+475+
@@ -314,6 +488,10 @@
314+ ut_free(buffer_base);488+ ut_free(buffer_base);
315+ if (records)489+ if (records)
316+ ut_free(records);490+ ut_free(records);
491+ if (sorted_records)
492+ ut_free(sorted_records);
493+ if (records_loaded)
494+ ut_free(records_loaded);
317+495+
318+ return(ret);496+ return(ret);
319+}497+}
@@ -322,8 +500,8 @@
322 /**********************************************************************//**500 /**********************************************************************//**
323 Validates the LRU list.501 Validates the LRU list.
324diff -ruN a/storage/innodb_plugin/buf/buf0rea.c b/storage/innodb_plugin/buf/buf0rea.c502diff -ruN a/storage/innodb_plugin/buf/buf0rea.c b/storage/innodb_plugin/buf/buf0rea.c
325--- a/storage/innodb_plugin/buf/buf0rea.c 2010-08-27 16:32:40.293411717 +0900503--- a/storage/innodb_plugin/buf/buf0rea.c 2011-01-11 19:07:53.000000000 +0300
326+++ b/storage/innodb_plugin/buf/buf0rea.c 2010-08-27 16:34:33.863409016 +0900504+++ b/storage/innodb_plugin/buf/buf0rea.c 2011-01-12 19:46:02.000000000 +0300
327@@ -56,7 +56,7 @@505@@ -56,7 +56,7 @@
328 which case it is never read into the pool, or if the tablespace does506 which case it is never read into the pool, or if the tablespace does
329 not exist or is being dropped 507 not exist or is being dropped
@@ -334,8 +512,8 @@
334 buf_read_page_low(512 buf_read_page_low(
335 /*==============*/513 /*==============*/
336diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c514diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
337--- a/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:32:40.298411400 +0900515--- a/storage/innodb_plugin/fil/fil0fil.c 2011-01-11 19:07:53.000000000 +0300
338+++ b/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:34:33.868058362 +0900516+++ b/storage/innodb_plugin/fil/fil0fil.c 2011-01-12 19:46:02.000000000 +0300
339@@ -4915,6 +4915,78 @@517@@ -4915,6 +4915,78 @@
340 return(DB_SUCCESS);518 return(DB_SUCCESS);
341 }519 }
@@ -416,32 +594,60 @@
416 /**********************************************************************//**594 /**********************************************************************//**
417 Waits for an aio operation to complete. This function is used to write the595 Waits for an aio operation to complete. This function is used to write the
418diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc596diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
419--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-10-01 09:57:56.486228425 +0900597--- a/storage/innodb_plugin/handler/ha_innodb.cc 2011-01-11 19:07:53.000000000 +0300
420+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-10-01 10:00:13.292228546 +0900598+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2011-01-12 19:46:02.000000000 +0300
421@@ -11473,6 +11473,12 @@599@@ -554,6 +554,10 @@
600 (char*) &export_vars.innodb_log_write_requests, SHOW_LONG},
601 {"log_writes",
602 (char*) &export_vars.innodb_log_writes, SHOW_LONG},
603+ {"lru_restore_loaded_pages",
604+ (char*) &export_vars.innodb_lru_restore_loaded_pages, SHOW_LONG},
605+ {"lru_restore_total_pages",
606+ (char*) &export_vars.innodb_lru_restore_total_pages, SHOW_LONG},
607 {"os_log_fsyncs",
608 (char*) &export_vars.innodb_os_log_fsyncs, SHOW_LONG},
609 {"os_log_pending_fsyncs",
610@@ -11473,6 +11477,27 @@
422 "Limit the allocated memory for dictionary cache. (0: unlimited)",611 "Limit the allocated memory for dictionary cache. (0: unlimited)",
423 NULL, NULL, 0, 0, LONG_MAX, 0);612 NULL, NULL, 0, 0, LONG_MAX, 0);
424 613
425+static MYSQL_SYSVAR_UINT(auto_lru_dump, srv_auto_lru_dump,614+static MYSQL_SYSVAR_UINT(auto_lru_dump, srv_auto_lru_dump,
426+ PLUGIN_VAR_RQCMDARG,615+ PLUGIN_VAR_RQCMDARG,
427+ "Time in seconds between automatic buffer pool dumps. "616+ "Time in seconds between automatic buffer pool dumps. "
428+ "0 (the default) disables automatic dumps.",617+ "0 (the default) disables automatic dumps. A non-zero value "
618+ "also enables restoring LRU automatically on startup.",
429+ NULL, NULL, 0, 0, UINT_MAX32, 0);619+ NULL, NULL, 0, 0, UINT_MAX32, 0);
430+620+
621+static MYSQL_SYSVAR_ULONG(lru_load_max_entries, srv_lru_load_max_entries,
622+ PLUGIN_VAR_RQCMDARG,
623+ "Maximum number of LRU entries to restore. The default is 512k entries. "
624+ "Consecutive pages are merged and only count as one, so you will probably "
625+ "load more pages than this number of LRU entries.",
626+ NULL, NULL, 512*1024UL, 1UL, ULONG_MAX, 0);
627+
628+static MYSQL_SYSVAR_BOOL(lru_dump_old_pages, srv_lru_dump_old_pages,
629+ PLUGIN_VAR_NOCMDARG,
630+ "If enabled, will also dump old pages from the LRU. "
631+ "The default is to only dump young pages.",
632+ NULL, NULL, FALSE);
633+
634+
431 static struct st_mysql_sys_var* innobase_system_variables[]= {635 static struct st_mysql_sys_var* innobase_system_variables[]= {
432 MYSQL_SYSVAR(additional_mem_pool_size),636 MYSQL_SYSVAR(additional_mem_pool_size),
433 MYSQL_SYSVAR(autoextend_increment),637 MYSQL_SYSVAR(autoextend_increment),
434@@ -11555,6 +11561,7 @@638@@ -11555,6 +11580,9 @@
435 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */639 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
436 MYSQL_SYSVAR(read_ahead_threshold),640 MYSQL_SYSVAR(read_ahead_threshold),
437 MYSQL_SYSVAR(io_capacity),641 MYSQL_SYSVAR(io_capacity),
438+ MYSQL_SYSVAR(auto_lru_dump),642+ MYSQL_SYSVAR(auto_lru_dump),
643+ MYSQL_SYSVAR(lru_load_max_entries),
644+ MYSQL_SYSVAR(lru_dump_old_pages),
439 MYSQL_SYSVAR(use_purge_thread),645 MYSQL_SYSVAR(use_purge_thread),
440 NULL646 NULL
441 };647 };
442diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc648diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc
443--- a/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:29:12.540979608 +0900649--- a/storage/innodb_plugin/handler/i_s.cc 2011-01-11 19:07:53.000000000 +0300
444+++ b/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:34:33.873058189 +0900650+++ b/storage/innodb_plugin/handler/i_s.cc 2011-01-12 19:46:02.000000000 +0300
445@@ -46,6 +46,7 @@651@@ -46,6 +46,7 @@
446 #include "trx0rseg.h" /* for trx_rseg_struct */652 #include "trx0rseg.h" /* for trx_rseg_struct */
447 #include "trx0sys.h" /* for trx_sys */653 #include "trx0sys.h" /* for trx_sys */
@@ -488,8 +694,8 @@
488 field_store_string(i_s_table->field[0],694 field_store_string(i_s_table->field[0],
489 "Undefined XTRA_* command.");695 "Undefined XTRA_* command.");
490diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h696diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
491--- a/storage/innodb_plugin/handler/innodb_patch_info.h 2010-08-27 16:32:40.313021803 +0900697--- a/storage/innodb_plugin/handler/innodb_patch_info.h 2011-01-11 19:07:53.000000000 +0300
492+++ b/storage/innodb_plugin/handler/innodb_patch_info.h 2010-08-27 16:34:33.871059345 +0900698+++ b/storage/innodb_plugin/handler/innodb_patch_info.h 2011-01-12 19:46:02.000000000 +0300
493@@ -41,5 +41,6 @@699@@ -41,5 +41,6 @@
494 {"innodb_admin_command_base","XtraDB specific command interface through i_s","","http://www.percona.com/docs/wiki/percona-xtradb"},700 {"innodb_admin_command_base","XtraDB specific command interface through i_s","","http://www.percona.com/docs/wiki/percona-xtradb"},
495 {"innodb_show_lock_name","Show mutex/lock name instead of crated file/line","","http://www.percona.com/docs/wiki/percona-xtradb"},701 {"innodb_show_lock_name","Show mutex/lock name instead of crated file/line","","http://www.percona.com/docs/wiki/percona-xtradb"},
@@ -498,8 +704,8 @@
498 {NULL, NULL, NULL, NULL}704 {NULL, NULL, NULL, NULL}
499 };705 };
500diff -ruN a/storage/innodb_plugin/include/buf0lru.h b/storage/innodb_plugin/include/buf0lru.h706diff -ruN a/storage/innodb_plugin/include/buf0lru.h b/storage/innodb_plugin/include/buf0lru.h
501--- a/storage/innodb_plugin/include/buf0lru.h 2010-08-27 16:13:11.085978393 +0900707--- a/storage/innodb_plugin/include/buf0lru.h 2011-01-11 19:07:52.000000000 +0300
502+++ b/storage/innodb_plugin/include/buf0lru.h 2010-08-27 16:34:33.875100517 +0900708+++ b/storage/innodb_plugin/include/buf0lru.h 2011-01-11 19:07:54.000000000 +0300
503@@ -213,6 +213,18 @@709@@ -213,6 +213,18 @@
504 void710 void
505 buf_LRU_stat_update(void);711 buf_LRU_stat_update(void);
@@ -520,8 +726,8 @@
520 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG726 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
521 /**********************************************************************//**727 /**********************************************************************//**
522diff -ruN a/storage/innodb_plugin/include/buf0rea.h b/storage/innodb_plugin/include/buf0rea.h728diff -ruN a/storage/innodb_plugin/include/buf0rea.h b/storage/innodb_plugin/include/buf0rea.h
523--- a/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:32:40.314021595 +0900729--- a/storage/innodb_plugin/include/buf0rea.h 2011-01-11 19:07:53.000000000 +0300
524+++ b/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:34:33.877059445 +0900730+++ b/storage/innodb_plugin/include/buf0rea.h 2011-01-11 19:07:54.000000000 +0300
525@@ -31,6 +31,37 @@731@@ -31,6 +31,37 @@
526 #include "buf0types.h"732 #include "buf0types.h"
527 733
@@ -561,8 +767,8 @@
561 buffer buf_pool if it is not already there. Sets the io_fix flag and sets767 buffer buf_pool if it is not already there. Sets the io_fix flag and sets
562 an exclusive lock on the buffer frame. The flag is cleared and the x-lock768 an exclusive lock on the buffer frame. The flag is cleared and the x-lock
563diff -ruN a/storage/innodb_plugin/include/fil0fil.h b/storage/innodb_plugin/include/fil0fil.h769diff -ruN a/storage/innodb_plugin/include/fil0fil.h b/storage/innodb_plugin/include/fil0fil.h
564--- a/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:32:40.315012507 +0900770--- a/storage/innodb_plugin/include/fil0fil.h 2011-01-11 19:07:53.000000000 +0300
565+++ b/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:34:33.878063455 +0900771+++ b/storage/innodb_plugin/include/fil0fil.h 2011-01-12 19:46:02.000000000 +0300
566@@ -643,6 +643,22 @@772@@ -643,6 +643,22 @@
567 void* message, /*!< in: message for aio handler if non-sync773 void* message, /*!< in: message for aio handler if non-sync
568 aio used, else ignored */774 aio used, else ignored */
@@ -587,19 +793,33 @@
587 Waits for an aio operation to complete. This function is used to write the793 Waits for an aio operation to complete. This function is used to write the
588 handler for completed requests. The aio array of pending requests is divided794 handler for completed requests. The aio array of pending requests is divided
589diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h795diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
590--- a/storage/innodb_plugin/include/srv0srv.h 2010-10-01 09:57:56.500228711 +0900796--- a/storage/innodb_plugin/include/srv0srv.h 2011-01-11 19:07:53.000000000 +0300
591+++ b/storage/innodb_plugin/include/srv0srv.h 2010-10-01 10:00:13.302223409 +0900797+++ b/storage/innodb_plugin/include/srv0srv.h 2011-01-12 19:46:02.000000000 +0300
592@@ -334,6 +334,9 @@798@@ -334,6 +334,23 @@
593 reading of a disk page */799 reading of a disk page */
594 extern ulint srv_buf_pool_reads;800 extern ulint srv_buf_pool_reads;
595 801
596+/** Time in seconds between automatic buffer pool dumps */802+/** Time in seconds between automatic buffer pool dumps */
597+extern uint srv_auto_lru_dump;803+extern uint srv_auto_lru_dump;
598+804+
805+/** Maximum number of LRU entries to restore
806+Consecutive pages are merged and only count as one, so you will probably
807+load more pages than this number of LRU entries. */
808+extern ulint srv_lru_load_max_entries;
809+
810+/** If enabled, will also dump old pages from the LRU */
811+extern my_bool srv_lru_dump_old_pages;
812+
813+/** Number of buffer pool pages already restored */
814+extern ulint srv_lru_restore_loaded_pages;
815+
816+/** Number of buffer pool pages in restore list */
817+extern ulint srv_lru_restore_total_pages;
818+
599 /** Status variables to be passed to MySQL */819 /** Status variables to be passed to MySQL */
600 typedef struct export_var_struct export_struc;820 typedef struct export_var_struct export_struc;
601 821
602@@ -602,6 +605,16 @@822@@ -602,6 +619,16 @@
603 /*=====================*/823 /*=====================*/
604 void* arg); /*!< in: a dummy parameter required by824 void* arg); /*!< in: a dummy parameter required by
605 os_thread_create */825 os_thread_create */
@@ -616,28 +836,60 @@
616 /******************************************************************//**836 /******************************************************************//**
617 Outputs to a file the output of the InnoDB Monitor.837 Outputs to a file the output of the InnoDB Monitor.
618 @return FALSE if not all information printed838 @return FALSE if not all information printed
839@@ -683,6 +710,11 @@
840 ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */
841 ulint innodb_rows_updated; /*!< srv_n_rows_updated */
842 ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
843+
844+ ulint innodb_lru_restore_loaded_pages; /*!<srv_lru_restore_loaded_pages
845+ */
846+ ulint innodb_lru_restore_total_pages; /*!<srv_lru_restore_total_pages
847+ */
848 };
849
850 /** The server system struct */
619diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c851diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
620--- a/storage/innodb_plugin/srv/srv0srv.c 2010-10-01 09:57:56.516255101 +0900852--- a/storage/innodb_plugin/srv/srv0srv.c 2011-01-11 19:07:53.000000000 +0300
621+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-10-01 10:00:13.304230973 +0900853+++ b/storage/innodb_plugin/srv/srv0srv.c 2011-01-12 19:46:02.000000000 +0300
622@@ -298,6 +298,9 @@854@@ -298,6 +298,23 @@
623 reading of a disk page */855 reading of a disk page */
624 UNIV_INTERN ulint srv_buf_pool_reads = 0;856 UNIV_INTERN ulint srv_buf_pool_reads = 0;
625 857
626+/** Time in seconds between automatic buffer pool dumps */858+/** Time in seconds between automatic buffer pool dumps */
627+UNIV_INTERN uint srv_auto_lru_dump = 0;859+UNIV_INTERN uint srv_auto_lru_dump = 0;
628+860+
861+/** Maximum number of LRU entries to restore
862+Consecutive pages are merged and only count as one, so you will probably
863+load more pages than this number of LRU entries. */
864+UNIV_INTERN ulint srv_lru_load_max_entries = 512*1024;
865+
866+/** If enabled, will also dump old pages from the LRU */
867+UNIV_INTERN my_bool srv_lru_dump_old_pages = FALSE;
868+
869+/** Number of buffer pool pages already restored */
870+UNIV_INTERN ulint srv_lru_restore_loaded_pages = 0;
871+
872+/** Number of buffer pool pages in restore list */
873+UNIV_INTERN ulint srv_lru_restore_total_pages = 0;
874+
629 /* structure to pass status variables to MySQL */875 /* structure to pass status variables to MySQL */
630 UNIV_INTERN export_struc export_vars;876 UNIV_INTERN export_struc export_vars;
631 877
632@@ -2537,6 +2540,56 @@878@@ -2178,6 +2195,10 @@
633 /* We count the number of threads in os_thread_exit(). A created879 export_vars.innodb_rows_inserted = srv_n_rows_inserted;
634 thread should always use that to exit and not use return() to exit. */880 export_vars.innodb_rows_updated = srv_n_rows_updated;
635 881 export_vars.innodb_rows_deleted = srv_n_rows_deleted;
636+ os_thread_exit(NULL);882+ export_vars.innodb_lru_restore_loaded_pages =
637+883+ srv_lru_restore_loaded_pages;
638+ OS_THREAD_DUMMY_RETURN;884+ export_vars.innodb_lru_restore_total_pages =
639+}885+ srv_lru_restore_total_pages;
640+886
887 mutex_exit(&srv_innodb_monitor_mutex);
888 }
889@@ -2542,6 +2563,60 @@
890 OS_THREAD_DUMMY_RETURN;
891 }
892
641+/*********************************************************************//**893+/*********************************************************************//**
642+A thread which restores the buffer pool from a dump file on startup and does894+A thread which restores the buffer pool from a dump file on startup and does
643+periodic buffer pool dumps.895+periodic buffer pool dumps.
@@ -662,10 +914,14 @@
662+ if (srv_auto_lru_dump)914+ if (srv_auto_lru_dump)
663+ buf_LRU_file_restore();915+ buf_LRU_file_restore();
664+916+
917+ if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
918+ goto exit_func;
919+ }
920+
665+ last_dump_time = time(NULL);921+ last_dump_time = time(NULL);
666+922+
667+loop:923+loop:
668+ os_thread_sleep(5000000);924+ os_thread_sleep(1000000);
669+925+
670+ if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {926+ if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
671+ goto exit_func;927+ goto exit_func;
@@ -683,12 +939,17 @@
683+ /* We count the number of threads in os_thread_exit(). A created939+ /* We count the number of threads in os_thread_exit(). A created
684+ thread should always use that to exit and not use return() to exit. */940+ thread should always use that to exit and not use return() to exit. */
685+941+
686 os_thread_exit(NULL);942+ os_thread_exit(NULL);
687 943+
688 OS_THREAD_DUMMY_RETURN;944+ OS_THREAD_DUMMY_RETURN;
945+}
946+
947 /*******************************************************************//**
948 Tells the InnoDB server that there has been activity in the database
949 and wakes up the master thread if it is suspended (not sleeping). Used
689diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c950diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
690--- a/storage/innodb_plugin/srv/srv0start.c 2010-10-01 09:57:56.420229366 +0900951--- a/storage/innodb_plugin/srv/srv0start.c 2011-01-11 19:07:53.000000000 +0300
691+++ b/storage/innodb_plugin/srv/srv0start.c 2010-10-01 10:00:13.309260428 +0900952+++ b/storage/innodb_plugin/srv/srv0start.c 2011-01-12 19:46:02.000000000 +0300
692@@ -126,9 +126,9 @@953@@ -126,9 +126,9 @@
693 static ulint ios;954 static ulint ios;
694 955
695956
=== modified file 'innodb_pass_corrupt_table.patch'
--- innodb_pass_corrupt_table.patch 2010-12-16 11:35:26 +0000
+++ innodb_pass_corrupt_table.patch 2011-01-12 17:48:16 +0000
@@ -778,7 +778,7 @@
778diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc778diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
779--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:38:38.249059616 +0900779--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:38:38.249059616 +0900
780+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:39:02.960021471 +0900780+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:39:02.960021471 +0900
781@@ -3716,6 +3716,12 @@781@@ -3720,6 +3720,12 @@
782 DBUG_RETURN(1);782 DBUG_RETURN(1);
783 }783 }
784 784
@@ -791,7 +791,7 @@
791 /* Create buffers for packing the fields of a record. Why791 /* Create buffers for packing the fields of a record. Why
792 table->reclength did not work here? Obviously, because char792 table->reclength did not work here? Obviously, because char
793 fields when packed actually became 1 byte longer, when we also793 fields when packed actually became 1 byte longer, when we also
794@@ -3743,6 +3749,19 @@794@@ -3747,6 +3753,19 @@
795 /* Get pointer to a table object in InnoDB dictionary cache */795 /* Get pointer to a table object in InnoDB dictionary cache */
796 ib_table = dict_table_get(norm_name, TRUE);796 ib_table = dict_table_get(norm_name, TRUE);
797 797
@@ -811,7 +811,7 @@
811 if (NULL == ib_table) {811 if (NULL == ib_table) {
812 if (is_part && retries < 10) {812 if (is_part && retries < 10) {
813 ++retries;813 ++retries;
814@@ -4909,6 +4928,10 @@814@@ -4913,6 +4932,10 @@
815 815
816 ha_statistic_increment(&SSV::ha_write_count);816 ha_statistic_increment(&SSV::ha_write_count);
817 817
@@ -822,7 +822,7 @@
822 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)822 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
823 table->timestamp_field->set_time();823 table->timestamp_field->set_time();
824 824
825@@ -5126,6 +5149,10 @@825@@ -5130,6 +5153,10 @@
826 func_exit:826 func_exit:
827 innobase_active_small();827 innobase_active_small();
828 828
@@ -833,7 +833,7 @@
833 DBUG_RETURN(error_result);833 DBUG_RETURN(error_result);
834 }834 }
835 835
836@@ -5302,6 +5329,10 @@836@@ -5306,6 +5333,10 @@
837 837
838 ha_statistic_increment(&SSV::ha_update_count);838 ha_statistic_increment(&SSV::ha_update_count);
839 839
@@ -844,7 +844,7 @@
844 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)844 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
845 table->timestamp_field->set_time();845 table->timestamp_field->set_time();
846 846
847@@ -5391,6 +5422,10 @@847@@ -5395,6 +5426,10 @@
848 848
849 innobase_active_small();849 innobase_active_small();
850 850
@@ -855,7 +855,7 @@
855 DBUG_RETURN(error);855 DBUG_RETURN(error);
856 }856 }
857 857
858@@ -5412,6 +5447,10 @@858@@ -5416,6 +5451,10 @@
859 859
860 ha_statistic_increment(&SSV::ha_delete_count);860 ha_statistic_increment(&SSV::ha_delete_count);
861 861
@@ -866,7 +866,7 @@
866 if (!prebuilt->upd_node) {866 if (!prebuilt->upd_node) {
867 row_get_prebuilt_update_vector(prebuilt);867 row_get_prebuilt_update_vector(prebuilt);
868 }868 }
869@@ -5438,6 +5477,10 @@869@@ -5442,6 +5481,10 @@
870 870
871 innobase_active_small();871 innobase_active_small();
872 872
@@ -877,7 +877,7 @@
877 DBUG_RETURN(error);877 DBUG_RETURN(error);
878 }878 }
879 879
880@@ -5677,6 +5720,10 @@880@@ -5681,6 +5724,10 @@
881 881
882 ha_statistic_increment(&SSV::ha_read_key_count);882 ha_statistic_increment(&SSV::ha_read_key_count);
883 883
@@ -888,7 +888,7 @@
888 index = prebuilt->index;888 index = prebuilt->index;
889 889
890 if (UNIV_UNLIKELY(index == NULL)) {890 if (UNIV_UNLIKELY(index == NULL)) {
891@@ -5742,6 +5789,10 @@891@@ -5746,6 +5793,10 @@
892 ret = DB_UNSUPPORTED;892 ret = DB_UNSUPPORTED;
893 }893 }
894 894
@@ -899,7 +899,7 @@
899 switch (ret) {899 switch (ret) {
900 case DB_SUCCESS:900 case DB_SUCCESS:
901 error = 0;901 error = 0;
902@@ -5852,6 +5903,10 @@902@@ -5856,6 +5907,10 @@
903 {903 {
904 DBUG_ENTER("change_active_index");904 DBUG_ENTER("change_active_index");
905 905
@@ -910,7 +910,7 @@
910 ut_ad(user_thd == ha_thd());910 ut_ad(user_thd == ha_thd());
911 ut_a(prebuilt->trx == thd_to_trx(user_thd));911 ut_a(prebuilt->trx == thd_to_trx(user_thd));
912 912
913@@ -5942,6 +5997,10 @@913@@ -5946,6 +6001,10 @@
914 914
915 DBUG_ENTER("general_fetch");915 DBUG_ENTER("general_fetch");
916 916
@@ -921,7 +921,7 @@
921 ut_a(prebuilt->trx == thd_to_trx(user_thd));921 ut_a(prebuilt->trx == thd_to_trx(user_thd));
922 922
923 innodb_srv_conc_enter_innodb(prebuilt->trx);923 innodb_srv_conc_enter_innodb(prebuilt->trx);
924@@ -5951,6 +6010,10 @@924@@ -5955,6 +6014,10 @@
925 925
926 innodb_srv_conc_exit_innodb(prebuilt->trx);926 innodb_srv_conc_exit_innodb(prebuilt->trx);
927 927
@@ -932,7 +932,7 @@
932 switch (ret) {932 switch (ret) {
933 case DB_SUCCESS:933 case DB_SUCCESS:
934 error = 0;934 error = 0;
935@@ -7201,6 +7264,10 @@935@@ -7205,6 +7268,10 @@
936 DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);936 DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
937 }937 }
938 938
@@ -943,7 +943,7 @@
943 /* Truncate the table in InnoDB */943 /* Truncate the table in InnoDB */
944 944
945 error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);945 error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
946@@ -7209,6 +7276,10 @@946@@ -7213,6 +7280,10 @@
947 goto fallback;947 goto fallback;
948 }948 }
949 949
@@ -954,7 +954,7 @@
954 error = convert_error_code_to_mysql(error, prebuilt->table->flags,954 error = convert_error_code_to_mysql(error, prebuilt->table->flags,
955 NULL);955 NULL);
956 956
957@@ -7721,6 +7792,16 @@957@@ -7725,6 +7796,16 @@
958 return(ranges + (double) rows / (double) total_rows * time_for_scan);958 return(ranges + (double) rows / (double) total_rows * time_for_scan);
959 }959 }
960 960
@@ -971,7 +971,7 @@
971 /*********************************************************************//**971 /*********************************************************************//**
972 Calculates the key number used inside MySQL for an Innobase index. We will972 Calculates the key number used inside MySQL for an Innobase index. We will
973 first check the "index translation table" for a match of the index to get973 first check the "index translation table" for a match of the index to get
974@@ -7842,7 +7923,7 @@974@@ -7846,7 +7927,7 @@
975 ib_table = prebuilt->table;975 ib_table = prebuilt->table;
976 976
977 if (flag & HA_STATUS_TIME) {977 if (flag & HA_STATUS_TIME) {
@@ -980,7 +980,7 @@
980 /* In sql_show we call with this flag: update980 /* In sql_show we call with this flag: update
981 then statistics so that they are up-to-date */981 then statistics so that they are up-to-date */
982 982
983@@ -8133,10 +8214,18 @@983@@ -8137,10 +8218,18 @@
984 THD* thd, /*!< in: connection thread handle */984 THD* thd, /*!< in: connection thread handle */
985 HA_CHECK_OPT* check_opt) /*!< in: currently ignored */985 HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
986 {986 {
@@ -999,7 +999,7 @@
999 return(0);999 return(0);
1000 }1000 }
1001 1001
1002@@ -8318,6 +8407,10 @@1002@@ -8322,6 +8411,10 @@
1003 my_error(ER_QUERY_INTERRUPTED, MYF(0));1003 my_error(ER_QUERY_INTERRUPTED, MYF(0));
1004 }1004 }
1005 1005
@@ -1010,7 +1010,7 @@
1010 DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);1010 DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
1011 }1011 }
1012 1012
1013@@ -9043,6 +9136,10 @@1013@@ -9047,6 +9140,10 @@
1014 1014
1015 update_thd(thd);1015 update_thd(thd);
1016 1016
@@ -1021,9 +1021,9 @@
1021 if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {1021 if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
1022 ut_print_timestamp(stderr);1022 ut_print_timestamp(stderr);
1023 fprintf(stderr,1023 fprintf(stderr,
1024@@ -11487,6 +11584,14 @@1024@@ -11506,6 +11603,14 @@
1025 "0 (the default) disables automatic dumps.",1025 NULL, NULL, FALSE);
1026 NULL, NULL, 0, 0, UINT_MAX32, 0);1026
1027 1027
1028+static MYSQL_SYSVAR_ULONG(pass_corrupt_table, srv_pass_corrupt_table,1028+static MYSQL_SYSVAR_ULONG(pass_corrupt_table, srv_pass_corrupt_table,
1029+ PLUGIN_VAR_RQCMDARG,1029+ PLUGIN_VAR_RQCMDARG,
@@ -1036,9 +1036,9 @@
1036 static struct st_mysql_sys_var* innobase_system_variables[]= {1036 static struct st_mysql_sys_var* innobase_system_variables[]= {
1037 MYSQL_SYSVAR(additional_mem_pool_size),1037 MYSQL_SYSVAR(additional_mem_pool_size),
1038 MYSQL_SYSVAR(autoextend_increment),1038 MYSQL_SYSVAR(autoextend_increment),
1039@@ -11572,6 +11677,7 @@1039@@ -11593,6 +11698,7 @@
1040 MYSQL_SYSVAR(io_capacity),1040 MYSQL_SYSVAR(lru_load_max_entries),
1041 MYSQL_SYSVAR(auto_lru_dump),1041 MYSQL_SYSVAR(lru_dump_old_pages),
1042 MYSQL_SYSVAR(use_purge_thread),1042 MYSQL_SYSVAR(use_purge_thread),
1043+ MYSQL_SYSVAR(pass_corrupt_table),1043+ MYSQL_SYSVAR(pass_corrupt_table),
1044 NULL1044 NULL
@@ -1343,7 +1343,7 @@
1343diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c1343diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
1344--- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:38:38.286989546 +09001344--- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:38:38.286989546 +0900
1345+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:39:03.048990992 +09001345+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:39:03.048990992 +0900
1346@@ -402,6 +402,7 @@1346@@ -416,6 +416,7 @@
1347 UNIV_INTERN ulint srv_adaptive_checkpoint = 0; /* 0: none 1: reflex 2: estimate */1347 UNIV_INTERN ulint srv_adaptive_checkpoint = 0; /* 0: none 1: reflex 2: estimate */
1348 1348
1349 UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */1349 UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */
13501350
=== modified file 'innodb_separate_doublewrite.patch'
--- innodb_separate_doublewrite.patch 2010-12-16 11:35:26 +0000
+++ innodb_separate_doublewrite.patch 2011-01-12 17:48:16 +0000
@@ -340,7 +340,7 @@
340 340
341 /* Note: This variable can be set to on/off and any of the supported341 /* Note: This variable can be set to on/off and any of the supported
342 file formats in the configuration file, but can only be set to any342 file formats in the configuration file, but can only be set to any
343@@ -2248,6 +2249,8 @@343@@ -2252,6 +2253,8 @@
344 goto error;344 goto error;
345 }345 }
346 346
@@ -349,7 +349,7 @@
349 srv_extra_undoslots = (ibool) innobase_extra_undoslots;349 srv_extra_undoslots = (ibool) innobase_extra_undoslots;
350 350
351 srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table;351 srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table;
352@@ -11321,6 +11324,11 @@352@@ -11325,6 +11328,11 @@
353 "Path to individual files and their sizes.",353 "Path to individual files and their sizes.",
354 NULL, NULL, NULL);354 NULL, NULL, NULL);
355 355
@@ -361,7 +361,7 @@
361 static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,361 static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
362 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,362 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
363 "The AUTOINC lock modes supported by InnoDB: "363 "The AUTOINC lock modes supported by InnoDB: "
364@@ -11487,6 +11495,7 @@364@@ -11506,6 +11514,7 @@
365 MYSQL_SYSVAR(commit_concurrency),365 MYSQL_SYSVAR(commit_concurrency),
366 MYSQL_SYSVAR(concurrency_tickets),366 MYSQL_SYSVAR(concurrency_tickets),
367 MYSQL_SYSVAR(data_file_path),367 MYSQL_SYSVAR(data_file_path),
368368
=== modified file 'innodb_show_sys_tables.patch'
--- innodb_show_sys_tables.patch 2010-12-16 11:35:26 +0000
+++ innodb_show_sys_tables.patch 2011-01-12 17:48:16 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc8diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
9--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:45:46.194411503 +09009--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:45:46.194411503 +0900
10+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:49:26.171990559 +090010+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:49:26.171990559 +0900
11@@ -11793,6 +11793,9 @@11@@ -11814,6 +11814,9 @@
12 i_s_innodb_table_stats,12 i_s_innodb_table_stats,
13 i_s_innodb_index_stats,13 i_s_innodb_index_stats,
14 i_s_innodb_admin_command,14 i_s_innodb_admin_command,
@@ -29,13 +29,10 @@
29 #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */29 #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */
30 }30 }
31 31
32@@ -3112,6 +3113,664 @@32@@ -3115,3 +3116,661 @@
33 STRUCT_FLD(deinit, i_s_common_deinit),33 STRUCT_FLD(system_vars, NULL),
34 STRUCT_FLD(version, 0x0100 /* 1.0 */),34 STRUCT_FLD(__reserved1, NULL)
35 STRUCT_FLD(status_vars, NULL),35 };
36+ STRUCT_FLD(system_vars, NULL),
37+ STRUCT_FLD(__reserved1, NULL)
38+};
39+36+
40+static ST_FIELD_INFO i_s_innodb_sys_tables_info[] =37+static ST_FIELD_INFO i_s_innodb_sys_tables_info[] =
41+{38+{
@@ -691,9 +688,9 @@
691+ STRUCT_FLD(deinit, i_s_common_deinit),688+ STRUCT_FLD(deinit, i_s_common_deinit),
692+ STRUCT_FLD(version, 0x0100 /* 1.0 */),689+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
693+ STRUCT_FLD(status_vars, NULL),690+ STRUCT_FLD(status_vars, NULL),
694 STRUCT_FLD(system_vars, NULL),691+ STRUCT_FLD(system_vars, NULL),
695 STRUCT_FLD(__reserved1, NULL)692+ STRUCT_FLD(__reserved1, NULL)
696 };693+};
697diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/i_s.h694diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/i_s.h
698--- a/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:29:12.542982379 +0900695--- a/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:29:12.542982379 +0900
699+++ b/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:49:26.179990535 +0900696+++ b/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:49:26.179990535 +0900
700697
=== modified file 'profiling_slow.patch'
--- profiling_slow.patch 2010-12-22 20:15:33 +0000
+++ profiling_slow.patch 2011-01-12 17:48:16 +0000
@@ -95,9 +95,9 @@
95diff -ruN a/sql/log.cc b/sql/log.cc95diff -ruN a/sql/log.cc b/sql/log.cc
96--- a/sql/log.cc 2010-11-24 19:33:02.000000000 +030096--- a/sql/log.cc 2010-11-24 19:33:02.000000000 +0300
97+++ b/sql/log.cc 2010-11-24 19:36:29.000000000 +030097+++ b/sql/log.cc 2010-11-24 19:36:29.000000000 +0300
98@@ -2433,6 +2433,11 @@98@@ -2434,6 +2434,11 @@
99 my_b_printf(&log_file,"# No InnoDB statistics available for this query\n") == (uint) -1)99 my_b_printf(&log_file,"# No InnoDB statistics available for this query\n") == (uint) -1)
100 tmp_errno=errno;100 tmp_errno= errno;
101 }101 }
102+102+
103+#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)103+#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
104104
=== modified file 'response-time-distribution.patch'
--- response-time-distribution.patch 2010-12-22 20:15:33 +0000
+++ response-time-distribution.patch 2011-01-12 17:48:16 +0000
@@ -755,7 +755,7 @@
755 case SCH_COLLATION_CHARACTER_SET_APPLICABILITY:755 case SCH_COLLATION_CHARACTER_SET_APPLICABILITY:
756 case SCH_USER_PRIVILEGES:756 case SCH_USER_PRIVILEGES:
757 case SCH_SCHEMA_PRIVILEGES:757 case SCH_SCHEMA_PRIVILEGES:
758@@ -7234,6 +7250,12 @@758@@ -7235,6 +7251,12 @@
759 init_global_index_stats();759 init_global_index_stats();
760 pthread_mutex_unlock(&LOCK_global_index_stats);760 pthread_mutex_unlock(&LOCK_global_index_stats);
761 }761 }
762762
=== modified file 'show_slave_status_nolock.patch'
--- show_slave_status_nolock.patch 2010-12-17 19:06:49 +0000
+++ show_slave_status_nolock.patch 2011-01-12 17:48:16 +0000
@@ -61,7 +61,7 @@
61 sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;61 sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;
62 sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;62 sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;
63 sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND;63 sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND;
64@@ -2545,12 +2546,16 @@64@@ -2546,12 +2547,16 @@
65 pthread_mutex_unlock(&LOCK_active_mi);65 pthread_mutex_unlock(&LOCK_active_mi);
66 break;66 break;
67 }67 }
@@ -79,7 +79,7 @@
79 if (active_mi != NULL)79 if (active_mi != NULL)
80 {80 {
81 res = show_master_info(thd, active_mi);81 res = show_master_info(thd, active_mi);
82@@ -2561,7 +2566,10 @@82@@ -2562,7 +2567,10 @@
83 WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO));83 WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO));
84 my_ok(thd);84 my_ok(thd);
85 }85 }
8686
=== modified file 'show_temp_51.patch'
--- show_temp_51.patch 2010-12-16 11:35:26 +0000
+++ show_temp_51.patch 2011-01-12 17:48:16 +0000
@@ -50,7 +50,7 @@
50 case SCH_VIEWS:50 case SCH_VIEWS:
51 case SCH_TRIGGERS:51 case SCH_TRIGGERS:
52 case SCH_EVENTS:52 case SCH_EVENTS:
53@@ -2317,6 +2322,7 @@53@@ -2318,6 +2323,7 @@
54 }54 }
55 case SQLCOM_SHOW_DATABASES:55 case SQLCOM_SHOW_DATABASES:
56 case SQLCOM_SHOW_TABLES:56 case SQLCOM_SHOW_TABLES:
@@ -58,7 +58,7 @@
58 case SQLCOM_SHOW_TRIGGERS:58 case SQLCOM_SHOW_TRIGGERS:
59 case SQLCOM_SHOW_TABLE_STATUS:59 case SQLCOM_SHOW_TABLE_STATUS:
60 case SQLCOM_SHOW_OPEN_TABLES:60 case SQLCOM_SHOW_OPEN_TABLES:
61@@ -5457,6 +5463,8 @@61@@ -5458,6 +5464,8 @@
62 62
63 case SCH_TABLE_NAMES:63 case SCH_TABLE_NAMES:
64 case SCH_TABLES:64 case SCH_TABLES:
6565
=== modified file 'userstat.patch'
--- userstat.patch 2011-01-04 11:30:51 +0000
+++ userstat.patch 2011-01-12 17:48:16 +0000
@@ -436,7 +436,7 @@
436 436
437 /*437 /*
438 Log slow query with all enabled log event handlers438 Log slow query with all enabled log event handlers
439@@ -4495,6 +4517,8 @@439@@ -4496,6 +4518,8 @@
440 thd->first_successful_insert_id_in_prev_stmt_for_binlog);440 thd->first_successful_insert_id_in_prev_stmt_for_binlog);
441 if (e.write(file))441 if (e.write(file))
442 goto err;442 goto err;
@@ -445,7 +445,7 @@
445 }445 }
446 if (thd->auto_inc_intervals_in_cur_stmt_for_binlog.nb_elements() > 0)446 if (thd->auto_inc_intervals_in_cur_stmt_for_binlog.nb_elements() > 0)
447 {447 {
448@@ -4506,12 +4530,16 @@448@@ -4507,12 +4531,16 @@
449 minimum());449 minimum());
450 if (e.write(file))450 if (e.write(file))
451 goto err;451 goto err;
@@ -462,7 +462,7 @@
462 }462 }
463 if (thd->user_var_events.elements)463 if (thd->user_var_events.elements)
464 {464 {
465@@ -4527,6 +4555,8 @@465@@ -4528,6 +4556,8 @@
466 user_var_event->charset_number);466 user_var_event->charset_number);
467 if (e.write(file))467 if (e.write(file))
468 goto err;468 goto err;
@@ -471,7 +471,7 @@
471 }471 }
472 }472 }
473 }473 }
474@@ -4539,6 +4569,8 @@474@@ -4540,6 +4570,8 @@
475 if (event_info->write(file) || 475 if (event_info->write(file) ||
476 DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0))476 DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0))
477 goto err;477 goto err;
@@ -480,7 +480,7 @@
480 480
481 if (file == &log_file) // we are writing to the real log (disk)481 if (file == &log_file) // we are writing to the real log (disk)
482 {482 {
483@@ -4684,7 +4716,7 @@483@@ -4685,7 +4717,7 @@
484 be reset as a READ_CACHE to be able to read the contents from it.484 be reset as a READ_CACHE to be able to read the contents from it.
485 */485 */
486 486
@@ -489,7 +489,7 @@
489 {489 {
490 Mutex_sentry sentry(lock_log ? &LOCK_log : NULL);490 Mutex_sentry sentry(lock_log ? &LOCK_log : NULL);
491 491
492@@ -4732,6 +4764,7 @@492@@ -4733,6 +4765,7 @@
493 /* write the first half of the split header */493 /* write the first half of the split header */
494 if (my_b_write(&log_file, header, carry))494 if (my_b_write(&log_file, header, carry))
495 return ER_ERROR_ON_WRITE;495 return ER_ERROR_ON_WRITE;
@@ -497,7 +497,7 @@
497 497
498 /*498 /*
499 copy fixed second half of header to cache so the correct499 copy fixed second half of header to cache so the correct
500@@ -4800,6 +4833,7 @@500@@ -4801,6 +4834,7 @@
501 /* Write data to the binary log file */501 /* Write data to the binary log file */
502 if (my_b_write(&log_file, cache->read_pos, length))502 if (my_b_write(&log_file, cache->read_pos, length))
503 return ER_ERROR_ON_WRITE;503 return ER_ERROR_ON_WRITE;
@@ -505,7 +505,7 @@
505 cache->read_pos=cache->read_end; // Mark buffer used up505 cache->read_pos=cache->read_end; // Mark buffer used up
506 } while ((length= my_b_fill(cache)));506 } while ((length= my_b_fill(cache)));
507 507
508@@ -4922,21 +4956,24 @@508@@ -4923,21 +4957,24 @@
509 */509 */
510 if (qinfo.write(&log_file))510 if (qinfo.write(&log_file))
511 goto err;511 goto err;
@@ -984,7 +984,7 @@
984 uint32 server_id;984 uint32 server_id;
985 uint32 file_id; // for LOAD DATA INFILE985 uint32 file_id; // for LOAD DATA INFILE
986 /* remote (peer) port */986 /* remote (peer) port */
987@@ -1828,6 +1830,8 @@987@@ -1833,6 +1835,8 @@
988 /* variables.transaction_isolation is reset to this after each commit */988 /* variables.transaction_isolation is reset to this after each commit */
989 enum_tx_isolation session_tx_isolation;989 enum_tx_isolation session_tx_isolation;
990 enum_check_fields count_cuted_fields;990 enum_check_fields count_cuted_fields;
@@ -993,7 +993,7 @@
993 993
994 DYNAMIC_ARRAY user_var_events; /* For user variables replication */994 DYNAMIC_ARRAY user_var_events; /* For user variables replication */
995 MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */995 MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
996@@ -1916,6 +1920,49 @@996@@ -1921,6 +1925,49 @@
997 */997 */
998 LOG_INFO* current_linfo;998 LOG_INFO* current_linfo;
999 NET* slave_net; // network connection from slave -> m.999 NET* slave_net; // network connection from slave -> m.
@@ -1043,7 +1043,7 @@
1043 /* Used by the sys_var class to store temporary values */1043 /* Used by the sys_var class to store temporary values */
1044 union1044 union
1045 {1045 {
1046@@ -1981,6 +2028,11 @@1046@@ -1986,6 +2033,11 @@
1047 alloc_root. 1047 alloc_root.
1048 */1048 */
1049 void init_for_queries();1049 void init_for_queries();
@@ -1055,7 +1055,7 @@
1055 void change_user(void);1055 void change_user(void);
1056 void cleanup(void);1056 void cleanup(void);
1057 void cleanup_after_query();1057 void cleanup_after_query();
1058@@ -2351,9 +2403,15 @@1058@@ -2356,9 +2408,15 @@
1059 *p_db= strmake(db, db_length);1059 *p_db= strmake(db, db_length);
1060 *p_db_length= db_length;1060 *p_db_length= db_length;
1061 return FALSE;1061 return FALSE;
@@ -1071,7 +1071,7 @@
1071 public:1071 public:
1072 inline Internal_error_handler *get_internal_handler()1072 inline Internal_error_handler *get_internal_handler()
1073 { return m_internal_handler; }1073 { return m_internal_handler; }
1074@@ -2437,6 +2495,9 @@1074@@ -2442,6 +2500,9 @@
1075 LEX_STRING invoker_host;1075 LEX_STRING invoker_host;
1076 };1076 };
1077 1077
@@ -1854,7 +1854,7 @@
1854 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");1854 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
1855 DBUG_RETURN(TRUE);1855 DBUG_RETURN(TRUE);
1856 }1856 }
1857@@ -5348,6 +5368,7 @@1857@@ -5349,6 +5369,7 @@
1858 if (!no_errors)1858 if (!no_errors)
1859 {1859 {
1860 const char *db_name= db ? db : thd->db;1860 const char *db_name= db ? db : thd->db;
@@ -1862,7 +1862,7 @@
1862 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),1862 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
1863 sctx->priv_user, sctx->priv_host, db_name);1863 sctx->priv_user, sctx->priv_host, db_name);
1864 }1864 }
1865@@ -5380,12 +5401,15 @@1865@@ -5381,12 +5402,15 @@
1866 { // We can never grant this1866 { // We can never grant this
1867 DBUG_PRINT("error",("No possible access"));1867 DBUG_PRINT("error",("No possible access"));
1868 if (!no_errors)1868 if (!no_errors)
@@ -1878,7 +1878,7 @@
1878 DBUG_RETURN(TRUE); /* purecov: tested */1878 DBUG_RETURN(TRUE); /* purecov: tested */
1879 }1879 }
1880 1880
1881@@ -5411,11 +5435,15 @@1881@@ -5412,11 +5436,15 @@
1882 1882
1883 DBUG_PRINT("error",("Access denied"));1883 DBUG_PRINT("error",("Access denied"));
1884 if (!no_errors)1884 if (!no_errors)
@@ -1894,7 +1894,7 @@
1894 DBUG_RETURN(TRUE); /* purecov: tested */1894 DBUG_RETURN(TRUE); /* purecov: tested */
1895 }1895 }
1896 1896
1897@@ -5444,6 +5472,7 @@1897@@ -5445,6 +5473,7 @@
1898 1898
1899 if (!thd->col_access && check_grant_db(thd, dst_db_name))1899 if (!thd->col_access && check_grant_db(thd, dst_db_name))
1900 {1900 {
@@ -1902,7 +1902,7 @@
1902 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),1902 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
1903 thd->security_ctx->priv_user,1903 thd->security_ctx->priv_user,
1904 thd->security_ctx->priv_host,1904 thd->security_ctx->priv_host,
1905@@ -5525,9 +5554,12 @@1905@@ -5526,9 +5555,12 @@
1906 (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))1906 (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
1907 {1907 {
1908 if (!no_errors)1908 if (!no_errors)
@@ -1915,7 +1915,7 @@
1915 return TRUE;1915 return TRUE;
1916 }1916 }
1917 /*1917 /*
1918@@ -5690,6 +5722,7 @@1918@@ -5691,6 +5723,7 @@
1919 if ((thd->security_ctx->master_access & want_access))1919 if ((thd->security_ctx->master_access & want_access))
1920 return 0;1920 return 0;
1921 get_privilege_desc(command, sizeof(command), want_access);1921 get_privilege_desc(command, sizeof(command), want_access);
@@ -1923,7 +1923,7 @@
1923 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);1923 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
1924 return 1;1924 return 1;
1925 #else1925 #else
1926@@ -6071,6 +6104,30 @@1926@@ -6072,6 +6105,30 @@
1927 lex_start(thd);1927 lex_start(thd);
1928 mysql_reset_thd_for_next_command(thd);1928 mysql_reset_thd_for_next_command(thd);
1929 1929
@@ -1954,7 +1954,7 @@
1954 if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0)1954 if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0)
1955 {1955 {
1956 LEX *lex= thd->lex;1956 LEX *lex= thd->lex;
1957@@ -6151,6 +6208,43 @@1957@@ -6152,6 +6209,43 @@
1958 *found_semicolon= NULL;1958 *found_semicolon= NULL;
1959 }1959 }
1960 1960
@@ -1998,7 +1998,7 @@
1998 DBUG_VOID_RETURN;1998 DBUG_VOID_RETURN;
1999 }1999 }
2000 2000
2001@@ -7016,6 +7110,13 @@2001@@ -7017,6 +7111,13 @@
2002 if (flush_error_log())2002 if (flush_error_log())
2003 result=1;2003 result=1;
2004 }2004 }
@@ -2012,7 +2012,7 @@
2012 #ifdef HAVE_QUERY_CACHE2012 #ifdef HAVE_QUERY_CACHE
2013 if (options & REFRESH_QUERY_CACHE_FREE)2013 if (options & REFRESH_QUERY_CACHE_FREE)
2014 {2014 {
2015@@ -7116,6 +7217,40 @@2015@@ -7117,6 +7218,40 @@
2016 #endif2016 #endif
2017 if (options & REFRESH_USER_RESOURCES)2017 if (options & REFRESH_USER_RESOURCES)
2018 reset_mqh((LEX_USER *) NULL, 0); /* purecov: inspected */2018 reset_mqh((LEX_USER *) NULL, 0); /* purecov: inspected */

Subscribers

People subscribed via source and target branches

to all changes: