Merge lp:~percona-dev/percona-patches/5.0.84-fix-bug-413858 into lp:~percona-dev/percona-patches/5.0.84
- 5.0.84-fix-bug-413858
- Merge into 5.0.84
Proposed by
Yasufumi Kinoshita
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~percona-dev/percona-patches/5.0.84-fix-bug-413858 | ||||
Merge into: | lp:~percona-dev/percona-patches/5.0.84 | ||||
Diff against target: | None lines | ||||
To merge this branch: | bzr merge lp:~percona-dev/percona-patches/5.0.84-fix-bug-413858 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vadim Tkachenko | Approve | ||
Review via email: mp+10827@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Vadim Tkachenko (vadim-tk) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'innodb_dict_size_limit.patch' |
2 | --- innodb_dict_size_limit.patch 2009-07-03 22:42:33 +0000 |
3 | +++ innodb_dict_size_limit.patch 2009-08-28 02:14:10 +0000 |
4 | @@ -1,6 +1,134 @@ |
5 | -diff -r 6eeee157fd40 innobase/dict/dict0boot.c |
6 | ---- a/innobase/dict/dict0boot.c Fri Jul 03 15:41:34 2009 -0700 |
7 | -+++ b/innobase/dict/dict0boot.c Fri Jul 03 15:41:41 2009 -0700 |
8 | +diff -ruN a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c |
9 | +--- a/innobase/btr/btr0sea.c 2009-08-27 18:42:17.000000000 +0900 |
10 | ++++ b/innobase/btr/btr0sea.c 2009-08-27 18:43:11.000000000 +0900 |
11 | +@@ -1077,6 +1077,124 @@ |
12 | + } |
13 | + |
14 | + /************************************************************************ |
15 | ++Drops a page hash index based on index */ |
16 | ++ |
17 | ++void |
18 | ++btr_search_drop_page_hash_index_on_index( |
19 | ++/*=====================================*/ |
20 | ++ dict_index_t* index) /* in: record descriptor */ |
21 | ++{ |
22 | ++ page_t* page; |
23 | ++ hash_table_t* table; |
24 | ++ buf_block_t* block; |
25 | ++ ulint n_fields; |
26 | ++ ulint n_bytes; |
27 | ++ rec_t* rec; |
28 | ++ ulint fold; |
29 | ++ ulint prev_fold; |
30 | ++ dulint tree_id; |
31 | ++ ulint n_cached; |
32 | ++ ulint n_recs; |
33 | ++ ulint* folds; |
34 | ++ ulint i; |
35 | ++ mem_heap_t* heap = NULL; |
36 | ++ ulint* offsets; |
37 | ++ |
38 | ++ rw_lock_x_lock(&btr_search_latch); |
39 | ++ mutex_enter(&buf_pool->mutex); |
40 | ++ |
41 | ++ table = btr_search_sys->hash_index; |
42 | ++ |
43 | ++ block = UT_LIST_GET_LAST(buf_pool->LRU); |
44 | ++ |
45 | ++ while (block != NULL) { |
46 | ++ if (block->index == index && block->is_hashed) { |
47 | ++ page = block->frame; |
48 | ++ |
49 | ++ /* from btr_search_drop_page_hash_index() */ |
50 | ++ n_fields = block->curr_n_fields; |
51 | ++ n_bytes = block->curr_n_bytes; |
52 | ++ |
53 | ++ ut_a(n_fields + n_bytes > 0); |
54 | ++ |
55 | ++ n_recs = page_get_n_recs(page); |
56 | ++ |
57 | ++ /* Calculate and cache fold values into an array for fast deletion |
58 | ++ from the hash index */ |
59 | ++ |
60 | ++ folds = mem_alloc(n_recs * sizeof(ulint)); |
61 | ++ |
62 | ++ n_cached = 0; |
63 | ++ |
64 | ++ rec = page_get_infimum_rec(page); |
65 | ++ rec = page_rec_get_next(rec); |
66 | ++ |
67 | ++ tree_id = btr_page_get_index_id(page); |
68 | ++ |
69 | ++ ut_a(0 == ut_dulint_cmp(tree_id, index->id)); |
70 | ++ |
71 | ++ prev_fold = 0; |
72 | ++ |
73 | ++ offsets = NULL; |
74 | ++ |
75 | ++ while (!page_rec_is_supremum(rec)) { |
76 | ++ /* FIXME: in a mixed tree, not all records may have enough |
77 | ++ ordering fields: */ |
78 | ++ offsets = rec_get_offsets(rec, index, offsets, |
79 | ++ n_fields + (n_bytes > 0), &heap); |
80 | ++ ut_a(rec_offs_n_fields(offsets) == n_fields + (n_bytes > 0)); |
81 | ++ fold = rec_fold(rec, offsets, n_fields, n_bytes, tree_id); |
82 | ++ |
83 | ++ if (fold == prev_fold && prev_fold != 0) { |
84 | ++ |
85 | ++ goto next_rec; |
86 | ++ } |
87 | ++ |
88 | ++ /* Remove all hash nodes pointing to this page from the |
89 | ++ hash chain */ |
90 | ++ |
91 | ++ folds[n_cached] = fold; |
92 | ++ n_cached++; |
93 | ++next_rec: |
94 | ++ rec = page_rec_get_next(rec); |
95 | ++ prev_fold = fold; |
96 | ++ } |
97 | ++ |
98 | ++ for (i = 0; i < n_cached; i++) { |
99 | ++ |
100 | ++ ha_remove_all_nodes_to_page(table, folds[i], page); |
101 | ++ } |
102 | ++ |
103 | ++ ut_a(index->search_info->ref_count > 0); |
104 | ++ index->search_info->ref_count--; |
105 | ++ |
106 | ++ block->is_hashed = FALSE; |
107 | ++ block->index = NULL; |
108 | ++ |
109 | ++ if (UNIV_UNLIKELY(block->n_pointers)) { |
110 | ++ /* Corruption */ |
111 | ++ ut_print_timestamp(stderr); |
112 | ++ fprintf(stderr, |
113 | ++" InnoDB: Corruption of adaptive hash index. After dropping\n" |
114 | ++"InnoDB: the hash index to a page of %s, still %lu hash nodes remain.\n", |
115 | ++ index->name, (ulong) block->n_pointers); |
116 | ++ } |
117 | ++ |
118 | ++ mem_free(folds); |
119 | ++ } |
120 | ++ |
121 | ++ block = UT_LIST_GET_PREV(LRU, block); |
122 | ++ } |
123 | ++ |
124 | ++ mutex_exit(&buf_pool->mutex); |
125 | ++ rw_lock_x_unlock(&btr_search_latch); |
126 | ++ |
127 | ++ if (UNIV_LIKELY_NULL(heap)) { |
128 | ++ mem_heap_free(heap); |
129 | ++ } |
130 | ++} |
131 | ++ |
132 | ++/************************************************************************ |
133 | + Drops a page hash index when a page is freed from a fseg to the file system. |
134 | + Drops possible hash index if the page happens to be in the buffer pool. */ |
135 | + |
136 | +diff -ruN a/innobase/dict/dict0boot.c b/innobase/dict/dict0boot.c |
137 | +--- a/innobase/dict/dict0boot.c 2009-07-07 21:53:58.000000000 +0900 |
138 | ++++ b/innobase/dict/dict0boot.c 2009-08-27 18:42:59.000000000 +0900 |
139 | @@ -247,6 +247,7 @@ |
140 | system tables */ |
141 | /*-------------------------*/ |
142 | @@ -33,9 +161,9 @@ |
143 | |
144 | dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0,0,0); |
145 | dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0); |
146 | -diff -r 6eeee157fd40 innobase/dict/dict0crea.c |
147 | ---- a/innobase/dict/dict0crea.c Fri Jul 03 15:41:34 2009 -0700 |
148 | -+++ b/innobase/dict/dict0crea.c Fri Jul 03 15:41:41 2009 -0700 |
149 | +diff -ruN a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c |
150 | +--- a/innobase/dict/dict0crea.c 2009-07-07 21:53:58.000000000 +0900 |
151 | ++++ b/innobase/dict/dict0crea.c 2009-08-27 18:42:59.000000000 +0900 |
152 | @@ -1178,6 +1178,9 @@ |
153 | /* Foreign constraint system tables have already been |
154 | created, and they are ok */ |
155 | @@ -46,21 +174,21 @@ |
156 | mutex_exit(&(dict_sys->mutex)); |
157 | |
158 | return(DB_SUCCESS); |
159 | -@@ -1266,6 +1269,11 @@ |
160 | - que_graph_free(graph); |
161 | +@@ -1267,6 +1270,11 @@ |
162 | |
163 | trx->op_info = ""; |
164 | -+ |
165 | + |
166 | + table1 = dict_table_get_low("SYS_FOREIGN"); |
167 | + table2 = dict_table_get_low("SYS_FOREIGN_COLS"); |
168 | + table1->n_mysql_handles_opened = 1; /* for pin */ |
169 | + table2->n_mysql_handles_opened = 1; /* for pin */ |
170 | - |
171 | ++ |
172 | row_mysql_unlock_data_dictionary(trx); |
173 | |
174 | -diff -r 6eeee157fd40 innobase/dict/dict0dict.c |
175 | ---- a/innobase/dict/dict0dict.c Fri Jul 03 15:41:34 2009 -0700 |
176 | -+++ b/innobase/dict/dict0dict.c Fri Jul 03 15:41:41 2009 -0700 |
177 | + trx_free_for_mysql(trx); |
178 | +diff -ruN a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c |
179 | +--- a/innobase/dict/dict0dict.c 2009-07-07 21:53:58.000000000 +0900 |
180 | ++++ b/innobase/dict/dict0dict.c 2009-08-27 18:43:11.000000000 +0900 |
181 | @@ -638,6 +638,8 @@ |
182 | mutex_enter(&(dict_sys->mutex)); |
183 | |
184 | @@ -79,15 +207,15 @@ |
185 | mutex_exit(&(dict_sys->mutex)); |
186 | |
187 | if (table != NULL) { |
188 | -@@ -786,6 +790,8 @@ |
189 | - |
190 | +@@ -787,6 +791,8 @@ |
191 | table->n_mysql_handles_opened++; |
192 | } |
193 | + |
194 | ++ dict_table_LRU_trim(table); |
195 | + |
196 | -+ dict_table_LRU_trim(table); |
197 | - |
198 | mutex_exit(&(dict_sys->mutex)); |
199 | |
200 | + if (table != NULL) { |
201 | @@ -1267,20 +1273,64 @@ |
202 | too much space. Currently not used! */ |
203 | |
204 | @@ -100,24 +228,18 @@ |
205 | { |
206 | dict_table_t* table; |
207 | dict_table_t* prev_table; |
208 | -- |
209 | -- ut_error; |
210 | -- |
211 | --#ifdef UNIV_SYNC_DEBUG |
212 | -- ut_ad(mutex_own(&(dict_sys->mutex))); |
213 | --#endif /* UNIV_SYNC_DEBUG */ |
214 | -- |
215 | + dict_foreign_t* foreign; |
216 | + ulint n_removed; |
217 | + ulint n_have_parent; |
218 | + ulint cached_foreign_tables; |
219 | -+ |
220 | + |
221 | +- ut_error; |
222 | + //ut_error; |
223 | -+ |
224 | -+#ifdef UNIV_SYNC_DEBUG |
225 | -+ ut_ad(mutex_own(&(dict_sys->mutex))); |
226 | -+#endif /* UNIV_SYNC_DEBUG */ |
227 | -+ |
228 | + |
229 | + #ifdef UNIV_SYNC_DEBUG |
230 | + ut_ad(mutex_own(&(dict_sys->mutex))); |
231 | + #endif /* UNIV_SYNC_DEBUG */ |
232 | + |
233 | +retry: |
234 | + n_removed = n_have_parent = 0; |
235 | table = UT_LIST_GET_LAST(dict_sys->table_LRU); |
236 | @@ -170,9 +292,20 @@ |
237 | } |
238 | |
239 | /************************************************************************** |
240 | -diff -r 6eeee157fd40 innobase/ibuf/ibuf0ibuf.c |
241 | ---- a/innobase/ibuf/ibuf0ibuf.c Fri Jul 03 15:41:34 2009 -0700 |
242 | -+++ b/innobase/ibuf/ibuf0ibuf.c Fri Jul 03 15:41:41 2009 -0700 |
243 | +@@ -1565,6 +1616,10 @@ |
244 | + #ifdef UNIV_SYNC_DEBUG |
245 | + ut_ad(mutex_own(&(dict_sys->mutex))); |
246 | + #endif /* UNIV_SYNC_DEBUG */ |
247 | ++ /* remove all entry of the index from adaptive hash index, |
248 | ++ because removing from adaptive hash index needs dict_index */ |
249 | ++ if (srv_use_adaptive_hash_indexes && srv_dict_size_limit) |
250 | ++ btr_search_drop_page_hash_index_on_index(index); |
251 | + |
252 | + /* We always create search info whether or not adaptive |
253 | + hash index is enabled or not. */ |
254 | +diff -ruN a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c |
255 | +--- a/innobase/ibuf/ibuf0ibuf.c 2009-08-27 18:42:17.000000000 +0900 |
256 | ++++ b/innobase/ibuf/ibuf0ibuf.c 2009-08-27 18:42:59.000000000 +0900 |
257 | @@ -535,6 +535,7 @@ |
258 | sprintf(buf, "SYS_IBUF_TABLE_%lu", (ulong) space); |
259 | /* use old-style record format for the insert buffer */ |
260 | @@ -181,9 +314,26 @@ |
261 | |
262 | dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0, 0); |
263 | dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0, 0); |
264 | -diff -r 6eeee157fd40 innobase/include/dict0dict.h |
265 | ---- a/innobase/include/dict0dict.h Fri Jul 03 15:41:34 2009 -0700 |
266 | -+++ b/innobase/include/dict0dict.h Fri Jul 03 15:41:41 2009 -0700 |
267 | +diff -ruN a/innobase/include/btr0sea.h b/innobase/include/btr0sea.h |
268 | +--- a/innobase/include/btr0sea.h 2009-07-07 21:54:00.000000000 +0900 |
269 | ++++ b/innobase/include/btr0sea.h 2009-08-27 18:43:11.000000000 +0900 |
270 | +@@ -97,6 +97,13 @@ |
271 | + /*============================*/ |
272 | + page_t* page); /* in: index page, s- or x-latched */ |
273 | + /************************************************************************ |
274 | ++Drops a page hash index based on index */ |
275 | ++ |
276 | ++void |
277 | ++btr_search_drop_page_hash_index_on_index( |
278 | ++/*=====================================*/ |
279 | ++ dict_index_t* index); /* in: record descriptor */ |
280 | ++/************************************************************************ |
281 | + Drops a page hash index when a page is freed from a fseg to the file system. |
282 | + Drops possible hash index if the page happens to be in the buffer pool. */ |
283 | + |
284 | +diff -ruN a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h |
285 | +--- a/innobase/include/dict0dict.h 2009-07-07 21:54:01.000000000 +0900 |
286 | ++++ b/innobase/include/dict0dict.h 2009-08-27 18:42:59.000000000 +0900 |
287 | @@ -938,6 +938,11 @@ |
288 | const char* ptr, /* in: scan from */ |
289 | const char* string);/* in: look for this */ |
290 | @@ -196,9 +346,9 @@ |
291 | /* Buffers for storing detailed information about the latest foreign key |
292 | and unique key errors */ |
293 | extern FILE* dict_foreign_err_file; |
294 | -diff -r 6eeee157fd40 innobase/include/dict0dict.ic |
295 | ---- a/innobase/include/dict0dict.ic Fri Jul 03 15:41:34 2009 -0700 |
296 | -+++ b/innobase/include/dict0dict.ic Fri Jul 03 15:41:41 2009 -0700 |
297 | +diff -ruN a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic |
298 | +--- a/innobase/include/dict0dict.ic 2009-07-07 21:54:01.000000000 +0900 |
299 | ++++ b/innobase/include/dict0dict.ic 2009-08-27 18:42:59.000000000 +0900 |
300 | @@ -533,6 +533,13 @@ |
301 | |
302 | HASH_SEARCH(name_hash, dict_sys->table_hash, table_fold, table, |
303 | @@ -224,18 +374,18 @@ |
304 | /* lock_push(trx, table, LOCK_DICT_MEM_FIX) */ |
305 | } |
306 | |
307 | -diff -r 6eeee157fd40 innobase/include/srv0srv.h |
308 | ---- a/innobase/include/srv0srv.h Fri Jul 03 15:41:34 2009 -0700 |
309 | -+++ b/innobase/include/srv0srv.h Fri Jul 03 15:41:41 2009 -0700 |
310 | -@@ -146,6 +146,8 @@ |
311 | - extern ulint srv_enable_unsafe_group_commit; |
312 | +diff -ruN a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h |
313 | +--- a/innobase/include/srv0srv.h 2009-08-27 18:42:17.000000000 +0900 |
314 | ++++ b/innobase/include/srv0srv.h 2009-08-27 18:42:59.000000000 +0900 |
315 | +@@ -147,6 +147,8 @@ |
316 | extern uint srv_read_ahead; |
317 | extern uint srv_adaptive_checkpoint; |
318 | -+ |
319 | + |
320 | +extern ulint srv_dict_size_limit; |
321 | - |
322 | ++ |
323 | extern volatile ibool srv_io_pattern; |
324 | extern ulong srv_io_pattern_trace; |
325 | + extern ulong srv_io_pattern_trace_running; |
326 | @@ -552,6 +554,7 @@ |
327 | ulint innodb_data_writes; |
328 | ulint innodb_data_written; |
329 | @@ -244,18 +394,18 @@ |
330 | ulint innodb_buffer_pool_pages_total; |
331 | ulint innodb_buffer_pool_pages_data; |
332 | ulint innodb_buffer_pool_pages_dirty; |
333 | -diff -r 6eeee157fd40 innobase/srv/srv0srv.c |
334 | ---- a/innobase/srv/srv0srv.c Fri Jul 03 15:41:34 2009 -0700 |
335 | -+++ b/innobase/srv/srv0srv.c Fri Jul 03 15:41:41 2009 -0700 |
336 | -@@ -352,6 +352,8 @@ |
337 | - |
338 | +diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c |
339 | +--- a/innobase/srv/srv0srv.c 2009-08-27 18:42:17.000000000 +0900 |
340 | ++++ b/innobase/srv/srv0srv.c 2009-08-27 18:42:59.000000000 +0900 |
341 | +@@ -353,6 +353,8 @@ |
342 | uint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */ |
343 | uint srv_adaptive_checkpoint = 0; /* 0: none 1: reflex 2: estimate */ |
344 | -+ |
345 | + |
346 | +ulint srv_dict_size_limit = 0; |
347 | - |
348 | ++ |
349 | volatile ibool srv_io_pattern = FALSE; |
350 | ulint srv_io_pattern_trace = 0; |
351 | + ulint srv_io_pattern_trace_running = 0; |
352 | @@ -1953,6 +1955,7 @@ |
353 | export_vars.innodb_data_reads= os_n_file_reads; |
354 | export_vars.innodb_data_writes= os_n_file_writes; |
355 | @@ -264,9 +414,9 @@ |
356 | export_vars.innodb_buffer_pool_read_requests= buf_pool->n_page_gets; |
357 | export_vars.innodb_buffer_pool_write_requests= srv_buf_pool_write_requests; |
358 | export_vars.innodb_buffer_pool_wait_free= srv_buf_pool_wait_free; |
359 | -diff -r 6eeee157fd40 mysql-test/r/innodb_dict_size_limit.result |
360 | ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
361 | -+++ b/mysql-test/r/innodb_dict_size_limit.result Fri Jul 03 15:41:41 2009 -0700 |
362 | +diff -ruN a/mysql-test/r/innodb_dict_size_limit.result b/mysql-test/r/innodb_dict_size_limit.result |
363 | +--- /dev/null 1970-01-01 09:00:00.000000000 +0900 |
364 | ++++ b/mysql-test/r/innodb_dict_size_limit.result 2009-08-27 18:42:59.000000000 +0900 |
365 | @@ -0,0 +1,60 @@ |
366 | +DROP TABLE IF EXISTS `test_5`; |
367 | +DROP TABLE IF EXISTS `test_4`; |
368 | @@ -328,9 +478,9 @@ |
369 | +DROP TABLE `test_3`; |
370 | +DROP TABLE `test_2`; |
371 | +DROP TABLE `test_1`; |
372 | -diff -r 6eeee157fd40 mysql-test/t/innodb_dict_size_limit.test |
373 | ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
374 | -+++ b/mysql-test/t/innodb_dict_size_limit.test Fri Jul 03 15:41:41 2009 -0700 |
375 | +diff -ruN a/mysql-test/t/innodb_dict_size_limit.test b/mysql-test/t/innodb_dict_size_limit.test |
376 | +--- /dev/null 1970-01-01 09:00:00.000000000 +0900 |
377 | ++++ b/mysql-test/t/innodb_dict_size_limit.test 2009-08-27 18:42:59.000000000 +0900 |
378 | @@ -0,0 +1,63 @@ |
379 | +# |
380 | +# Test for new variable innodb_dict_size_limit; |
381 | @@ -395,9 +545,9 @@ |
382 | +DROP TABLE `test_2`; |
383 | +DROP TABLE `test_1`; |
384 | + |
385 | -diff -r 6eeee157fd40 patch_info/innodb_dict_size_limit.info |
386 | ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
387 | -+++ b/patch_info/innodb_dict_size_limit.info Fri Jul 03 15:41:41 2009 -0700 |
388 | +diff -ruN a/patch_info/innodb_dict_size_limit.info b/patch_info/innodb_dict_size_limit.info |
389 | +--- /dev/null 1970-01-01 09:00:00.000000000 +0900 |
390 | ++++ b/patch_info/innodb_dict_size_limit.info 2009-08-27 18:42:59.000000000 +0900 |
391 | @@ -0,0 +1,9 @@ |
392 | +File=innodb_dict_size_limit.patch |
393 | +Name=Limit dictionary cache size |
394 | @@ -408,9 +558,9 @@ |
395 | +ChangeLog= |
396 | +2009-01-26 |
397 | +YK: Initial release |
398 | -diff -r 6eeee157fd40 sql/ha_innodb.cc |
399 | ---- a/sql/ha_innodb.cc Fri Jul 03 15:41:34 2009 -0700 |
400 | -+++ b/sql/ha_innodb.cc Fri Jul 03 15:41:41 2009 -0700 |
401 | +diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc |
402 | +--- a/sql/ha_innodb.cc 2009-08-27 18:42:17.000000000 +0900 |
403 | ++++ b/sql/ha_innodb.cc 2009-08-27 18:42:59.000000000 +0900 |
404 | @@ -288,6 +288,8 @@ |
405 | (char*) &export_vars.innodb_dblwr_pages_written, SHOW_LONG}, |
406 | {"dblwr_writes", |
407 | @@ -420,9 +570,9 @@ |
408 | {"log_waits", |
409 | (char*) &export_vars.innodb_log_waits, SHOW_LONG}, |
410 | {"log_write_requests", |
411 | -diff -r 6eeee157fd40 sql/ha_innodb.h |
412 | ---- a/sql/ha_innodb.h Fri Jul 03 15:41:34 2009 -0700 |
413 | -+++ b/sql/ha_innodb.h Fri Jul 03 15:41:41 2009 -0700 |
414 | +diff -ruN a/sql/ha_innodb.h b/sql/ha_innodb.h |
415 | +--- a/sql/ha_innodb.h 2009-08-27 18:42:17.000000000 +0900 |
416 | ++++ b/sql/ha_innodb.h 2009-08-27 18:42:59.000000000 +0900 |
417 | @@ -243,6 +243,7 @@ |
418 | extern ulong srv_enable_unsafe_group_commit; |
419 | extern uint srv_read_ahead; |
420 | @@ -431,9 +581,9 @@ |
421 | extern ulong srv_show_locks_held; |
422 | extern ulong srv_show_verbose_locks; |
423 | extern ulong srv_io_pattern_trace; |
424 | -diff -r 6eeee157fd40 sql/mysqld.cc |
425 | ---- a/sql/mysqld.cc Fri Jul 03 15:41:34 2009 -0700 |
426 | -+++ b/sql/mysqld.cc Fri Jul 03 15:41:41 2009 -0700 |
427 | +diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc |
428 | +--- a/sql/mysqld.cc 2009-08-27 18:42:17.000000000 +0900 |
429 | ++++ b/sql/mysqld.cc 2009-08-27 18:42:59.000000000 +0900 |
430 | @@ -5101,6 +5101,7 @@ |
431 | OPT_INNODB_ADAPTIVE_CHECKPOINT, |
432 | OPT_INNODB_READ_IO_THREADS, |
433 | @@ -453,9 +603,9 @@ |
434 | {"innodb_io_pattern_trace", OPT_INNODB_IO_PATTERN_TRACE, |
435 | "Create/Drop the internal hash table for IO pattern tracing.", |
436 | (gptr*) &srv_io_pattern_trace, (gptr*) &srv_io_pattern_trace, |
437 | -diff -r 6eeee157fd40 sql/set_var.cc |
438 | ---- a/sql/set_var.cc Fri Jul 03 15:41:34 2009 -0700 |
439 | -+++ b/sql/set_var.cc Fri Jul 03 15:41:41 2009 -0700 |
440 | +diff -ruN a/sql/set_var.cc b/sql/set_var.cc |
441 | +--- a/sql/set_var.cc 2009-08-27 18:42:17.000000000 +0900 |
442 | ++++ b/sql/set_var.cc 2009-08-27 18:42:59.000000000 +0900 |
443 | @@ -540,6 +540,8 @@ |
444 | sys_var_enum sys_innodb_adaptive_checkpoint("innodb_adaptive_checkpoint", |
445 | &srv_adaptive_checkpoint, |
446 | |
447 | === modified file 'innodb_split_buf_pool_mutex.patch' |
448 | --- innodb_split_buf_pool_mutex.patch 2009-07-03 22:42:33 +0000 |
449 | +++ innodb_split_buf_pool_mutex.patch 2009-08-28 02:14:10 +0000 |
450 | @@ -1,6 +1,27 @@ |
451 | -diff -r 7ac364cc9b41 innobase/buf/buf0buf.c |
452 | ---- a/innobase/buf/buf0buf.c Fri Jul 03 15:41:50 2009 -0700 |
453 | -+++ b/innobase/buf/buf0buf.c Fri Jul 03 15:41:57 2009 -0700 |
454 | +diff -ruN a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c |
455 | +--- a/innobase/btr/btr0sea.c 2009-08-28 11:08:16.000000000 +0900 |
456 | ++++ b/innobase/btr/btr0sea.c 2009-08-28 11:06:20.000000000 +0900 |
457 | +@@ -1101,7 +1101,7 @@ |
458 | + ulint* offsets; |
459 | + |
460 | + rw_lock_x_lock(&btr_search_latch); |
461 | +- mutex_enter(&buf_pool->mutex); |
462 | ++ mutex_enter(&buf_pool->LRU_mutex); |
463 | + |
464 | + table = btr_search_sys->hash_index; |
465 | + |
466 | +@@ -1186,7 +1186,7 @@ |
467 | + block = UT_LIST_GET_PREV(LRU, block); |
468 | + } |
469 | + |
470 | +- mutex_exit(&buf_pool->mutex); |
471 | ++ mutex_exit(&buf_pool->LRU_mutex); |
472 | + rw_lock_x_unlock(&btr_search_latch); |
473 | + |
474 | + if (UNIV_LIKELY_NULL(heap)) { |
475 | +diff -ruN a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c |
476 | +--- a/innobase/buf/buf0buf.c 2009-08-28 11:08:16.000000000 +0900 |
477 | ++++ b/innobase/buf/buf0buf.c 2009-08-28 11:06:30.000000000 +0900 |
478 | @@ -549,6 +549,17 @@ |
479 | mutex_create(&(buf_pool->mutex)); |
480 | mutex_set_level(&(buf_pool->mutex), SYNC_BUF_POOL); |
481 | @@ -377,7 +398,7 @@ |
482 | #ifdef UNIV_DEBUG |
483 | if (buf_debug_prints) { |
484 | fputs("Has read ", stderr); |
485 | -@@ -2103,10 +2136,23 @@ |
486 | +@@ -2103,11 +2136,24 @@ |
487 | } else { |
488 | ut_ad(io_type == BUF_IO_WRITE); |
489 | |
490 | @@ -394,13 +415,14 @@ |
491 | routine in the flush system */ |
492 | |
493 | buf_flush_write_complete(block); |
494 | -+ |
495 | + |
496 | + if (flush_type == BUF_FLUSH_LRU) { |
497 | + mutex_exit(&(buf_pool->LRU_mutex)); |
498 | + } |
499 | - |
500 | ++ |
501 | rw_lock_s_unlock_gen(&(block->lock), BUF_IO_WRITE); |
502 | /* io_counter here */ |
503 | + if (srv_io_pattern && srv_io_pattern_trace_running) { |
504 | @@ -2132,6 +2178,9 @@ |
505 | |
506 | buf_pool->n_pages_written++; |
507 | @@ -587,9 +609,9 @@ |
508 | |
509 | return(len); |
510 | } |
511 | -diff -r 7ac364cc9b41 innobase/buf/buf0flu.c |
512 | ---- a/innobase/buf/buf0flu.c Fri Jul 03 15:41:50 2009 -0700 |
513 | -+++ b/innobase/buf/buf0flu.c Fri Jul 03 15:41:57 2009 -0700 |
514 | +diff -ruN a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c |
515 | +--- a/innobase/buf/buf0flu.c 2009-08-28 11:08:17.000000000 +0900 |
516 | ++++ b/innobase/buf/buf0flu.c 2009-08-28 11:06:30.000000000 +0900 |
517 | @@ -49,7 +49,9 @@ |
518 | buf_block_t* block) /* in: block which is modified */ |
519 | { |
520 | @@ -612,7 +634,7 @@ |
521 | #endif /* UNIV_SYNC_DEBUG */ |
522 | |
523 | prev_b = NULL; |
524 | -@@ -113,16 +117,18 @@ |
525 | +@@ -130,16 +134,18 @@ |
526 | BUF_BLOCK_FILE_PAGE and in the LRU list */ |
527 | { |
528 | #ifdef UNIV_SYNC_DEBUG |
529 | @@ -634,7 +656,7 @@ |
530 | return(FALSE); |
531 | } |
532 | |
533 | -@@ -148,12 +154,13 @@ |
534 | +@@ -165,12 +171,13 @@ |
535 | ulint flush_type)/* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */ |
536 | { |
537 | #ifdef UNIV_SYNC_DEBUG |
538 | @@ -651,7 +673,7 @@ |
539 | && (block->io_fix == 0)) { |
540 | if (flush_type != BUF_FLUSH_LRU) { |
541 | |
542 | -@@ -182,15 +189,17 @@ |
543 | +@@ -199,15 +206,17 @@ |
544 | { |
545 | ut_ad(block); |
546 | #ifdef UNIV_SYNC_DEBUG |
547 | @@ -670,7 +692,7 @@ |
548 | |
549 | (buf_pool->n_flush[block->flush_type])--; |
550 | |
551 | -@@ -536,18 +545,20 @@ |
552 | +@@ -553,18 +562,20 @@ |
553 | ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST |
554 | || flush_type == BUF_FLUSH_SINGLE_PAGE); |
555 | |
556 | @@ -693,7 +715,7 @@ |
557 | |
558 | if (flush_type == BUF_FLUSH_LIST |
559 | && buf_flush_ready_for_flush(block, flush_type)) { |
560 | -@@ -744,7 +755,7 @@ |
561 | +@@ -761,7 +772,7 @@ |
562 | high = fil_space_get_size(space); |
563 | } |
564 | |
565 | @@ -702,7 +724,7 @@ |
566 | |
567 | for (i = low; i < high; i++) { |
568 | |
569 | -@@ -778,7 +789,7 @@ |
570 | +@@ -795,7 +806,7 @@ |
571 | |
572 | mutex_exit(&block->mutex); |
573 | |
574 | @@ -711,7 +733,7 @@ |
575 | |
576 | /* Note: as we release the buf_pool mutex |
577 | above, in buf_flush_try_page we cannot be sure |
578 | -@@ -789,14 +800,14 @@ |
579 | +@@ -806,14 +817,14 @@ |
580 | count += buf_flush_try_page(space, i, |
581 | flush_type); |
582 | |
583 | @@ -728,7 +750,7 @@ |
584 | |
585 | return(count); |
586 | } |
587 | -@@ -831,6 +842,7 @@ |
588 | +@@ -848,6 +859,7 @@ |
589 | ulint space; |
590 | ulint offset; |
591 | ibool found; |
592 | @@ -736,7 +758,7 @@ |
593 | |
594 | ut_ad((flush_type == BUF_FLUSH_LRU) |
595 | || (flush_type == BUF_FLUSH_LIST)); |
596 | -@@ -849,6 +861,12 @@ |
597 | +@@ -866,6 +878,12 @@ |
598 | } |
599 | |
600 | (buf_pool->init_flush)[flush_type] = TRUE; |
601 | @@ -749,7 +771,7 @@ |
602 | |
603 | for (;;) { |
604 | /* If we have flushed enough, leave the loop */ |
605 | -@@ -865,7 +883,10 @@ |
606 | +@@ -882,7 +900,10 @@ |
607 | } else { |
608 | ut_ad(flush_type == BUF_FLUSH_LIST); |
609 | |
610 | @@ -760,7 +782,7 @@ |
611 | if (!block |
612 | || (ut_dulint_cmp(block->oldest_modification, |
613 | lsn_limit) >= 0)) { |
614 | -@@ -895,7 +916,9 @@ |
615 | +@@ -912,7 +933,9 @@ |
616 | offset = block->offset; |
617 | |
618 | mutex_exit(&block->mutex); |
619 | @@ -771,7 +793,7 @@ |
620 | |
621 | old_page_count = page_count; |
622 | |
623 | -@@ -915,7 +938,9 @@ |
624 | +@@ -932,7 +955,9 @@ |
625 | flush_type, offset, |
626 | page_count - old_page_count); */ |
627 | |
628 | @@ -782,7 +804,7 @@ |
629 | |
630 | } else if (flush_type == BUF_FLUSH_LRU) { |
631 | |
632 | -@@ -927,16 +952,25 @@ |
633 | +@@ -944,17 +969,26 @@ |
634 | |
635 | mutex_exit(&block->mutex); |
636 | |
637 | @@ -800,16 +822,17 @@ |
638 | break; |
639 | } |
640 | } |
641 | -+ |
642 | + |
643 | + if (flush_type == BUF_FLUSH_LRU) { |
644 | + mutex_exit(&(buf_pool->LRU_mutex)); |
645 | + } |
646 | + |
647 | + mutex_enter(&(buf_pool->mutex)); |
648 | - |
649 | ++ |
650 | (buf_pool->init_flush)[flush_type] = FALSE; |
651 | |
652 | -@@ -997,7 +1031,7 @@ |
653 | + if ((buf_pool->n_flush[flush_type] == 0) |
654 | +@@ -1014,7 +1048,7 @@ |
655 | ulint n_replaceable; |
656 | ulint distance = 0; |
657 | |
658 | @@ -818,20 +841,20 @@ |
659 | |
660 | n_replaceable = UT_LIST_GET_LEN(buf_pool->free); |
661 | |
662 | -@@ -1007,6 +1041,12 @@ |
663 | - && (n_replaceable < BUF_FLUSH_FREE_BLOCK_MARGIN |
664 | +@@ -1025,6 +1059,12 @@ |
665 | + BUF_FLUSH_EXTRA_MARGIN) |
666 | && (distance < BUF_LRU_FREE_SEARCH_LEN)) { |
667 | -+ |
668 | + |
669 | + if (!block->in_LRU_list) { |
670 | + /* reatart. but it is very optimistic */ |
671 | + block = UT_LIST_GET_LAST(buf_pool->LRU); |
672 | + continue; |
673 | + } |
674 | - |
675 | ++ |
676 | mutex_enter(&block->mutex); |
677 | |
678 | -@@ -1021,7 +1061,7 @@ |
679 | + if (buf_flush_ready_for_replace(block)) { |
680 | +@@ -1038,7 +1078,7 @@ |
681 | block = UT_LIST_GET_PREV(LRU, block); |
682 | } |
683 | |
684 | @@ -840,7 +863,7 @@ |
685 | |
686 | if (n_replaceable >= BUF_FLUSH_FREE_BLOCK_MARGIN) { |
687 | |
688 | -@@ -1040,8 +1080,9 @@ |
689 | +@@ -1057,8 +1097,9 @@ |
690 | immediately, without waiting. */ |
691 | |
692 | void |
693 | @@ -851,7 +874,7 @@ |
694 | { |
695 | ulint n_to_flush; |
696 | ulint n_flushed; |
697 | -@@ -1051,7 +1092,7 @@ |
698 | +@@ -1068,7 +1109,7 @@ |
699 | if (n_to_flush > 0) { |
700 | n_flushed = buf_flush_batch(BUF_FLUSH_LRU, n_to_flush, |
701 | ut_dulint_zero); |
702 | @@ -860,7 +883,7 @@ |
703 | /* There was an LRU type flush batch already running; |
704 | let us wait for it to end */ |
705 | |
706 | -@@ -1101,11 +1142,11 @@ |
707 | +@@ -1118,11 +1159,11 @@ |
708 | { |
709 | ibool ret; |
710 | |
711 | @@ -874,9 +897,9 @@ |
712 | |
713 | return(ret); |
714 | } |
715 | -diff -r 7ac364cc9b41 innobase/buf/buf0lru.c |
716 | ---- a/innobase/buf/buf0lru.c Fri Jul 03 15:41:50 2009 -0700 |
717 | -+++ b/innobase/buf/buf0lru.c Fri Jul 03 15:41:57 2009 -0700 |
718 | +diff -ruN a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c |
719 | +--- a/innobase/buf/buf0lru.c 2009-07-07 21:53:57.000000000 +0900 |
720 | ++++ b/innobase/buf/buf0lru.c 2009-08-28 11:06:30.000000000 +0900 |
721 | @@ -108,7 +108,7 @@ |
722 | |
723 | page_arr = ut_malloc(sizeof(ulint) |
724 | @@ -1242,10 +1265,10 @@ |
725 | - mutex_exit(&(buf_pool->mutex)); |
726 | + mutex_exit(&(buf_pool->LRU_mutex)); |
727 | } |
728 | -diff -r 7ac364cc9b41 innobase/buf/buf0rea.c |
729 | ---- a/innobase/buf/buf0rea.c Fri Jul 03 15:41:50 2009 -0700 |
730 | -+++ b/innobase/buf/buf0rea.c Fri Jul 03 15:41:57 2009 -0700 |
731 | -@@ -237,10 +237,12 @@ |
732 | +diff -ruN a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c |
733 | +--- a/innobase/buf/buf0rea.c 2009-08-28 11:08:17.000000000 +0900 |
734 | ++++ b/innobase/buf/buf0rea.c 2009-08-28 11:06:30.000000000 +0900 |
735 | +@@ -277,10 +277,12 @@ |
736 | |
737 | return(0); |
738 | } |
739 | @@ -1258,7 +1281,7 @@ |
740 | for (i = low; i < high; i++) { |
741 | block = buf_page_hash_get(space, i); |
742 | |
743 | -@@ -252,7 +254,7 @@ |
744 | +@@ -292,7 +294,7 @@ |
745 | } |
746 | } |
747 | |
748 | @@ -1267,7 +1290,7 @@ |
749 | |
750 | if (recent_blocks < BUF_READ_AHEAD_RANDOM_THRESHOLD) { |
751 | /* Do nothing */ |
752 | -@@ -348,7 +350,7 @@ |
753 | +@@ -388,7 +390,7 @@ |
754 | } |
755 | |
756 | /* Flush pages from the end of the LRU list if necessary */ |
757 | @@ -1276,7 +1299,7 @@ |
758 | |
759 | return(count + count2); |
760 | } |
761 | -@@ -451,6 +453,7 @@ |
762 | +@@ -491,6 +493,7 @@ |
763 | |
764 | return(0); |
765 | } |
766 | @@ -1284,7 +1307,7 @@ |
767 | |
768 | /* Check that almost all pages in the area have been accessed; if |
769 | offset == low, the accesses must be in a descending order, otherwise, |
770 | -@@ -464,6 +467,7 @@ |
771 | +@@ -504,6 +507,7 @@ |
772 | |
773 | fail_count = 0; |
774 | |
775 | @@ -1292,7 +1315,7 @@ |
776 | for (i = low; i < high; i++) { |
777 | block = buf_page_hash_get(space, i); |
778 | |
779 | -@@ -480,12 +484,11 @@ |
780 | +@@ -520,23 +524,23 @@ |
781 | pred_block = block; |
782 | } |
783 | } |
784 | @@ -1301,12 +1324,12 @@ |
785 | if (fail_count > BUF_READ_AHEAD_LINEAR_AREA - |
786 | BUF_READ_AHEAD_LINEAR_THRESHOLD) { |
787 | /* Too many failures: return */ |
788 | + |
789 | +- mutex_exit(&(buf_pool->mutex)); |
790 | - |
791 | -- mutex_exit(&(buf_pool->mutex)); |
792 | - |
793 | return(0); |
794 | } |
795 | -@@ -493,10 +496,11 @@ |
796 | + |
797 | /* If we got this far, we know that enough pages in the area have |
798 | been accessed in the right order: linear read-ahead can be sensible */ |
799 | |
800 | @@ -1319,7 +1342,7 @@ |
801 | |
802 | return(0); |
803 | } |
804 | -@@ -512,7 +516,7 @@ |
805 | +@@ -552,7 +556,7 @@ |
806 | pred_offset = fil_page_get_prev(frame); |
807 | succ_offset = fil_page_get_next(frame); |
808 | |
809 | @@ -1328,7 +1351,7 @@ |
810 | |
811 | if ((offset == low) && (succ_offset == offset + 1)) { |
812 | |
813 | -@@ -588,7 +592,7 @@ |
814 | +@@ -628,7 +632,7 @@ |
815 | os_aio_simulated_wake_handler_threads(); |
816 | |
817 | /* Flush pages from the end of the LRU list if necessary */ |
818 | @@ -1337,27 +1360,27 @@ |
819 | |
820 | #ifdef UNIV_DEBUG |
821 | if (buf_debug_prints && (count > 0)) { |
822 | -@@ -656,7 +660,7 @@ |
823 | - os_aio_simulated_wake_handler_threads(); |
824 | - |
825 | - /* Flush pages from the end of the LRU list if necessary */ |
826 | -- buf_flush_free_margin(); |
827 | -+ buf_flush_free_margin(FALSE); |
828 | - |
829 | - #ifdef UNIV_DEBUG |
830 | - if (buf_debug_prints) { |
831 | -@@ -728,7 +732,7 @@ |
832 | - os_aio_simulated_wake_handler_threads(); |
833 | - |
834 | - /* Flush pages from the end of the LRU list if necessary */ |
835 | -- buf_flush_free_margin(); |
836 | -+ buf_flush_free_margin(FALSE); |
837 | - |
838 | - #ifdef UNIV_DEBUG |
839 | - if (buf_debug_prints) { |
840 | -diff -r 7ac364cc9b41 innobase/include/buf0buf.h |
841 | ---- a/innobase/include/buf0buf.h Fri Jul 03 15:41:50 2009 -0700 |
842 | -+++ b/innobase/include/buf0buf.h Fri Jul 03 15:41:57 2009 -0700 |
843 | +@@ -696,7 +700,7 @@ |
844 | + os_aio_simulated_wake_handler_threads(); |
845 | + |
846 | + /* Flush pages from the end of the LRU list if necessary */ |
847 | +- buf_flush_free_margin(); |
848 | ++ buf_flush_free_margin(FALSE); |
849 | + |
850 | + #ifdef UNIV_DEBUG |
851 | + if (buf_debug_prints) { |
852 | +@@ -768,7 +772,7 @@ |
853 | + os_aio_simulated_wake_handler_threads(); |
854 | + |
855 | + /* Flush pages from the end of the LRU list if necessary */ |
856 | +- buf_flush_free_margin(); |
857 | ++ buf_flush_free_margin(FALSE); |
858 | + |
859 | + #ifdef UNIV_DEBUG |
860 | + if (buf_debug_prints) { |
861 | +diff -ruN a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h |
862 | +--- a/innobase/include/buf0buf.h 2009-08-28 11:08:16.000000000 +0900 |
863 | ++++ b/innobase/include/buf0buf.h 2009-08-28 11:06:30.000000000 +0900 |
864 | @@ -946,6 +946,7 @@ |
865 | mem_heap_t* io_counter_heap; |
866 | ulint io_counters; |
867 | @@ -1385,9 +1408,9 @@ |
868 | buf_block_t* LRU_old; /* pointer to the about 3/8 oldest |
869 | blocks in the LRU list; NULL if LRU |
870 | length less than BUF_LRU_OLD_MIN_LEN */ |
871 | -diff -r 7ac364cc9b41 innobase/include/buf0buf.ic |
872 | ---- a/innobase/include/buf0buf.ic Fri Jul 03 15:41:50 2009 -0700 |
873 | -+++ b/innobase/include/buf0buf.ic Fri Jul 03 15:41:57 2009 -0700 |
874 | +diff -ruN a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic |
875 | +--- a/innobase/include/buf0buf.ic 2009-07-07 21:54:00.000000000 +0900 |
876 | ++++ b/innobase/include/buf0buf.ic 2009-08-28 11:06:30.000000000 +0900 |
877 | @@ -112,7 +112,8 @@ |
878 | buf_block_t* block; |
879 | dulint lsn; |
880 | @@ -1505,9 +1528,9 @@ |
881 | |
882 | mutex_enter(&block->mutex); |
883 | |
884 | -diff -r 7ac364cc9b41 innobase/include/buf0flu.h |
885 | ---- a/innobase/include/buf0flu.h Fri Jul 03 15:41:50 2009 -0700 |
886 | -+++ b/innobase/include/buf0flu.h Fri Jul 03 15:41:57 2009 -0700 |
887 | +diff -ruN a/innobase/include/buf0flu.h b/innobase/include/buf0flu.h |
888 | +--- a/innobase/include/buf0flu.h 2009-07-07 21:54:00.000000000 +0900 |
889 | ++++ b/innobase/include/buf0flu.h 2009-08-28 11:06:30.000000000 +0900 |
890 | @@ -26,8 +26,9 @@ |
891 | a margin of replaceable pages there. */ |
892 | |
893 | @@ -1519,9 +1542,9 @@ |
894 | /************************************************************************ |
895 | Initializes a page for writing to the tablespace. */ |
896 | |
897 | -diff -r 7ac364cc9b41 innobase/include/buf0flu.ic |
898 | ---- a/innobase/include/buf0flu.ic Fri Jul 03 15:41:50 2009 -0700 |
899 | -+++ b/innobase/include/buf0flu.ic Fri Jul 03 15:41:57 2009 -0700 |
900 | +diff -ruN a/innobase/include/buf0flu.ic b/innobase/include/buf0flu.ic |
901 | +--- a/innobase/include/buf0flu.ic 2009-07-07 21:54:00.000000000 +0900 |
902 | ++++ b/innobase/include/buf0flu.ic 2009-08-28 11:06:30.000000000 +0900 |
903 | @@ -38,11 +38,14 @@ |
904 | mtr_t* mtr) /* in: mtr */ |
905 | { |
906 | @@ -1538,7 +1561,7 @@ |
907 | #endif /* UNIV_SYNC_DEBUG */ |
908 | |
909 | ut_ad(ut_dulint_cmp(mtr->start_lsn, ut_dulint_zero) != 0); |
910 | -@@ -52,15 +55,19 @@ |
911 | +@@ -52,16 +55,20 @@ |
912 | block->newest_modification = mtr->end_lsn; |
913 | |
914 | if (ut_dulint_is_zero(block->oldest_modification)) { |
915 | @@ -1553,11 +1576,12 @@ |
916 | ut_ad(ut_dulint_cmp(block->oldest_modification, |
917 | mtr->start_lsn) <= 0); |
918 | } |
919 | + |
920 | ++ mutex_exit(&block->mutex); |
921 | + |
922 | -+ mutex_exit(&block->mutex); |
923 | - |
924 | ++srv_buf_pool_write_requests; |
925 | } |
926 | + |
927 | @@ -78,29 +85,32 @@ |
928 | set of mtr's */ |
929 | { |
930 | @@ -1594,9 +1618,9 @@ |
931 | - mutex_exit(&(buf_pool->mutex)); |
932 | + mutex_exit(&(block->mutex)); |
933 | } |
934 | -diff -r 7ac364cc9b41 innobase/include/sync0sync.h |
935 | ---- a/innobase/include/sync0sync.h Fri Jul 03 15:41:50 2009 -0700 |
936 | -+++ b/innobase/include/sync0sync.h Fri Jul 03 15:41:57 2009 -0700 |
937 | +diff -ruN a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h |
938 | +--- a/innobase/include/sync0sync.h 2009-07-07 21:54:06.000000000 +0900 |
939 | ++++ b/innobase/include/sync0sync.h 2009-08-28 11:06:30.000000000 +0900 |
940 | @@ -438,8 +438,12 @@ |
941 | SYNC_SEARCH_SYS, as memory allocation |
942 | can call routines there! Otherwise |
943 | @@ -1611,10 +1635,10 @@ |
944 | #define SYNC_DOUBLEWRITE 140 |
945 | #define SYNC_ANY_LATCH 135 |
946 | #define SYNC_THR_LOCAL 133 |
947 | -diff -r 7ac364cc9b41 innobase/log/log0recv.c |
948 | ---- a/innobase/log/log0recv.c Fri Jul 03 15:41:50 2009 -0700 |
949 | -+++ b/innobase/log/log0recv.c Fri Jul 03 15:41:57 2009 -0700 |
950 | -@@ -1693,11 +1693,11 @@ |
951 | +diff -ruN a/innobase/log/log0recv.c b/innobase/log/log0recv.c |
952 | +--- a/innobase/log/log0recv.c 2009-08-28 11:08:17.000000000 +0900 |
953 | ++++ b/innobase/log/log0recv.c 2009-08-28 11:06:30.000000000 +0900 |
954 | +@@ -1695,11 +1695,11 @@ |
955 | |
956 | mtr_start(&mtr); |
957 | |
958 | @@ -1628,9 +1652,9 @@ |
959 | |
960 | replica = buf_page_get(space + RECV_REPLICA_SPACE_ADD, page_no, |
961 | RW_X_LATCH, &mtr); |
962 | -diff -r 7ac364cc9b41 innobase/mtr/mtr0mtr.c |
963 | ---- a/innobase/mtr/mtr0mtr.c Fri Jul 03 15:41:50 2009 -0700 |
964 | -+++ b/innobase/mtr/mtr0mtr.c Fri Jul 03 15:41:57 2009 -0700 |
965 | +diff -ruN a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c |
966 | +--- a/innobase/mtr/mtr0mtr.c 2009-07-07 21:54:08.000000000 +0900 |
967 | ++++ b/innobase/mtr/mtr0mtr.c 2009-08-28 11:06:30.000000000 +0900 |
968 | @@ -103,6 +103,38 @@ |
969 | } |
970 | } |
971 | @@ -1679,7 +1703,7 @@ |
972 | } |
973 | |
974 | /* We first update the modification info to buffer pages, and only |
975 | -@@ -187,11 +221,12 @@ |
976 | +@@ -187,12 +221,13 @@ |
977 | required when we insert modified buffer pages in to the flush list |
978 | which must be sorted on oldest_modification. */ |
979 | |
980 | @@ -1688,12 +1712,13 @@ |
981 | if (mtr->modifications) { |
982 | log_release(); |
983 | } |
984 | -+ |
985 | + |
986 | + /* All unlocking has been moved here, after log_sys mutex release. */ |
987 | + mtr_memo_pop_all(mtr); |
988 | - |
989 | ++ |
990 | #ifdef UNIV_DEBUG |
991 | mtr->state = MTR_COMMITTED; |
992 | + #endif |
993 | @@ -262,6 +297,12 @@ |
994 | slot = dyn_array_get_element(memo, offset); |
995 | |
996 | @@ -1707,10 +1732,10 @@ |
997 | |
998 | mtr_memo_slot_release(mtr, slot); |
999 | |
1000 | -diff -r 7ac364cc9b41 innobase/srv/srv0srv.c |
1001 | ---- a/innobase/srv/srv0srv.c Fri Jul 03 15:41:50 2009 -0700 |
1002 | -+++ b/innobase/srv/srv0srv.c Fri Jul 03 15:41:57 2009 -0700 |
1003 | -@@ -367,6 +367,7 @@ |
1004 | +diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c |
1005 | +--- a/innobase/srv/srv0srv.c 2009-08-28 11:08:17.000000000 +0900 |
1006 | ++++ b/innobase/srv/srv0srv.c 2009-08-28 11:06:30.000000000 +0900 |
1007 | +@@ -370,6 +370,7 @@ |
1008 | ulong srv_n_free_tickets_to_enter = 500; |
1009 | ulong srv_thread_sleep_delay = 10000; |
1010 | ulint srv_spin_wait_delay = 5; |
1011 | @@ -1718,7 +1743,7 @@ |
1012 | ibool srv_priority_boost = TRUE; |
1013 | |
1014 | ibool srv_print_thread_releases = FALSE; |
1015 | -@@ -673,6 +674,47 @@ |
1016 | +@@ -676,6 +677,47 @@ |
1017 | ulint srv_n_threads_active[SRV_MASTER + 1]; |
1018 | ulint srv_n_threads[SRV_MASTER + 1]; |
1019 | |
1020 | @@ -1766,16 +1791,16 @@ |
1021 | /************************************************************************* |
1022 | Sets the info describing an i/o thread current state. */ |
1023 | |
1024 | -@@ -905,6 +947,8 @@ |
1025 | - srv_slot_t* slot; |
1026 | +@@ -909,6 +951,8 @@ |
1027 | dict_table_t* table; |
1028 | ulint i; |
1029 | -+ |
1030 | + |
1031 | + srv_align_spins_microsec(); |
1032 | - |
1033 | ++ |
1034 | srv_sys = mem_alloc(sizeof(srv_sys_t)); |
1035 | |
1036 | -@@ -2661,7 +2705,7 @@ |
1037 | + kernel_mutex_temp = mem_alloc(sizeof(mutex_t)); |
1038 | +@@ -2665,7 +2709,7 @@ |
1039 | ib_longlong level, bpl; |
1040 | buf_block_t* bpage; |
1041 | |
1042 | @@ -1784,7 +1809,7 @@ |
1043 | |
1044 | level = 0; |
1045 | bpage = UT_LIST_GET_FIRST(buf_pool->flush_list); |
1046 | -@@ -2683,7 +2727,7 @@ |
1047 | +@@ -2687,7 +2731,7 @@ |
1048 | bpl = 0; |
1049 | } |
1050 | |
1051 | @@ -1793,9 +1818,9 @@ |
1052 | |
1053 | if (!srv_use_doublewrite_buf) { |
1054 | /* flush is faster than when doublewrite */ |
1055 | -diff -r 7ac364cc9b41 innobase/sync/sync0sync.c |
1056 | ---- a/innobase/sync/sync0sync.c Fri Jul 03 15:41:50 2009 -0700 |
1057 | -+++ b/innobase/sync/sync0sync.c Fri Jul 03 15:41:57 2009 -0700 |
1058 | +diff -ruN a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c |
1059 | +--- a/innobase/sync/sync0sync.c 2009-07-07 21:54:10.000000000 +0900 |
1060 | ++++ b/innobase/sync/sync0sync.c 2009-08-28 11:06:30.000000000 +0900 |
1061 | @@ -1105,11 +1105,19 @@ |
1062 | } else if (level == SYNC_DOUBLEWRITE) { |
1063 | ut_a(sync_thread_levels_g(array, SYNC_DOUBLEWRITE)); |
1064 | @@ -1817,9 +1842,9 @@ |
1065 | } else if (level == SYNC_SEARCH_SYS) { |
1066 | ut_a(sync_thread_levels_g(array, SYNC_SEARCH_SYS)); |
1067 | } else if (level == SYNC_TRX_LOCK_HEAP) { |
1068 | -diff -r 7ac364cc9b41 innobase/ut/ut0ut.c |
1069 | ---- a/innobase/ut/ut0ut.c Fri Jul 03 15:41:50 2009 -0700 |
1070 | -+++ b/innobase/ut/ut0ut.c Fri Jul 03 15:41:57 2009 -0700 |
1071 | +diff -ruN a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c |
1072 | +--- a/innobase/ut/ut0ut.c 2009-07-07 21:54:12.000000000 +0900 |
1073 | ++++ b/innobase/ut/ut0ut.c 2009-08-28 11:06:30.000000000 +0900 |
1074 | @@ -347,6 +347,7 @@ |
1075 | /***************************************************************** |
1076 | Runs an idle loop on CPU. The argument gives the desired delay |
1077 | @@ -1841,9 +1866,9 @@ |
1078 | j += i; |
1079 | } |
1080 | |
1081 | -diff -r 7ac364cc9b41 patch_info/innodb_split_buf_pool_mutex.info |
1082 | ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
1083 | -+++ b/patch_info/innodb_split_buf_pool_mutex.info Fri Jul 03 15:41:57 2009 -0700 |
1084 | +diff -ruN a/patch_info/innodb_split_buf_pool_mutex.info b/patch_info/innodb_split_buf_pool_mutex.info |
1085 | +--- /dev/null 1970-01-01 09:00:00.000000000 +0900 |
1086 | ++++ b/patch_info/innodb_split_buf_pool_mutex.info 2009-08-28 11:06:30.000000000 +0900 |
1087 | @@ -0,0 +1,6 @@ |
1088 | +File=innodb_split_buf_pool_mutex.patch |
1089 | +Name=InnoDB patch to fix buffer pool scalability |
1090 | @@ -1851,10 +1876,10 @@ |
1091 | +Author=Yasufumi Kinoshita |
1092 | +License=BSD |
1093 | +Comment=Backport from XtraDB |
1094 | -diff -r 7ac364cc9b41 sql/ha_innodb.cc |
1095 | ---- a/sql/ha_innodb.cc Fri Jul 03 15:41:50 2009 -0700 |
1096 | -+++ b/sql/ha_innodb.cc Fri Jul 03 15:41:57 2009 -0700 |
1097 | -@@ -1503,6 +1503,13 @@ |
1098 | +diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc |
1099 | +--- a/sql/ha_innodb.cc 2009-08-28 11:08:17.000000000 +0900 |
1100 | ++++ b/sql/ha_innodb.cc 2009-08-28 11:06:30.000000000 +0900 |
1101 | +@@ -1507,6 +1507,13 @@ |
1102 | /* We set srv_pool_size here in units of 1 kB. InnoDB internally |
1103 | changes the value so that it becomes the number of database pages. */ |
1104 |