Percona Server with XtraDB

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
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

1=== modified file 'innodb_adjust_defaults.patch'
2--- innodb_adjust_defaults.patch 2010-12-16 11:35:26 +0000
3+++ innodb_adjust_defaults.patch 2011-01-12 17:48:16 +0000
4@@ -8,7 +8,7 @@
5 diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
6 --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:39:14.000000000 +0900
7 +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-30 16:43:26.000000000 +0900
8-@@ -11210,7 +11210,7 @@
9+@@ -11214,7 +11214,7 @@
10 static MYSQL_SYSVAR_ULONG(use_purge_thread, srv_use_purge_thread,
11 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
12 "Number of purge devoted threads. #### over 1 is EXPERIMENTAL ####",
13@@ -17,7 +17,7 @@
14
15 static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info,
16 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
17-@@ -11310,7 +11310,7 @@
18+@@ -11314,7 +11314,7 @@
19 static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
20 PLUGIN_VAR_NOCMDARG,
21 "Attempt flushing dirty pages to avoid IO bursts at checkpoints.",
22@@ -26,7 +26,7 @@
23
24 static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
25 PLUGIN_VAR_RQCMDARG,
26-@@ -11555,7 +11555,7 @@
27+@@ -11559,7 +11559,7 @@
28 static MYSQL_SYSVAR_ULONG(ibuf_active_contract, srv_ibuf_active_contract,
29 PLUGIN_VAR_RQCMDARG,
30 "Enable/Disable active_contract of insert buffer. 0:disable 1:enable",
31@@ -35,7 +35,7 @@
32
33 static MYSQL_SYSVAR_ULONG(ibuf_accel_rate, srv_ibuf_accel_rate,
34 PLUGIN_VAR_RQCMDARG,
35-@@ -11635,8 +11635,8 @@
36+@@ -11639,8 +11639,8 @@
37 };
38 static MYSQL_SYSVAR_ENUM(adaptive_checkpoint, srv_adaptive_checkpoint,
39 PLUGIN_VAR_RQCMDARG,
40
41=== modified file 'innodb_buffer_pool_shm.patch'
42--- innodb_buffer_pool_shm.patch 2010-12-16 11:35:26 +0000
43+++ innodb_buffer_pool_shm.patch 2011-01-12 17:48:16 +0000
44@@ -675,7 +675,7 @@
45
46 static char* internal_innobase_data_file_path = NULL;
47
48-@@ -2457,6 +2458,7 @@
49+@@ -2461,6 +2462,7 @@
50 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
51 srv_use_checksums = (ibool) innobase_use_checksums;
52 srv_fast_checksum = (ibool) innobase_fast_checksum;
53@@ -683,7 +683,7 @@
54
55 #ifdef HAVE_LARGE_PAGES
56 if ((os_use_large_pages = (ibool) my_use_large_pages))
57-@@ -11405,6 +11407,16 @@
58+@@ -11409,6 +11411,16 @@
59 "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
60 NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);
61
62@@ -700,7 +700,7 @@
63 static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
64 PLUGIN_VAR_RQCMDARG,
65 "Helps in performance tuning in heavily concurrent environments.",
66-@@ -11680,6 +11692,8 @@
67+@@ -11699,6 +11711,8 @@
68 MYSQL_SYSVAR(additional_mem_pool_size),
69 MYSQL_SYSVAR(autoextend_increment),
70 MYSQL_SYSVAR(buffer_pool_size),
71@@ -774,11 +774,10 @@
72 #ifndef UNIV_HOTBACKUP
73 /*************************************************************//**
74 Creates a mutex array to protect a hash table. */
75-@@ -327,6 +349,33 @@
76- }\
77+@@ -328,6 +350,33 @@
78 }\
79 } while (0)
80-+
81+
82 +/********************************************************************//**
83 +Align nodes with moving location.*/
84 +#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \
85@@ -805,9 +804,10 @@
86 + }\
87 + }\
88 +} while (0)
89-
90++
91 /************************************************************//**
92 Gets the mutex index for a fold value in a hash table.
93+ @return mutex number */
94 diff -ruN a/storage/innodb_plugin/include/os0proc.h b/storage/innodb_plugin/include/os0proc.h
95 --- a/storage/innodb_plugin/include/os0proc.h 2010-06-04 00:49:59.000000000 +0900
96 +++ b/storage/innodb_plugin/include/os0proc.h 2010-07-14 16:40:16.169321536 +0900
97
98=== modified file 'innodb_deadlock_count.patch'
99--- innodb_deadlock_count.patch 2010-12-13 11:43:12 +0000
100+++ innodb_deadlock_count.patch 2011-01-12 17:48:16 +0000
101@@ -31,7 +31,7 @@
102 diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
103 --- a/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.478241628 +0400
104 +++ b/storage/innodb_plugin/include/srv0srv.h 2010-08-10 15:32:14.936991959 +0400
105-@@ -673,6 +673,7 @@
106+@@ -687,6 +687,7 @@
107 ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */
108 ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */
109 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/
110@@ -53,7 +53,7 @@
111 diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
112 --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.478241628 +0400
113 +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-10 15:32:14.936991959 +0400
114-@@ -438,7 +438,7 @@
115+@@ -452,7 +452,7 @@
116 static ulint srv_n_rows_updated_old = 0;
117 static ulint srv_n_rows_deleted_old = 0;
118 static ulint srv_n_rows_read_old = 0;
119@@ -62,7 +62,7 @@
120 UNIV_INTERN ulint srv_n_lock_wait_count = 0;
121 UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;
122 UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0;
123-@@ -2149,6 +2149,8 @@
124+@@ -2163,6 +2163,8 @@
125 = UT_LIST_GET_LEN(buf_pool->flush_list);
126 export_vars.innodb_buffer_pool_pages_free
127 = UT_LIST_GET_LEN(buf_pool->free);
128
129=== modified file 'innodb_fast_checksum.patch'
130--- innodb_fast_checksum.patch 2010-12-16 11:35:26 +0000
131+++ innodb_fast_checksum.patch 2011-01-12 17:48:16 +0000
132@@ -170,7 +170,7 @@
133 static my_bool innobase_extra_undoslots = FALSE;
134 static my_bool innobase_fast_recovery = FALSE;
135 static my_bool innobase_recovery_stats = TRUE;
136-@@ -2394,6 +2395,7 @@
137+@@ -2398,6 +2399,7 @@
138
139 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
140 srv_use_checksums = (ibool) innobase_use_checksums;
141@@ -178,7 +178,7 @@
142
143 #ifdef HAVE_LARGE_PAGES
144 if ((os_use_large_pages = (ibool) my_use_large_pages))
145-@@ -11105,6 +11107,15 @@
146+@@ -11109,6 +11111,15 @@
147 "Disable with --skip-innodb-checksums.",
148 NULL, NULL, TRUE);
149
150@@ -194,7 +194,7 @@
151 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
152 PLUGIN_VAR_READONLY,
153 "The common part for InnoDB table spaces.",
154-@@ -11597,6 +11608,7 @@
155+@@ -11616,6 +11627,7 @@
156 MYSQL_SYSVAR(autoextend_increment),
157 MYSQL_SYSVAR(buffer_pool_size),
158 MYSQL_SYSVAR(checksums),
159@@ -301,7 +301,7 @@
160 diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
161 --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:40:36.599058304 +0900
162 +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:42:03.647012289 +0900
163-@@ -383,6 +383,7 @@
164+@@ -397,6 +397,7 @@
165
166 UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE;
167 UNIV_INTERN ibool srv_use_checksums = TRUE;
168
169=== modified file 'innodb_fast_shutdown.patch'
170--- innodb_fast_shutdown.patch 2010-12-13 11:43:12 +0000
171+++ innodb_fast_shutdown.patch 2011-01-12 17:48:16 +0000
172@@ -11,6 +11,7 @@
173 # suite.
174 #
175 # The patch also implements os_event_wait_time() for POSIX systems.
176+diff -ruN /dev/null b/COPYING.innodb_fast_shutdown
177 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
178 +++ b/COPYING.innodb_fast_shutdown 2010-11-16 21:37:51.000000000 +0300
179 @@ -0,0 +1,10 @@
180@@ -24,6 +25,7 @@
181 + * 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.
182 +
183 +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.
184+diff -ruN a/storage/innodb_plugin/include/os0sync.h b/storage/innodb_plugin/include/os0sync.h
185 --- a/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:33:00.000000000 +0300
186 +++ b/storage/innodb_plugin/include/os0sync.h 2010-11-16 21:34:06.000000000 +0300
187 @@ -189,14 +189,14 @@
188@@ -43,6 +45,7 @@
189 OS_SYNC_INFINITE_TIME */
190 #ifdef __WIN__
191 /**********************************************************//**
192+diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
193 --- a/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:33:00.000000000 +0300
194 +++ b/storage/innodb_plugin/include/srv0srv.h 2010-11-16 21:34:06.000000000 +0300
195 @@ -57,6 +57,9 @@
196@@ -55,6 +58,7 @@
197 /* If the last data file is auto-extended, we add this many pages to it
198 at a time */
199 #define SRV_AUTO_EXTEND_INCREMENT \
200+diff -ruN a/storage/innodb_plugin/log/log0log.c b/storage/innodb_plugin/log/log0log.c
201 --- a/storage/innodb_plugin/log/log0log.c 2010-11-16 21:33:00.000000000 +0300
202 +++ b/storage/innodb_plugin/log/log0log.c 2010-11-16 21:34:06.000000000 +0300
203 @@ -3103,6 +3103,7 @@
204@@ -65,6 +69,7 @@
205 loop:
206 os_thread_sleep(100000);
207
208+diff -ruN a/storage/innodb_plugin/os/os0sync.c b/storage/innodb_plugin/os/os0sync.c
209 --- a/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:33:00.000000000 +0300
210 +++ b/storage/innodb_plugin/os/os0sync.c 2010-11-16 21:34:06.000000000 +0300
211 @@ -31,6 +31,9 @@
212@@ -157,9 +162,10 @@
213 #endif
214 }
215
216+diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
217 --- a/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:33:00.000000000 +0300
218 +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-11-16 21:34:06.000000000 +0300
219-@@ -707,6 +707,8 @@
220+@@ -721,6 +721,8 @@
221
222 UNIV_INTERN os_event_t srv_lock_timeout_thread_event;
223
224@@ -168,7 +174,7 @@
225 UNIV_INTERN srv_sys_t* srv_sys = NULL;
226
227 /* padding to prevent other memory update hotspots from residing on
228-@@ -1012,6 +1014,7 @@
229+@@ -1026,6 +1028,7 @@
230 }
231
232 srv_lock_timeout_thread_event = os_event_create(NULL);
233@@ -176,7 +182,7 @@
234
235 for (i = 0; i < SRV_MASTER + 1; i++) {
236 srv_n_threads_active[i] = 0;
237-@@ -2239,7 +2242,7 @@
238+@@ -2257,7 +2260,7 @@
239 /* Wake up every 5 seconds to see if we need to print
240 monitor information. */
241
242@@ -185,7 +191,7 @@
243
244 current_time = time(NULL);
245
246-@@ -2381,7 +2384,7 @@
247+@@ -2399,7 +2402,7 @@
248 /* When someone is waiting for a lock, we wake up every second
249 and check if a timeout has passed for a lock wait */
250
251@@ -194,7 +200,7 @@
252
253 srv_lock_timeout_active = TRUE;
254
255-@@ -2546,7 +2549,7 @@
256+@@ -2564,7 +2567,7 @@
257
258 fflush(stderr);
259
260@@ -203,16 +209,16 @@
261
262 if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
263
264-@@ -2590,7 +2593,7 @@
265+@@ -2612,7 +2615,7 @@
266 last_dump_time = time(NULL);
267
268 loop:
269-- os_thread_sleep(5000000);
270+- os_thread_sleep(1000000);
271 + os_event_wait_time(srv_shutdown_event, 5000000);
272
273 if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
274 goto exit_func;
275-@@ -2770,7 +2773,7 @@
276+@@ -2792,7 +2795,7 @@
277 if (!skip_sleep) {
278 if (next_itr_time > cur_time) {
279
280@@ -221,7 +227,7 @@
281 srv_main_sleeps++;
282
283 /*
284-@@ -3476,9 +3479,10 @@
285+@@ -3498,9 +3501,10 @@
286 mutex_exit(&kernel_mutex);
287
288 sleep_ms = 10;
289
290=== modified file 'innodb_files_extend.patch'
291--- innodb_files_extend.patch 2010-12-16 11:35:26 +0000
292+++ innodb_files_extend.patch 2011-01-12 17:48:16 +0000
293@@ -89,7 +89,7 @@
294 static my_bool innobase_thread_concurrency_timer_based;
295 static long long innobase_buffer_pool_size, innobase_log_file_size;
296
297-@@ -2084,6 +2087,62 @@
298+@@ -2088,6 +2091,62 @@
299 }
300 #endif /* UNIV_DEBUG */
301
302@@ -152,7 +152,7 @@
303 #ifndef MYSQL_SERVER
304 innodb_overwrite_relay_log_info = FALSE;
305 #endif
306-@@ -7004,9 +7063,9 @@
307+@@ -7008,9 +7067,9 @@
308 | DICT_TF_COMPACT
309 | DICT_TF_FORMAT_ZIP
310 << DICT_TF_FORMAT_SHIFT;
311@@ -165,7 +165,7 @@
312 }
313 }
314
315-@@ -11116,6 +11175,16 @@
316+@@ -11120,6 +11179,16 @@
317 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
318 NULL, NULL, FALSE);
319
320@@ -182,7 +182,7 @@
321 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
322 PLUGIN_VAR_READONLY,
323 "The common part for InnoDB table spaces.",
324-@@ -11604,6 +11673,8 @@
325+@@ -11623,6 +11692,8 @@
326 NULL, NULL, 0, 0, 1, 0);
327
328 static struct st_mysql_sys_var* innobase_system_variables[]= {
329
330=== modified file 'innodb_fix_misc.patch'
331--- innodb_fix_misc.patch 2010-12-20 21:54:44 +0000
332+++ innodb_fix_misc.patch 2011-01-12 17:48:16 +0000
333@@ -8,7 +8,7 @@
334 diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
335 --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:50:59.626327847 +0900
336 +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:55:20.281021252 +0900
337-@@ -11770,7 +11770,7 @@
338+@@ -11791,7 +11791,7 @@
339 &innobase_storage_engine,
340 innobase_hton_name,
341 "Innobase Oy",
342
343=== modified file 'innodb_lru_dump_restore.patch'
344--- innodb_lru_dump_restore.patch 2010-12-22 18:24:52 +0000
345+++ innodb_lru_dump_restore.patch 2011-01-12 17:48:16 +0000
346@@ -5,50 +5,67 @@
347 #!!! notice !!!
348 # Any small change to this file in the main branch
349 # should be done or reviewed by the maintainer!
350+diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result
351 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
352-+++ b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result 2010-12-22 20:48:19.000000000 +0300
353++++ b/mysql-test/suite/innodb_plugin/r/percona_bug692211.result 2011-01-12 19:38:48.000000000 +0300
354 @@ -0,0 +1,7 @@
355 +#
356-+# LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't
357++# LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't
358 +# exist
359 +#
360 +SELECT @@innodb_auto_lru_dump;
361 +@@innodb_auto_lru_dump
362 +300
363+diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt
364 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
365-+++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt 2010-12-22 20:25:59.000000000 +0300
366++++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211-master.opt 2011-01-11 19:07:54.000000000 +0300
367 @@ -0,0 +1 @@
368 +--innodb_auto_lru_dump=300
369+diff -ruN /dev/null b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test
370 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
371-+++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test 2010-12-22 20:17:57.000000000 +0300
372++++ b/mysql-test/suite/innodb_plugin/t/percona_bug692211.test 2011-01-12 19:38:37.000000000 +0300
373 @@ -0,0 +1,17 @@
374 +--source include/have_innodb_plugin.inc
375 +
376 +--echo #
377-+--echo # LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't
378++--echo # LP bug #692211: innodb_auto_lru_dump crashes if ib_lru_dump doesn't
379 +--echo # exist
380 +--echo #
381 +
382 +SELECT @@innodb_auto_lru_dump;
383 +
384-+# We want to check that the server does not crash on startup when there is no
385++# We want to check that the server does not crash on startup when there is no
386 +# ib_lru_dump in the datadir. If we are here, we have already started up
387-+# successfully. So we only have to check that there is no ib_lru_dump in the
388++# successfully. So we only have to check that there is no ib_lru_dump in the
389 +# datadir.
390 +
391 +--let $MYSQLD_DATADIR= `SELECT @@datadir`
392 +--error 1
393 +--file_exists $MYSQLD_DATADIR/ib_lru_dump;
394 diff -ruN a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c
395---- a/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:13:11.070058073 +0900
396-+++ b/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:34:33.860400549 +0900
397-@@ -2122,6 +2122,278 @@
398+--- a/storage/innodb_plugin/buf/buf0lru.c 2011-01-11 19:07:52.000000000 +0300
399++++ b/storage/innodb_plugin/buf/buf0lru.c 2011-01-12 19:37:29.000000000 +0300
400+@@ -48,6 +48,7 @@
401+ #include "page0zip.h"
402+ #include "log0recv.h"
403+ #include "srv0srv.h"
404++#include "srv0start.h"
405+
406+ /** The number of blocks from the LRU_old pointer onward, including
407+ the block pointed to, must be buf_LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV
408+@@ -2122,6 +2123,445 @@
409 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);
410 }
411
412 +/********************************************************************//**
413-+Dump the LRU page list to the specific file. */
414++Dump the LRU page list to the specific file.
415++
416++The format of the file is a list of (space id, page id) pairs, written in
417++big-endian format, followed by the pair (0xFFFFFFFF, 0xFFFFFFFF). The order of
418++the pages is the order in which they appear in the LRU, from most recent access
419++to oldest access. */
420 +#define LRU_DUMP_FILE "ib_lru_dump"
421++#define LRU_DUMP_TEMP_FILE "ib_lru_dump.tmp"
422 +
423 +UNIV_INTERN
424 +ibool
425@@ -60,10 +77,13 @@
426 + byte* buffer_base = NULL;
427 + byte* buffer = NULL;
428 + buf_page_t* bpage;
429++ buf_page_t* first_bpage;
430 + ulint buffers;
431 + ulint offset;
432-+ ibool ret = FALSE;
433++ ulint pages_written;
434 + ulint i;
435++ ulint total_pages;
436++ mutex_t* next_block_mutex;
437 +
438 + for (i = 0; i < srv_n_data_files; i++) {
439 + if (strstr(srv_data_file_names[i], LRU_DUMP_FILE) != NULL) {
440@@ -83,8 +103,8 @@
441 + goto end;
442 + }
443 +
444-+ dump_file = os_file_create(LRU_DUMP_FILE, OS_FILE_OVERWRITE,
445-+ OS_FILE_NORMAL, OS_DATA_FILE, &success);
446++ dump_file = os_file_create(LRU_DUMP_TEMP_FILE, OS_FILE_OVERWRITE,
447++ OS_FILE_NORMAL, OS_DATA_FILE, &success);
448 + if (!success) {
449 + os_file_get_last_error(TRUE);
450 + fprintf(stderr,
451@@ -92,13 +112,27 @@
452 + goto end;
453 + }
454 +
455++ memset(buffer, 0, UNIV_PAGE_SIZE);
456++
457++ /* walk the buffer pool from most recent to oldest */
458 + mutex_enter(&LRU_list_mutex);
459-+ bpage = UT_LIST_GET_LAST(buf_pool->LRU);
460-+
461-+ buffers = offset = 0;
462-+ while (bpage != NULL) {
463-+ if (offset == 0) {
464-+ memset(buffer, 0, UNIV_PAGE_SIZE);
465++ bpage = first_bpage = UT_LIST_GET_FIRST(buf_pool->LRU);
466++ total_pages = UT_LIST_GET_LEN(buf_pool->LRU);
467++
468++ buffers = offset = pages_written = 0;
469++ while (bpage != NULL &&
470++ (srv_lru_dump_old_pages || !buf_page_is_old(bpage)) &&
471++ (pages_written++ < total_pages)) {
472++
473++ buf_page_t* next_bpage = UT_LIST_GET_NEXT(LRU, bpage);
474++
475++ if (next_bpage == first_bpage) {
476++ buf_pool_mutex_exit();
477++ fprintf(stderr,
478++ " InnoDB: detected cycle in LRU, skipping "
479++ "dump\n");
480++ success = FALSE;
481++ goto end;
482 + }
483 +
484 + mach_write_to_4(buffer + offset * 4, bpage->space);
485@@ -106,51 +140,84 @@
486 + mach_write_to_4(buffer + offset * 4, bpage->offset);
487 + offset++;
488 +
489-+ if (offset == UNIV_PAGE_SIZE/4) {
490-+ success = os_file_write(LRU_DUMP_FILE, dump_file, buffer,
491-+ (buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL,
492-+ (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)),
493++ /* write out one page of data at a time */
494++ if (offset < UNIV_PAGE_SIZE / 4) {
495++ bpage = next_bpage;
496++ continue;
497++ }
498++
499++ /* while writing file, release buffer pool mutex but
500++ keep the next page fixed so we don't worry about
501++ our list iterator becoming invalid */
502++ if (next_bpage) {
503++ next_block_mutex = buf_page_get_mutex(next_bpage);
504++
505++ mutex_enter(next_block_mutex);
506++ next_bpage->buf_fix_count++;
507++ mutex_exit(next_block_mutex);
508++ }
509++ mutex_exit(&LRU_list_mutex);
510++
511++ success = os_file_write(LRU_DUMP_TEMP_FILE, dump_file,
512++ buffer,
513++ (buffers << UNIV_PAGE_SIZE_SHIFT) &
514++ 0xFFFFFFFFUL,
515++ (buffers >>
516++ (32 - UNIV_PAGE_SIZE_SHIFT)),
517 + UNIV_PAGE_SIZE);
518-+ if (!success) {
519-+ mutex_exit(&LRU_list_mutex);
520-+ fprintf(stderr,
521-+ " InnoDB: cannot write page %lu of %s\n",
522-+ buffers, LRU_DUMP_FILE);
523-+ goto end;
524-+ }
525-+ buffers++;
526-+ offset = 0;
527-+ }
528-+
529-+ bpage = UT_LIST_GET_PREV(LRU, bpage);
530++ memset(buffer, 0, UNIV_PAGE_SIZE);
531++
532++ buf_pool_mutex_enter();
533++ if (next_bpage) {
534++ mutex_enter(next_block_mutex);
535++ next_bpage->buf_fix_count--;
536++ mutex_exit(next_block_mutex);
537++ }
538++ if (!success) {
539++ mutex_exit(&LRU_list_mutex);
540++ fprintf(stderr,
541++ " InnoDB: cannot write page %lu of %s\n",
542++ buffers, LRU_DUMP_TEMP_FILE);
543++ goto end;
544++ }
545++ buffers++;
546++ offset = 0;
547++
548++ bpage = next_bpage;
549 + }
550 + mutex_exit(&LRU_list_mutex);
551 +
552-+ if (offset == 0) {
553-+ memset(buffer, 0, UNIV_PAGE_SIZE);
554-+ }
555-+
556-+ mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);
557-+ offset++;
558-+ mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);
559-+ offset++;
560-+
561-+ success = os_file_write(LRU_DUMP_FILE, dump_file, buffer,
562-+ (buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL,
563-+ (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)),
564-+ UNIV_PAGE_SIZE);
565++ /* mark end of file with 0xFFFFFFFF */
566++ mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);
567++ offset++;
568++ mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);
569++ offset++;
570++
571++ success = os_file_write(LRU_DUMP_TEMP_FILE, dump_file, buffer,
572++ (buffers << UNIV_PAGE_SIZE_SHIFT) &
573++ 0xFFFFFFFFUL,
574++ (buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)),
575++ UNIV_PAGE_SIZE);
576 + if (!success) {
577 + goto end;
578 + }
579 +
580-+ ret = TRUE;
581 +end:
582-+ if (dump_file != -1)
583++ if (dump_file != -1) {
584++ if (success) {
585++ success = os_file_flush(dump_file);
586++ }
587 + os_file_close(dump_file);
588-+ if (buffer_base)
589++ }
590++ if (success) {
591++ success = os_file_rename(LRU_DUMP_TEMP_FILE,
592++ LRU_DUMP_FILE);
593++ }
594++ if (buffer_base) {
595 + ut_free(buffer_base);
596++ }
597 +
598-+ return(ret);
599++ return(success);
600 +}
601 +
602 +typedef struct {
603@@ -173,7 +240,16 @@
604 +}
605 +
606 +/********************************************************************//**
607-+Read the pages based on the specific file.*/
608++Read the pages based on the specific file.
609++
610++Pre-warms the buffer pool by loading the buffer pool pages recorded in
611++LRU_DUMP_FILE by automatic or manual invocation of buf_LRU_file_dump.
612++
613++The pages are loaded in LRU priority order to ensure the most frequently
614++accessed pages are loaded first. While loading in LRU priority order, any
615++lower priority pages that are logically adjacent to higher priority pages are
616++loaded along with the higher priority page. The goal is to maximize the size
617++of the data reads without introducing many additional seeks.*/
618 +UNIV_INTERN
619 +ibool
620 +buf_LRU_file_restore(void)
621@@ -190,9 +266,17 @@
622 + ibool terminated = FALSE;
623 + ibool ret = FALSE;
624 + dump_record_t* records = NULL;
625++ dump_record_t* sorted_records = NULL;
626++ dump_record_t* current_record;
627++ dump_record_t* prev_record;
628++ dump_record_t* next_record;
629++ unsigned char* records_loaded = NULL;
630 + ulint size;
631 + ulint size_high;
632 + ulint length;
633++ ulint nrecs;
634++ ulint recsize = sizeof(dump_record_t);
635++ ullint loop_timer;
636 +
637 + dump_file = os_file_create_simple_no_error_handling(
638 + LRU_DUMP_FILE, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
639@@ -202,16 +286,20 @@
640 + " InnoDB: cannot open %s\n", LRU_DUMP_FILE);
641 + goto end;
642 + }
643-+ if (size == 0 || size_high > 0 || size % 8) {
644++ if (size == 0 || size_high > 0 || size % recsize) {
645 + fprintf(stderr, " InnoDB: broken LRU dump file\n");
646 + goto end;
647 + }
648 + buffer_base = ut_malloc(2 * UNIV_PAGE_SIZE);
649 + buffer = ut_align(buffer_base, UNIV_PAGE_SIZE);
650-+ records = ut_malloc(size);
651-+ if (!buffer || !records) {
652++
653++ nrecs = size / recsize;
654++ records = ut_malloc(nrecs * recsize);
655++ sorted_records = ut_malloc(nrecs * recsize);
656++ records_loaded = ut_malloc(nrecs * sizeof(unsigned char));
657++ if (!buffer || !records || !sorted_records || !records_loaded) {
658 + fprintf(stderr,
659-+ " InnoDB: cannot allocate buffer.\n");
660++ " InnoDB: cannot allocate buffer(s).\n");
661 + goto end;
662 + }
663 +
664@@ -236,6 +324,7 @@
665 +
666 + space_id = mach_read_from_4(buffer + offset * 4);
667 + page_no = mach_read_from_4(buffer + (offset + 1) * 4);
668++ /* found list terminator value 0xFFFFFFFF */
669 + if (space_id == 0xFFFFFFFFUL
670 + || page_no == 0xFFFFFFFFUL) {
671 + terminated = TRUE;
672@@ -263,9 +352,26 @@
673 + buffers++;
674 + }
675 +
676-+ qsort(records, length, sizeof(dump_record_t), dump_record_cmp);
677-+
678-+ for (offset = 0; offset < length; offset++) {
679++ srv_lru_restore_total_pages = length;
680++ srv_lru_restore_loaded_pages = 0;
681++
682++ /* Copy the records into a second array and sort them, this will
683++ allow us to identify sequential records so we can load contiguous
684++ data while still prioritizing based on LRU order in the original */
685++ memcpy(sorted_records, records, length * recsize);
686++ qsort(sorted_records, length, recsize, dump_record_cmp);
687++
688++ /* As we will be loading data in a new order, we use this array to
689++ track which records have already been loaded */
690++ memset(records_loaded, 0, length * sizeof(unsigned char));
691++
692++ /* start time */
693++ loop_timer= ut_time_us(NULL);
694++
695++ /* iterate over the LRU in priority order */
696++ for (offset = 0;
697++ offset < ut_min(length, srv_lru_load_max_entries);
698++ offset++) {
699 + ulint space_id;
700 + ulint page_no;
701 + ulint zip_size;
702@@ -273,29 +379,97 @@
703 + ib_int64_t tablespace_version;
704 +
705 + space_id = records[offset].space_id;
706-+ page_no = records[offset].page_no;
707-+
708-+ if (offset % 16 == 15) {
709-+ os_aio_simulated_wake_handler_threads();
710-+ buf_flush_free_margin(FALSE);
711-+ }
712-+
713 + zip_size = fil_space_get_zip_size(space_id);
714 + if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
715 + continue;
716 + }
717 +
718-+ if (fil_area_is_exist(space_id, zip_size, page_no, 0,
719-+ zip_size ? zip_size : UNIV_PAGE_SIZE)) {
720++ /* we iterate over the LRU in priority order, but want to find
721++ the record's position in the sorted array so we can look for
722++ consecutive runs */
723++ current_record = bsearch(records + offset, sorted_records,
724++ length, sizeof(dump_record_t),
725++ dump_record_cmp);
726++ ut_ad(current_record);
727++
728++ /* check if we already loaded this record as part of another
729++ consecutive run */
730++ if (records_loaded[current_record - sorted_records]) {
731++ continue;
732++ }
733++
734++ /* step backwards in the sorted array until we find the start
735++ of this run of consecutive pages */
736++ while (current_record > sorted_records) {
737++ prev_record = current_record - 1;
738++
739++ if (prev_record->space_id != current_record->space_id ||
740++ prev_record->page_no + 1 !=
741++ current_record->page_no) {
742++ break;
743++ }
744++
745++ current_record = prev_record;
746++ }
747++
748++ /* now step forwards requesting consecutive pages */
749++ while (current_record < sorted_records + length) {
750++ if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
751++ os_aio_simulated_wake_handler_threads();
752++ goto end;
753++ }
754++
755++ records_loaded[current_record - sorted_records] = TRUE;
756++
757++ page_no = current_record->page_no;
758++
759++ if (!fil_area_is_exist(space_id, zip_size, page_no, 0,
760++ zip_size ?
761++ zip_size : UNIV_PAGE_SIZE)) {
762++ break;
763++ }
764 +
765 + tablespace_version = fil_space_get_version(space_id);
766 +
767 + req++;
768-+ reads += buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE
769-+ | OS_AIO_SIMULATED_WAKE_LATER,
770++
771++ /* do not issue more than srv_io_capacity requests per
772++ second */
773++ if (req % srv_io_capacity == 0) {
774++ os_aio_simulated_wake_handler_threads();
775++ buf_flush_free_margin(FALSE);
776++
777++ ullint loop_usecs = ut_time_us(NULL) -
778++ loop_timer;
779++
780++ if (loop_usecs < 1000000) {
781++ os_thread_sleep(1000000 - loop_usecs);
782++ }
783++
784++ loop_timer = ut_time_us(NULL);
785++ }
786++
787++ reads += buf_read_page_low(&err,
788++ FALSE,
789++ BUF_READ_ANY_PAGE |
790++ OS_AIO_SIMULATED_WAKE_LATER,
791 + space_id, zip_size, TRUE,
792-+ tablespace_version, page_no, NULL);
793++ tablespace_version, page_no,
794++ NULL);
795 + buf_LRU_stat_inc_io();
796++
797++ srv_lru_restore_loaded_pages++;
798++
799++ next_record = current_record + 1;
800++
801++ if (next_record >= sorted_records + length ||
802++ current_record->space_id != next_record->space_id ||
803++ current_record->page_no + 1 !=
804++ next_record->page_no) {
805++ break;
806++ }
807++
808++ current_record = next_record;
809 + }
810 + }
811 +
812@@ -314,6 +488,10 @@
813 + ut_free(buffer_base);
814 + if (records)
815 + ut_free(records);
816++ if (sorted_records)
817++ ut_free(sorted_records);
818++ if (records_loaded)
819++ ut_free(records_loaded);
820 +
821 + return(ret);
822 +}
823@@ -322,8 +500,8 @@
824 /**********************************************************************//**
825 Validates the LRU list.
826 diff -ruN a/storage/innodb_plugin/buf/buf0rea.c b/storage/innodb_plugin/buf/buf0rea.c
827---- a/storage/innodb_plugin/buf/buf0rea.c 2010-08-27 16:32:40.293411717 +0900
828-+++ b/storage/innodb_plugin/buf/buf0rea.c 2010-08-27 16:34:33.863409016 +0900
829+--- a/storage/innodb_plugin/buf/buf0rea.c 2011-01-11 19:07:53.000000000 +0300
830++++ b/storage/innodb_plugin/buf/buf0rea.c 2011-01-12 19:46:02.000000000 +0300
831 @@ -56,7 +56,7 @@
832 which case it is never read into the pool, or if the tablespace does
833 not exist or is being dropped
834@@ -334,8 +512,8 @@
835 buf_read_page_low(
836 /*==============*/
837 diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
838---- a/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:32:40.298411400 +0900
839-+++ b/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:34:33.868058362 +0900
840+--- a/storage/innodb_plugin/fil/fil0fil.c 2011-01-11 19:07:53.000000000 +0300
841++++ b/storage/innodb_plugin/fil/fil0fil.c 2011-01-12 19:46:02.000000000 +0300
842 @@ -4915,6 +4915,78 @@
843 return(DB_SUCCESS);
844 }
845@@ -416,32 +594,60 @@
846 /**********************************************************************//**
847 Waits for an aio operation to complete. This function is used to write the
848 diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
849---- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-10-01 09:57:56.486228425 +0900
850-+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-10-01 10:00:13.292228546 +0900
851-@@ -11473,6 +11473,12 @@
852+--- a/storage/innodb_plugin/handler/ha_innodb.cc 2011-01-11 19:07:53.000000000 +0300
853++++ b/storage/innodb_plugin/handler/ha_innodb.cc 2011-01-12 19:46:02.000000000 +0300
854+@@ -554,6 +554,10 @@
855+ (char*) &export_vars.innodb_log_write_requests, SHOW_LONG},
856+ {"log_writes",
857+ (char*) &export_vars.innodb_log_writes, SHOW_LONG},
858++ {"lru_restore_loaded_pages",
859++ (char*) &export_vars.innodb_lru_restore_loaded_pages, SHOW_LONG},
860++ {"lru_restore_total_pages",
861++ (char*) &export_vars.innodb_lru_restore_total_pages, SHOW_LONG},
862+ {"os_log_fsyncs",
863+ (char*) &export_vars.innodb_os_log_fsyncs, SHOW_LONG},
864+ {"os_log_pending_fsyncs",
865+@@ -11473,6 +11477,27 @@
866 "Limit the allocated memory for dictionary cache. (0: unlimited)",
867 NULL, NULL, 0, 0, LONG_MAX, 0);
868
869 +static MYSQL_SYSVAR_UINT(auto_lru_dump, srv_auto_lru_dump,
870 + PLUGIN_VAR_RQCMDARG,
871 + "Time in seconds between automatic buffer pool dumps. "
872-+ "0 (the default) disables automatic dumps.",
873++ "0 (the default) disables automatic dumps. A non-zero value "
874++ "also enables restoring LRU automatically on startup.",
875 + NULL, NULL, 0, 0, UINT_MAX32, 0);
876 +
877++static MYSQL_SYSVAR_ULONG(lru_load_max_entries, srv_lru_load_max_entries,
878++ PLUGIN_VAR_RQCMDARG,
879++ "Maximum number of LRU entries to restore. The default is 512k entries. "
880++ "Consecutive pages are merged and only count as one, so you will probably "
881++ "load more pages than this number of LRU entries.",
882++ NULL, NULL, 512*1024UL, 1UL, ULONG_MAX, 0);
883++
884++static MYSQL_SYSVAR_BOOL(lru_dump_old_pages, srv_lru_dump_old_pages,
885++ PLUGIN_VAR_NOCMDARG,
886++ "If enabled, will also dump old pages from the LRU. "
887++ "The default is to only dump young pages.",
888++ NULL, NULL, FALSE);
889++
890++
891 static struct st_mysql_sys_var* innobase_system_variables[]= {
892 MYSQL_SYSVAR(additional_mem_pool_size),
893 MYSQL_SYSVAR(autoextend_increment),
894-@@ -11555,6 +11561,7 @@
895+@@ -11555,6 +11580,9 @@
896 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
897 MYSQL_SYSVAR(read_ahead_threshold),
898 MYSQL_SYSVAR(io_capacity),
899 + MYSQL_SYSVAR(auto_lru_dump),
900++ MYSQL_SYSVAR(lru_load_max_entries),
901++ MYSQL_SYSVAR(lru_dump_old_pages),
902 MYSQL_SYSVAR(use_purge_thread),
903 NULL
904 };
905 diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc
906---- a/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:29:12.540979608 +0900
907-+++ b/storage/innodb_plugin/handler/i_s.cc 2010-08-27 16:34:33.873058189 +0900
908+--- a/storage/innodb_plugin/handler/i_s.cc 2011-01-11 19:07:53.000000000 +0300
909++++ b/storage/innodb_plugin/handler/i_s.cc 2011-01-12 19:46:02.000000000 +0300
910 @@ -46,6 +46,7 @@
911 #include "trx0rseg.h" /* for trx_rseg_struct */
912 #include "trx0sys.h" /* for trx_sys */
913@@ -488,8 +694,8 @@
914 field_store_string(i_s_table->field[0],
915 "Undefined XTRA_* command.");
916 diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
917---- a/storage/innodb_plugin/handler/innodb_patch_info.h 2010-08-27 16:32:40.313021803 +0900
918-+++ b/storage/innodb_plugin/handler/innodb_patch_info.h 2010-08-27 16:34:33.871059345 +0900
919+--- a/storage/innodb_plugin/handler/innodb_patch_info.h 2011-01-11 19:07:53.000000000 +0300
920++++ b/storage/innodb_plugin/handler/innodb_patch_info.h 2011-01-12 19:46:02.000000000 +0300
921 @@ -41,5 +41,6 @@
922 {"innodb_admin_command_base","XtraDB specific command interface through i_s","","http://www.percona.com/docs/wiki/percona-xtradb"},
923 {"innodb_show_lock_name","Show mutex/lock name instead of crated file/line","","http://www.percona.com/docs/wiki/percona-xtradb"},
924@@ -498,8 +704,8 @@
925 {NULL, NULL, NULL, NULL}
926 };
927 diff -ruN a/storage/innodb_plugin/include/buf0lru.h b/storage/innodb_plugin/include/buf0lru.h
928---- a/storage/innodb_plugin/include/buf0lru.h 2010-08-27 16:13:11.085978393 +0900
929-+++ b/storage/innodb_plugin/include/buf0lru.h 2010-08-27 16:34:33.875100517 +0900
930+--- a/storage/innodb_plugin/include/buf0lru.h 2011-01-11 19:07:52.000000000 +0300
931++++ b/storage/innodb_plugin/include/buf0lru.h 2011-01-11 19:07:54.000000000 +0300
932 @@ -213,6 +213,18 @@
933 void
934 buf_LRU_stat_update(void);
935@@ -520,8 +726,8 @@
936 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
937 /**********************************************************************//**
938 diff -ruN a/storage/innodb_plugin/include/buf0rea.h b/storage/innodb_plugin/include/buf0rea.h
939---- a/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:32:40.314021595 +0900
940-+++ b/storage/innodb_plugin/include/buf0rea.h 2010-08-27 16:34:33.877059445 +0900
941+--- a/storage/innodb_plugin/include/buf0rea.h 2011-01-11 19:07:53.000000000 +0300
942++++ b/storage/innodb_plugin/include/buf0rea.h 2011-01-11 19:07:54.000000000 +0300
943 @@ -31,6 +31,37 @@
944 #include "buf0types.h"
945
946@@ -561,8 +767,8 @@
947 buffer buf_pool if it is not already there. Sets the io_fix flag and sets
948 an exclusive lock on the buffer frame. The flag is cleared and the x-lock
949 diff -ruN a/storage/innodb_plugin/include/fil0fil.h b/storage/innodb_plugin/include/fil0fil.h
950---- a/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:32:40.315012507 +0900
951-+++ b/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:34:33.878063455 +0900
952+--- a/storage/innodb_plugin/include/fil0fil.h 2011-01-11 19:07:53.000000000 +0300
953++++ b/storage/innodb_plugin/include/fil0fil.h 2011-01-12 19:46:02.000000000 +0300
954 @@ -643,6 +643,22 @@
955 void* message, /*!< in: message for aio handler if non-sync
956 aio used, else ignored */
957@@ -587,19 +793,33 @@
958 Waits for an aio operation to complete. This function is used to write the
959 handler for completed requests. The aio array of pending requests is divided
960 diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
961---- a/storage/innodb_plugin/include/srv0srv.h 2010-10-01 09:57:56.500228711 +0900
962-+++ b/storage/innodb_plugin/include/srv0srv.h 2010-10-01 10:00:13.302223409 +0900
963-@@ -334,6 +334,9 @@
964+--- a/storage/innodb_plugin/include/srv0srv.h 2011-01-11 19:07:53.000000000 +0300
965++++ b/storage/innodb_plugin/include/srv0srv.h 2011-01-12 19:46:02.000000000 +0300
966+@@ -334,6 +334,23 @@
967 reading of a disk page */
968 extern ulint srv_buf_pool_reads;
969
970 +/** Time in seconds between automatic buffer pool dumps */
971 +extern uint srv_auto_lru_dump;
972 +
973++/** Maximum number of LRU entries to restore
974++Consecutive pages are merged and only count as one, so you will probably
975++load more pages than this number of LRU entries. */
976++extern ulint srv_lru_load_max_entries;
977++
978++/** If enabled, will also dump old pages from the LRU */
979++extern my_bool srv_lru_dump_old_pages;
980++
981++/** Number of buffer pool pages already restored */
982++extern ulint srv_lru_restore_loaded_pages;
983++
984++/** Number of buffer pool pages in restore list */
985++extern ulint srv_lru_restore_total_pages;
986++
987 /** Status variables to be passed to MySQL */
988 typedef struct export_var_struct export_struc;
989
990-@@ -602,6 +605,16 @@
991+@@ -602,6 +619,16 @@
992 /*=====================*/
993 void* arg); /*!< in: a dummy parameter required by
994 os_thread_create */
995@@ -616,28 +836,60 @@
996 /******************************************************************//**
997 Outputs to a file the output of the InnoDB Monitor.
998 @return FALSE if not all information printed
999+@@ -683,6 +710,11 @@
1000+ ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */
1001+ ulint innodb_rows_updated; /*!< srv_n_rows_updated */
1002+ ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
1003++
1004++ ulint innodb_lru_restore_loaded_pages; /*!<srv_lru_restore_loaded_pages
1005++ */
1006++ ulint innodb_lru_restore_total_pages; /*!<srv_lru_restore_total_pages
1007++ */
1008+ };
1009+
1010+ /** The server system struct */
1011 diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
1012---- a/storage/innodb_plugin/srv/srv0srv.c 2010-10-01 09:57:56.516255101 +0900
1013-+++ b/storage/innodb_plugin/srv/srv0srv.c 2010-10-01 10:00:13.304230973 +0900
1014-@@ -298,6 +298,9 @@
1015+--- a/storage/innodb_plugin/srv/srv0srv.c 2011-01-11 19:07:53.000000000 +0300
1016++++ b/storage/innodb_plugin/srv/srv0srv.c 2011-01-12 19:46:02.000000000 +0300
1017+@@ -298,6 +298,23 @@
1018 reading of a disk page */
1019 UNIV_INTERN ulint srv_buf_pool_reads = 0;
1020
1021 +/** Time in seconds between automatic buffer pool dumps */
1022 +UNIV_INTERN uint srv_auto_lru_dump = 0;
1023 +
1024++/** Maximum number of LRU entries to restore
1025++Consecutive pages are merged and only count as one, so you will probably
1026++load more pages than this number of LRU entries. */
1027++UNIV_INTERN ulint srv_lru_load_max_entries = 512*1024;
1028++
1029++/** If enabled, will also dump old pages from the LRU */
1030++UNIV_INTERN my_bool srv_lru_dump_old_pages = FALSE;
1031++
1032++/** Number of buffer pool pages already restored */
1033++UNIV_INTERN ulint srv_lru_restore_loaded_pages = 0;
1034++
1035++/** Number of buffer pool pages in restore list */
1036++UNIV_INTERN ulint srv_lru_restore_total_pages = 0;
1037++
1038 /* structure to pass status variables to MySQL */
1039 UNIV_INTERN export_struc export_vars;
1040
1041-@@ -2537,6 +2540,56 @@
1042- /* We count the number of threads in os_thread_exit(). A created
1043- thread should always use that to exit and not use return() to exit. */
1044-
1045-+ os_thread_exit(NULL);
1046-+
1047-+ OS_THREAD_DUMMY_RETURN;
1048-+}
1049-+
1050+@@ -2178,6 +2195,10 @@
1051+ export_vars.innodb_rows_inserted = srv_n_rows_inserted;
1052+ export_vars.innodb_rows_updated = srv_n_rows_updated;
1053+ export_vars.innodb_rows_deleted = srv_n_rows_deleted;
1054++ export_vars.innodb_lru_restore_loaded_pages =
1055++ srv_lru_restore_loaded_pages;
1056++ export_vars.innodb_lru_restore_total_pages =
1057++ srv_lru_restore_total_pages;
1058+
1059+ mutex_exit(&srv_innodb_monitor_mutex);
1060+ }
1061+@@ -2542,6 +2563,60 @@
1062+ OS_THREAD_DUMMY_RETURN;
1063+ }
1064+
1065 +/*********************************************************************//**
1066 +A thread which restores the buffer pool from a dump file on startup and does
1067 +periodic buffer pool dumps.
1068@@ -662,10 +914,14 @@
1069 + if (srv_auto_lru_dump)
1070 + buf_LRU_file_restore();
1071 +
1072++ if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
1073++ goto exit_func;
1074++ }
1075++
1076 + last_dump_time = time(NULL);
1077 +
1078 +loop:
1079-+ os_thread_sleep(5000000);
1080++ os_thread_sleep(1000000);
1081 +
1082 + if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
1083 + goto exit_func;
1084@@ -683,12 +939,17 @@
1085 + /* We count the number of threads in os_thread_exit(). A created
1086 + thread should always use that to exit and not use return() to exit. */
1087 +
1088- os_thread_exit(NULL);
1089-
1090- OS_THREAD_DUMMY_RETURN;
1091++ os_thread_exit(NULL);
1092++
1093++ OS_THREAD_DUMMY_RETURN;
1094++}
1095++
1096+ /*******************************************************************//**
1097+ Tells the InnoDB server that there has been activity in the database
1098+ and wakes up the master thread if it is suspended (not sleeping). Used
1099 diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
1100---- a/storage/innodb_plugin/srv/srv0start.c 2010-10-01 09:57:56.420229366 +0900
1101-+++ b/storage/innodb_plugin/srv/srv0start.c 2010-10-01 10:00:13.309260428 +0900
1102+--- a/storage/innodb_plugin/srv/srv0start.c 2011-01-11 19:07:53.000000000 +0300
1103++++ b/storage/innodb_plugin/srv/srv0start.c 2011-01-12 19:46:02.000000000 +0300
1104 @@ -126,9 +126,9 @@
1105 static ulint ios;
1106
1107
1108=== modified file 'innodb_pass_corrupt_table.patch'
1109--- innodb_pass_corrupt_table.patch 2010-12-16 11:35:26 +0000
1110+++ innodb_pass_corrupt_table.patch 2011-01-12 17:48:16 +0000
1111@@ -778,7 +778,7 @@
1112 diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
1113 --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:38:38.249059616 +0900
1114 +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:39:02.960021471 +0900
1115-@@ -3716,6 +3716,12 @@
1116+@@ -3720,6 +3720,12 @@
1117 DBUG_RETURN(1);
1118 }
1119
1120@@ -791,7 +791,7 @@
1121 /* Create buffers for packing the fields of a record. Why
1122 table->reclength did not work here? Obviously, because char
1123 fields when packed actually became 1 byte longer, when we also
1124-@@ -3743,6 +3749,19 @@
1125+@@ -3747,6 +3753,19 @@
1126 /* Get pointer to a table object in InnoDB dictionary cache */
1127 ib_table = dict_table_get(norm_name, TRUE);
1128
1129@@ -811,7 +811,7 @@
1130 if (NULL == ib_table) {
1131 if (is_part && retries < 10) {
1132 ++retries;
1133-@@ -4909,6 +4928,10 @@
1134+@@ -4913,6 +4932,10 @@
1135
1136 ha_statistic_increment(&SSV::ha_write_count);
1137
1138@@ -822,7 +822,7 @@
1139 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
1140 table->timestamp_field->set_time();
1141
1142-@@ -5126,6 +5149,10 @@
1143+@@ -5130,6 +5153,10 @@
1144 func_exit:
1145 innobase_active_small();
1146
1147@@ -833,7 +833,7 @@
1148 DBUG_RETURN(error_result);
1149 }
1150
1151-@@ -5302,6 +5329,10 @@
1152+@@ -5306,6 +5333,10 @@
1153
1154 ha_statistic_increment(&SSV::ha_update_count);
1155
1156@@ -844,7 +844,7 @@
1157 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
1158 table->timestamp_field->set_time();
1159
1160-@@ -5391,6 +5422,10 @@
1161+@@ -5395,6 +5426,10 @@
1162
1163 innobase_active_small();
1164
1165@@ -855,7 +855,7 @@
1166 DBUG_RETURN(error);
1167 }
1168
1169-@@ -5412,6 +5447,10 @@
1170+@@ -5416,6 +5451,10 @@
1171
1172 ha_statistic_increment(&SSV::ha_delete_count);
1173
1174@@ -866,7 +866,7 @@
1175 if (!prebuilt->upd_node) {
1176 row_get_prebuilt_update_vector(prebuilt);
1177 }
1178-@@ -5438,6 +5477,10 @@
1179+@@ -5442,6 +5481,10 @@
1180
1181 innobase_active_small();
1182
1183@@ -877,7 +877,7 @@
1184 DBUG_RETURN(error);
1185 }
1186
1187-@@ -5677,6 +5720,10 @@
1188+@@ -5681,6 +5724,10 @@
1189
1190 ha_statistic_increment(&SSV::ha_read_key_count);
1191
1192@@ -888,7 +888,7 @@
1193 index = prebuilt->index;
1194
1195 if (UNIV_UNLIKELY(index == NULL)) {
1196-@@ -5742,6 +5789,10 @@
1197+@@ -5746,6 +5793,10 @@
1198 ret = DB_UNSUPPORTED;
1199 }
1200
1201@@ -899,7 +899,7 @@
1202 switch (ret) {
1203 case DB_SUCCESS:
1204 error = 0;
1205-@@ -5852,6 +5903,10 @@
1206+@@ -5856,6 +5907,10 @@
1207 {
1208 DBUG_ENTER("change_active_index");
1209
1210@@ -910,7 +910,7 @@
1211 ut_ad(user_thd == ha_thd());
1212 ut_a(prebuilt->trx == thd_to_trx(user_thd));
1213
1214-@@ -5942,6 +5997,10 @@
1215+@@ -5946,6 +6001,10 @@
1216
1217 DBUG_ENTER("general_fetch");
1218
1219@@ -921,7 +921,7 @@
1220 ut_a(prebuilt->trx == thd_to_trx(user_thd));
1221
1222 innodb_srv_conc_enter_innodb(prebuilt->trx);
1223-@@ -5951,6 +6010,10 @@
1224+@@ -5955,6 +6014,10 @@
1225
1226 innodb_srv_conc_exit_innodb(prebuilt->trx);
1227
1228@@ -932,7 +932,7 @@
1229 switch (ret) {
1230 case DB_SUCCESS:
1231 error = 0;
1232-@@ -7201,6 +7264,10 @@
1233+@@ -7205,6 +7268,10 @@
1234 DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
1235 }
1236
1237@@ -943,7 +943,7 @@
1238 /* Truncate the table in InnoDB */
1239
1240 error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
1241-@@ -7209,6 +7276,10 @@
1242+@@ -7213,6 +7280,10 @@
1243 goto fallback;
1244 }
1245
1246@@ -954,7 +954,7 @@
1247 error = convert_error_code_to_mysql(error, prebuilt->table->flags,
1248 NULL);
1249
1250-@@ -7721,6 +7792,16 @@
1251+@@ -7725,6 +7796,16 @@
1252 return(ranges + (double) rows / (double) total_rows * time_for_scan);
1253 }
1254
1255@@ -971,7 +971,7 @@
1256 /*********************************************************************//**
1257 Calculates the key number used inside MySQL for an Innobase index. We will
1258 first check the "index translation table" for a match of the index to get
1259-@@ -7842,7 +7923,7 @@
1260+@@ -7846,7 +7927,7 @@
1261 ib_table = prebuilt->table;
1262
1263 if (flag & HA_STATUS_TIME) {
1264@@ -980,7 +980,7 @@
1265 /* In sql_show we call with this flag: update
1266 then statistics so that they are up-to-date */
1267
1268-@@ -8133,10 +8214,18 @@
1269+@@ -8137,10 +8218,18 @@
1270 THD* thd, /*!< in: connection thread handle */
1271 HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
1272 {
1273@@ -999,7 +999,7 @@
1274 return(0);
1275 }
1276
1277-@@ -8318,6 +8407,10 @@
1278+@@ -8322,6 +8411,10 @@
1279 my_error(ER_QUERY_INTERRUPTED, MYF(0));
1280 }
1281
1282@@ -1010,7 +1010,7 @@
1283 DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
1284 }
1285
1286-@@ -9043,6 +9136,10 @@
1287+@@ -9047,6 +9140,10 @@
1288
1289 update_thd(thd);
1290
1291@@ -1021,9 +1021,9 @@
1292 if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
1293 ut_print_timestamp(stderr);
1294 fprintf(stderr,
1295-@@ -11487,6 +11584,14 @@
1296- "0 (the default) disables automatic dumps.",
1297- NULL, NULL, 0, 0, UINT_MAX32, 0);
1298+@@ -11506,6 +11603,14 @@
1299+ NULL, NULL, FALSE);
1300+
1301
1302 +static MYSQL_SYSVAR_ULONG(pass_corrupt_table, srv_pass_corrupt_table,
1303 + PLUGIN_VAR_RQCMDARG,
1304@@ -1036,9 +1036,9 @@
1305 static struct st_mysql_sys_var* innobase_system_variables[]= {
1306 MYSQL_SYSVAR(additional_mem_pool_size),
1307 MYSQL_SYSVAR(autoextend_increment),
1308-@@ -11572,6 +11677,7 @@
1309- MYSQL_SYSVAR(io_capacity),
1310- MYSQL_SYSVAR(auto_lru_dump),
1311+@@ -11593,6 +11698,7 @@
1312+ MYSQL_SYSVAR(lru_load_max_entries),
1313+ MYSQL_SYSVAR(lru_dump_old_pages),
1314 MYSQL_SYSVAR(use_purge_thread),
1315 + MYSQL_SYSVAR(pass_corrupt_table),
1316 NULL
1317@@ -1343,7 +1343,7 @@
1318 diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
1319 --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:38:38.286989546 +0900
1320 +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:39:03.048990992 +0900
1321-@@ -402,6 +402,7 @@
1322+@@ -416,6 +416,7 @@
1323 UNIV_INTERN ulint srv_adaptive_checkpoint = 0; /* 0: none 1: reflex 2: estimate */
1324
1325 UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */
1326
1327=== modified file 'innodb_separate_doublewrite.patch'
1328--- innodb_separate_doublewrite.patch 2010-12-16 11:35:26 +0000
1329+++ innodb_separate_doublewrite.patch 2011-01-12 17:48:16 +0000
1330@@ -340,7 +340,7 @@
1331
1332 /* Note: This variable can be set to on/off and any of the supported
1333 file formats in the configuration file, but can only be set to any
1334-@@ -2248,6 +2249,8 @@
1335+@@ -2252,6 +2253,8 @@
1336 goto error;
1337 }
1338
1339@@ -349,7 +349,7 @@
1340 srv_extra_undoslots = (ibool) innobase_extra_undoslots;
1341
1342 srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table;
1343-@@ -11321,6 +11324,11 @@
1344+@@ -11325,6 +11328,11 @@
1345 "Path to individual files and their sizes.",
1346 NULL, NULL, NULL);
1347
1348@@ -361,7 +361,7 @@
1349 static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
1350 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
1351 "The AUTOINC lock modes supported by InnoDB: "
1352-@@ -11487,6 +11495,7 @@
1353+@@ -11506,6 +11514,7 @@
1354 MYSQL_SYSVAR(commit_concurrency),
1355 MYSQL_SYSVAR(concurrency_tickets),
1356 MYSQL_SYSVAR(data_file_path),
1357
1358=== modified file 'innodb_show_sys_tables.patch'
1359--- innodb_show_sys_tables.patch 2010-12-16 11:35:26 +0000
1360+++ innodb_show_sys_tables.patch 2011-01-12 17:48:16 +0000
1361@@ -8,7 +8,7 @@
1362 diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
1363 --- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:45:46.194411503 +0900
1364 +++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-08-27 16:49:26.171990559 +0900
1365-@@ -11793,6 +11793,9 @@
1366+@@ -11814,6 +11814,9 @@
1367 i_s_innodb_table_stats,
1368 i_s_innodb_index_stats,
1369 i_s_innodb_admin_command,
1370@@ -29,13 +29,10 @@
1371 #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */
1372 }
1373
1374-@@ -3112,6 +3113,664 @@
1375- STRUCT_FLD(deinit, i_s_common_deinit),
1376- STRUCT_FLD(version, 0x0100 /* 1.0 */),
1377- STRUCT_FLD(status_vars, NULL),
1378-+ STRUCT_FLD(system_vars, NULL),
1379-+ STRUCT_FLD(__reserved1, NULL)
1380-+};
1381+@@ -3115,3 +3116,661 @@
1382+ STRUCT_FLD(system_vars, NULL),
1383+ STRUCT_FLD(__reserved1, NULL)
1384+ };
1385 +
1386 +static ST_FIELD_INFO i_s_innodb_sys_tables_info[] =
1387 +{
1388@@ -691,9 +688,9 @@
1389 + STRUCT_FLD(deinit, i_s_common_deinit),
1390 + STRUCT_FLD(version, 0x0100 /* 1.0 */),
1391 + STRUCT_FLD(status_vars, NULL),
1392- STRUCT_FLD(system_vars, NULL),
1393- STRUCT_FLD(__reserved1, NULL)
1394- };
1395++ STRUCT_FLD(system_vars, NULL),
1396++ STRUCT_FLD(__reserved1, NULL)
1397++};
1398 diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/i_s.h
1399 --- a/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:29:12.542982379 +0900
1400 +++ b/storage/innodb_plugin/handler/i_s.h 2010-08-27 16:49:26.179990535 +0900
1401
1402=== modified file 'profiling_slow.patch'
1403--- profiling_slow.patch 2010-12-22 20:15:33 +0000
1404+++ profiling_slow.patch 2011-01-12 17:48:16 +0000
1405@@ -95,9 +95,9 @@
1406 diff -ruN a/sql/log.cc b/sql/log.cc
1407 --- a/sql/log.cc 2010-11-24 19:33:02.000000000 +0300
1408 +++ b/sql/log.cc 2010-11-24 19:36:29.000000000 +0300
1409-@@ -2433,6 +2433,11 @@
1410+@@ -2434,6 +2434,11 @@
1411 my_b_printf(&log_file,"# No InnoDB statistics available for this query\n") == (uint) -1)
1412- tmp_errno=errno;
1413+ tmp_errno= errno;
1414 }
1415 +
1416 +#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
1417
1418=== modified file 'response-time-distribution.patch'
1419--- response-time-distribution.patch 2010-12-22 20:15:33 +0000
1420+++ response-time-distribution.patch 2011-01-12 17:48:16 +0000
1421@@ -755,7 +755,7 @@
1422 case SCH_COLLATION_CHARACTER_SET_APPLICABILITY:
1423 case SCH_USER_PRIVILEGES:
1424 case SCH_SCHEMA_PRIVILEGES:
1425-@@ -7234,6 +7250,12 @@
1426+@@ -7235,6 +7251,12 @@
1427 init_global_index_stats();
1428 pthread_mutex_unlock(&LOCK_global_index_stats);
1429 }
1430
1431=== modified file 'show_slave_status_nolock.patch'
1432--- show_slave_status_nolock.patch 2010-12-17 19:06:49 +0000
1433+++ show_slave_status_nolock.patch 2011-01-12 17:48:16 +0000
1434@@ -61,7 +61,7 @@
1435 sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;
1436 sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;
1437 sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND;
1438-@@ -2545,12 +2546,16 @@
1439+@@ -2546,12 +2547,16 @@
1440 pthread_mutex_unlock(&LOCK_active_mi);
1441 break;
1442 }
1443@@ -79,7 +79,7 @@
1444 if (active_mi != NULL)
1445 {
1446 res = show_master_info(thd, active_mi);
1447-@@ -2561,7 +2566,10 @@
1448+@@ -2562,7 +2567,10 @@
1449 WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO));
1450 my_ok(thd);
1451 }
1452
1453=== modified file 'show_temp_51.patch'
1454--- show_temp_51.patch 2010-12-16 11:35:26 +0000
1455+++ show_temp_51.patch 2011-01-12 17:48:16 +0000
1456@@ -50,7 +50,7 @@
1457 case SCH_VIEWS:
1458 case SCH_TRIGGERS:
1459 case SCH_EVENTS:
1460-@@ -2317,6 +2322,7 @@
1461+@@ -2318,6 +2323,7 @@
1462 }
1463 case SQLCOM_SHOW_DATABASES:
1464 case SQLCOM_SHOW_TABLES:
1465@@ -58,7 +58,7 @@
1466 case SQLCOM_SHOW_TRIGGERS:
1467 case SQLCOM_SHOW_TABLE_STATUS:
1468 case SQLCOM_SHOW_OPEN_TABLES:
1469-@@ -5457,6 +5463,8 @@
1470+@@ -5458,6 +5464,8 @@
1471
1472 case SCH_TABLE_NAMES:
1473 case SCH_TABLES:
1474
1475=== modified file 'userstat.patch'
1476--- userstat.patch 2011-01-04 11:30:51 +0000
1477+++ userstat.patch 2011-01-12 17:48:16 +0000
1478@@ -436,7 +436,7 @@
1479
1480 /*
1481 Log slow query with all enabled log event handlers
1482-@@ -4495,6 +4517,8 @@
1483+@@ -4496,6 +4518,8 @@
1484 thd->first_successful_insert_id_in_prev_stmt_for_binlog);
1485 if (e.write(file))
1486 goto err;
1487@@ -445,7 +445,7 @@
1488 }
1489 if (thd->auto_inc_intervals_in_cur_stmt_for_binlog.nb_elements() > 0)
1490 {
1491-@@ -4506,12 +4530,16 @@
1492+@@ -4507,12 +4531,16 @@
1493 minimum());
1494 if (e.write(file))
1495 goto err;
1496@@ -462,7 +462,7 @@
1497 }
1498 if (thd->user_var_events.elements)
1499 {
1500-@@ -4527,6 +4555,8 @@
1501+@@ -4528,6 +4556,8 @@
1502 user_var_event->charset_number);
1503 if (e.write(file))
1504 goto err;
1505@@ -471,7 +471,7 @@
1506 }
1507 }
1508 }
1509-@@ -4539,6 +4569,8 @@
1510+@@ -4540,6 +4570,8 @@
1511 if (event_info->write(file) ||
1512 DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0))
1513 goto err;
1514@@ -480,7 +480,7 @@
1515
1516 if (file == &log_file) // we are writing to the real log (disk)
1517 {
1518-@@ -4684,7 +4716,7 @@
1519+@@ -4685,7 +4717,7 @@
1520 be reset as a READ_CACHE to be able to read the contents from it.
1521 */
1522
1523@@ -489,7 +489,7 @@
1524 {
1525 Mutex_sentry sentry(lock_log ? &LOCK_log : NULL);
1526
1527-@@ -4732,6 +4764,7 @@
1528+@@ -4733,6 +4765,7 @@
1529 /* write the first half of the split header */
1530 if (my_b_write(&log_file, header, carry))
1531 return ER_ERROR_ON_WRITE;
1532@@ -497,7 +497,7 @@
1533
1534 /*
1535 copy fixed second half of header to cache so the correct
1536-@@ -4800,6 +4833,7 @@
1537+@@ -4801,6 +4834,7 @@
1538 /* Write data to the binary log file */
1539 if (my_b_write(&log_file, cache->read_pos, length))
1540 return ER_ERROR_ON_WRITE;
1541@@ -505,7 +505,7 @@
1542 cache->read_pos=cache->read_end; // Mark buffer used up
1543 } while ((length= my_b_fill(cache)));
1544
1545-@@ -4922,21 +4956,24 @@
1546+@@ -4923,21 +4957,24 @@
1547 */
1548 if (qinfo.write(&log_file))
1549 goto err;
1550@@ -984,7 +984,7 @@
1551 uint32 server_id;
1552 uint32 file_id; // for LOAD DATA INFILE
1553 /* remote (peer) port */
1554-@@ -1828,6 +1830,8 @@
1555+@@ -1833,6 +1835,8 @@
1556 /* variables.transaction_isolation is reset to this after each commit */
1557 enum_tx_isolation session_tx_isolation;
1558 enum_check_fields count_cuted_fields;
1559@@ -993,7 +993,7 @@
1560
1561 DYNAMIC_ARRAY user_var_events; /* For user variables replication */
1562 MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
1563-@@ -1916,6 +1920,49 @@
1564+@@ -1921,6 +1925,49 @@
1565 */
1566 LOG_INFO* current_linfo;
1567 NET* slave_net; // network connection from slave -> m.
1568@@ -1043,7 +1043,7 @@
1569 /* Used by the sys_var class to store temporary values */
1570 union
1571 {
1572-@@ -1981,6 +2028,11 @@
1573+@@ -1986,6 +2033,11 @@
1574 alloc_root.
1575 */
1576 void init_for_queries();
1577@@ -1055,7 +1055,7 @@
1578 void change_user(void);
1579 void cleanup(void);
1580 void cleanup_after_query();
1581-@@ -2351,9 +2403,15 @@
1582+@@ -2356,9 +2408,15 @@
1583 *p_db= strmake(db, db_length);
1584 *p_db_length= db_length;
1585 return FALSE;
1586@@ -1071,7 +1071,7 @@
1587 public:
1588 inline Internal_error_handler *get_internal_handler()
1589 { return m_internal_handler; }
1590-@@ -2437,6 +2495,9 @@
1591+@@ -2442,6 +2500,9 @@
1592 LEX_STRING invoker_host;
1593 };
1594
1595@@ -1854,7 +1854,7 @@
1596 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
1597 DBUG_RETURN(TRUE);
1598 }
1599-@@ -5348,6 +5368,7 @@
1600+@@ -5349,6 +5369,7 @@
1601 if (!no_errors)
1602 {
1603 const char *db_name= db ? db : thd->db;
1604@@ -1862,7 +1862,7 @@
1605 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
1606 sctx->priv_user, sctx->priv_host, db_name);
1607 }
1608-@@ -5380,12 +5401,15 @@
1609+@@ -5381,12 +5402,15 @@
1610 { // We can never grant this
1611 DBUG_PRINT("error",("No possible access"));
1612 if (!no_errors)
1613@@ -1878,7 +1878,7 @@
1614 DBUG_RETURN(TRUE); /* purecov: tested */
1615 }
1616
1617-@@ -5411,11 +5435,15 @@
1618+@@ -5412,11 +5436,15 @@
1619
1620 DBUG_PRINT("error",("Access denied"));
1621 if (!no_errors)
1622@@ -1894,7 +1894,7 @@
1623 DBUG_RETURN(TRUE); /* purecov: tested */
1624 }
1625
1626-@@ -5444,6 +5472,7 @@
1627+@@ -5445,6 +5473,7 @@
1628
1629 if (!thd->col_access && check_grant_db(thd, dst_db_name))
1630 {
1631@@ -1902,7 +1902,7 @@
1632 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
1633 thd->security_ctx->priv_user,
1634 thd->security_ctx->priv_host,
1635-@@ -5525,9 +5554,12 @@
1636+@@ -5526,9 +5555,12 @@
1637 (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
1638 {
1639 if (!no_errors)
1640@@ -1915,7 +1915,7 @@
1641 return TRUE;
1642 }
1643 /*
1644-@@ -5690,6 +5722,7 @@
1645+@@ -5691,6 +5723,7 @@
1646 if ((thd->security_ctx->master_access & want_access))
1647 return 0;
1648 get_privilege_desc(command, sizeof(command), want_access);
1649@@ -1923,7 +1923,7 @@
1650 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
1651 return 1;
1652 #else
1653-@@ -6071,6 +6104,30 @@
1654+@@ -6072,6 +6105,30 @@
1655 lex_start(thd);
1656 mysql_reset_thd_for_next_command(thd);
1657
1658@@ -1954,7 +1954,7 @@
1659 if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0)
1660 {
1661 LEX *lex= thd->lex;
1662-@@ -6151,6 +6208,43 @@
1663+@@ -6152,6 +6209,43 @@
1664 *found_semicolon= NULL;
1665 }
1666
1667@@ -1998,7 +1998,7 @@
1668 DBUG_VOID_RETURN;
1669 }
1670
1671-@@ -7016,6 +7110,13 @@
1672+@@ -7017,6 +7111,13 @@
1673 if (flush_error_log())
1674 result=1;
1675 }
1676@@ -2012,7 +2012,7 @@
1677 #ifdef HAVE_QUERY_CACHE
1678 if (options & REFRESH_QUERY_CACHE_FREE)
1679 {
1680-@@ -7116,6 +7217,40 @@
1681+@@ -7117,6 +7218,40 @@
1682 #endif
1683 if (options & REFRESH_USER_RESOURCES)
1684 reset_mqh((LEX_USER *) NULL, 0); /* purecov: inspected */

Subscribers

People subscribed via source and target branches

to all changes: