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 @@ | |||
8 | 1 | diff -r 6eeee157fd40 innobase/dict/dict0boot.c | 1 | diff -ruN a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c |
9 | 2 | --- a/innobase/dict/dict0boot.c Fri Jul 03 15:41:34 2009 -0700 | 2 | --- a/innobase/btr/btr0sea.c 2009-08-27 18:42:17.000000000 +0900 |
10 | 3 | +++ b/innobase/dict/dict0boot.c Fri Jul 03 15:41:41 2009 -0700 | 3 | +++ b/innobase/btr/btr0sea.c 2009-08-27 18:43:11.000000000 +0900 |
11 | 4 | @@ -1077,6 +1077,124 @@ | ||
12 | 5 | } | ||
13 | 6 | |||
14 | 7 | /************************************************************************ | ||
15 | 8 | +Drops a page hash index based on index */ | ||
16 | 9 | + | ||
17 | 10 | +void | ||
18 | 11 | +btr_search_drop_page_hash_index_on_index( | ||
19 | 12 | +/*=====================================*/ | ||
20 | 13 | + dict_index_t* index) /* in: record descriptor */ | ||
21 | 14 | +{ | ||
22 | 15 | + page_t* page; | ||
23 | 16 | + hash_table_t* table; | ||
24 | 17 | + buf_block_t* block; | ||
25 | 18 | + ulint n_fields; | ||
26 | 19 | + ulint n_bytes; | ||
27 | 20 | + rec_t* rec; | ||
28 | 21 | + ulint fold; | ||
29 | 22 | + ulint prev_fold; | ||
30 | 23 | + dulint tree_id; | ||
31 | 24 | + ulint n_cached; | ||
32 | 25 | + ulint n_recs; | ||
33 | 26 | + ulint* folds; | ||
34 | 27 | + ulint i; | ||
35 | 28 | + mem_heap_t* heap = NULL; | ||
36 | 29 | + ulint* offsets; | ||
37 | 30 | + | ||
38 | 31 | + rw_lock_x_lock(&btr_search_latch); | ||
39 | 32 | + mutex_enter(&buf_pool->mutex); | ||
40 | 33 | + | ||
41 | 34 | + table = btr_search_sys->hash_index; | ||
42 | 35 | + | ||
43 | 36 | + block = UT_LIST_GET_LAST(buf_pool->LRU); | ||
44 | 37 | + | ||
45 | 38 | + while (block != NULL) { | ||
46 | 39 | + if (block->index == index && block->is_hashed) { | ||
47 | 40 | + page = block->frame; | ||
48 | 41 | + | ||
49 | 42 | + /* from btr_search_drop_page_hash_index() */ | ||
50 | 43 | + n_fields = block->curr_n_fields; | ||
51 | 44 | + n_bytes = block->curr_n_bytes; | ||
52 | 45 | + | ||
53 | 46 | + ut_a(n_fields + n_bytes > 0); | ||
54 | 47 | + | ||
55 | 48 | + n_recs = page_get_n_recs(page); | ||
56 | 49 | + | ||
57 | 50 | + /* Calculate and cache fold values into an array for fast deletion | ||
58 | 51 | + from the hash index */ | ||
59 | 52 | + | ||
60 | 53 | + folds = mem_alloc(n_recs * sizeof(ulint)); | ||
61 | 54 | + | ||
62 | 55 | + n_cached = 0; | ||
63 | 56 | + | ||
64 | 57 | + rec = page_get_infimum_rec(page); | ||
65 | 58 | + rec = page_rec_get_next(rec); | ||
66 | 59 | + | ||
67 | 60 | + tree_id = btr_page_get_index_id(page); | ||
68 | 61 | + | ||
69 | 62 | + ut_a(0 == ut_dulint_cmp(tree_id, index->id)); | ||
70 | 63 | + | ||
71 | 64 | + prev_fold = 0; | ||
72 | 65 | + | ||
73 | 66 | + offsets = NULL; | ||
74 | 67 | + | ||
75 | 68 | + while (!page_rec_is_supremum(rec)) { | ||
76 | 69 | + /* FIXME: in a mixed tree, not all records may have enough | ||
77 | 70 | + ordering fields: */ | ||
78 | 71 | + offsets = rec_get_offsets(rec, index, offsets, | ||
79 | 72 | + n_fields + (n_bytes > 0), &heap); | ||
80 | 73 | + ut_a(rec_offs_n_fields(offsets) == n_fields + (n_bytes > 0)); | ||
81 | 74 | + fold = rec_fold(rec, offsets, n_fields, n_bytes, tree_id); | ||
82 | 75 | + | ||
83 | 76 | + if (fold == prev_fold && prev_fold != 0) { | ||
84 | 77 | + | ||
85 | 78 | + goto next_rec; | ||
86 | 79 | + } | ||
87 | 80 | + | ||
88 | 81 | + /* Remove all hash nodes pointing to this page from the | ||
89 | 82 | + hash chain */ | ||
90 | 83 | + | ||
91 | 84 | + folds[n_cached] = fold; | ||
92 | 85 | + n_cached++; | ||
93 | 86 | +next_rec: | ||
94 | 87 | + rec = page_rec_get_next(rec); | ||
95 | 88 | + prev_fold = fold; | ||
96 | 89 | + } | ||
97 | 90 | + | ||
98 | 91 | + for (i = 0; i < n_cached; i++) { | ||
99 | 92 | + | ||
100 | 93 | + ha_remove_all_nodes_to_page(table, folds[i], page); | ||
101 | 94 | + } | ||
102 | 95 | + | ||
103 | 96 | + ut_a(index->search_info->ref_count > 0); | ||
104 | 97 | + index->search_info->ref_count--; | ||
105 | 98 | + | ||
106 | 99 | + block->is_hashed = FALSE; | ||
107 | 100 | + block->index = NULL; | ||
108 | 101 | + | ||
109 | 102 | + if (UNIV_UNLIKELY(block->n_pointers)) { | ||
110 | 103 | + /* Corruption */ | ||
111 | 104 | + ut_print_timestamp(stderr); | ||
112 | 105 | + fprintf(stderr, | ||
113 | 106 | +" InnoDB: Corruption of adaptive hash index. After dropping\n" | ||
114 | 107 | +"InnoDB: the hash index to a page of %s, still %lu hash nodes remain.\n", | ||
115 | 108 | + index->name, (ulong) block->n_pointers); | ||
116 | 109 | + } | ||
117 | 110 | + | ||
118 | 111 | + mem_free(folds); | ||
119 | 112 | + } | ||
120 | 113 | + | ||
121 | 114 | + block = UT_LIST_GET_PREV(LRU, block); | ||
122 | 115 | + } | ||
123 | 116 | + | ||
124 | 117 | + mutex_exit(&buf_pool->mutex); | ||
125 | 118 | + rw_lock_x_unlock(&btr_search_latch); | ||
126 | 119 | + | ||
127 | 120 | + if (UNIV_LIKELY_NULL(heap)) { | ||
128 | 121 | + mem_heap_free(heap); | ||
129 | 122 | + } | ||
130 | 123 | +} | ||
131 | 124 | + | ||
132 | 125 | +/************************************************************************ | ||
133 | 126 | Drops a page hash index when a page is freed from a fseg to the file system. | ||
134 | 127 | Drops possible hash index if the page happens to be in the buffer pool. */ | ||
135 | 128 | |||
136 | 129 | diff -ruN a/innobase/dict/dict0boot.c b/innobase/dict/dict0boot.c | ||
137 | 130 | --- a/innobase/dict/dict0boot.c 2009-07-07 21:53:58.000000000 +0900 | ||
138 | 131 | +++ b/innobase/dict/dict0boot.c 2009-08-27 18:42:59.000000000 +0900 | ||
139 | 4 | @@ -247,6 +247,7 @@ | 132 | @@ -247,6 +247,7 @@ |
140 | 5 | system tables */ | 133 | system tables */ |
141 | 6 | /*-------------------------*/ | 134 | /*-------------------------*/ |
142 | @@ -33,9 +161,9 @@ | |||
143 | 33 | 161 | ||
144 | 34 | dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0,0,0); | 162 | dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0,0,0); |
145 | 35 | dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0); | 163 | dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4, 0); |
149 | 36 | diff -r 6eeee157fd40 innobase/dict/dict0crea.c | 164 | diff -ruN a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c |
150 | 37 | --- a/innobase/dict/dict0crea.c Fri Jul 03 15:41:34 2009 -0700 | 165 | --- a/innobase/dict/dict0crea.c 2009-07-07 21:53:58.000000000 +0900 |
151 | 38 | +++ b/innobase/dict/dict0crea.c Fri Jul 03 15:41:41 2009 -0700 | 166 | +++ b/innobase/dict/dict0crea.c 2009-08-27 18:42:59.000000000 +0900 |
152 | 39 | @@ -1178,6 +1178,9 @@ | 167 | @@ -1178,6 +1178,9 @@ |
153 | 40 | /* Foreign constraint system tables have already been | 168 | /* Foreign constraint system tables have already been |
154 | 41 | created, and they are ok */ | 169 | created, and they are ok */ |
155 | @@ -46,21 +174,21 @@ | |||
156 | 46 | mutex_exit(&(dict_sys->mutex)); | 174 | mutex_exit(&(dict_sys->mutex)); |
157 | 47 | 175 | ||
158 | 48 | return(DB_SUCCESS); | 176 | return(DB_SUCCESS); |
161 | 49 | @@ -1266,6 +1269,11 @@ | 177 | @@ -1267,6 +1270,11 @@ |
160 | 50 | que_graph_free(graph); | ||
162 | 51 | 178 | ||
163 | 52 | trx->op_info = ""; | 179 | trx->op_info = ""; |
165 | 53 | + | 180 | |
166 | 54 | + table1 = dict_table_get_low("SYS_FOREIGN"); | 181 | + table1 = dict_table_get_low("SYS_FOREIGN"); |
167 | 55 | + table2 = dict_table_get_low("SYS_FOREIGN_COLS"); | 182 | + table2 = dict_table_get_low("SYS_FOREIGN_COLS"); |
168 | 56 | + table1->n_mysql_handles_opened = 1; /* for pin */ | 183 | + table1->n_mysql_handles_opened = 1; /* for pin */ |
169 | 57 | + table2->n_mysql_handles_opened = 1; /* for pin */ | 184 | + table2->n_mysql_handles_opened = 1; /* for pin */ |
171 | 58 | 185 | + | |
172 | 59 | row_mysql_unlock_data_dictionary(trx); | 186 | row_mysql_unlock_data_dictionary(trx); |
173 | 60 | 187 | ||
177 | 61 | diff -r 6eeee157fd40 innobase/dict/dict0dict.c | 188 | trx_free_for_mysql(trx); |
178 | 62 | --- a/innobase/dict/dict0dict.c Fri Jul 03 15:41:34 2009 -0700 | 189 | diff -ruN a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c |
179 | 63 | +++ b/innobase/dict/dict0dict.c Fri Jul 03 15:41:41 2009 -0700 | 190 | --- a/innobase/dict/dict0dict.c 2009-07-07 21:53:58.000000000 +0900 |
180 | 191 | +++ b/innobase/dict/dict0dict.c 2009-08-27 18:43:11.000000000 +0900 | ||
181 | 64 | @@ -638,6 +638,8 @@ | 192 | @@ -638,6 +638,8 @@ |
182 | 65 | mutex_enter(&(dict_sys->mutex)); | 193 | mutex_enter(&(dict_sys->mutex)); |
183 | 66 | 194 | ||
184 | @@ -79,15 +207,15 @@ | |||
185 | 79 | mutex_exit(&(dict_sys->mutex)); | 207 | mutex_exit(&(dict_sys->mutex)); |
186 | 80 | 208 | ||
187 | 81 | if (table != NULL) { | 209 | if (table != NULL) { |
190 | 82 | @@ -786,6 +790,8 @@ | 210 | @@ -787,6 +791,8 @@ |
189 | 83 | |||
191 | 84 | table->n_mysql_handles_opened++; | 211 | table->n_mysql_handles_opened++; |
192 | 85 | } | 212 | } |
193 | 213 | |||
194 | 214 | + dict_table_LRU_trim(table); | ||
195 | 86 | + | 215 | + |
196 | 87 | + dict_table_LRU_trim(table); | ||
197 | 88 | |||
198 | 89 | mutex_exit(&(dict_sys->mutex)); | 216 | mutex_exit(&(dict_sys->mutex)); |
199 | 90 | 217 | ||
200 | 218 | if (table != NULL) { | ||
201 | 91 | @@ -1267,20 +1273,64 @@ | 219 | @@ -1267,20 +1273,64 @@ |
202 | 92 | too much space. Currently not used! */ | 220 | too much space. Currently not used! */ |
203 | 93 | 221 | ||
204 | @@ -100,24 +228,18 @@ | |||
205 | 100 | { | 228 | { |
206 | 101 | dict_table_t* table; | 229 | dict_table_t* table; |
207 | 102 | dict_table_t* prev_table; | 230 | dict_table_t* prev_table; |
208 | 103 | - | ||
209 | 104 | - ut_error; | ||
210 | 105 | - | ||
211 | 106 | -#ifdef UNIV_SYNC_DEBUG | ||
212 | 107 | - ut_ad(mutex_own(&(dict_sys->mutex))); | ||
213 | 108 | -#endif /* UNIV_SYNC_DEBUG */ | ||
214 | 109 | - | ||
215 | 110 | + dict_foreign_t* foreign; | 231 | + dict_foreign_t* foreign; |
216 | 111 | + ulint n_removed; | 232 | + ulint n_removed; |
217 | 112 | + ulint n_have_parent; | 233 | + ulint n_have_parent; |
218 | 113 | + ulint cached_foreign_tables; | 234 | + ulint cached_foreign_tables; |
220 | 114 | + | 235 | |
221 | 236 | - ut_error; | ||
222 | 115 | + //ut_error; | 237 | + //ut_error; |
228 | 116 | + | 238 | |
229 | 117 | +#ifdef UNIV_SYNC_DEBUG | 239 | #ifdef UNIV_SYNC_DEBUG |
230 | 118 | + ut_ad(mutex_own(&(dict_sys->mutex))); | 240 | ut_ad(mutex_own(&(dict_sys->mutex))); |
231 | 119 | +#endif /* UNIV_SYNC_DEBUG */ | 241 | #endif /* UNIV_SYNC_DEBUG */ |
232 | 120 | + | 242 | |
233 | 121 | +retry: | 243 | +retry: |
234 | 122 | + n_removed = n_have_parent = 0; | 244 | + n_removed = n_have_parent = 0; |
235 | 123 | table = UT_LIST_GET_LAST(dict_sys->table_LRU); | 245 | table = UT_LIST_GET_LAST(dict_sys->table_LRU); |
236 | @@ -170,9 +292,20 @@ | |||
237 | 170 | } | 292 | } |
238 | 171 | 293 | ||
239 | 172 | /************************************************************************** | 294 | /************************************************************************** |
243 | 173 | diff -r 6eeee157fd40 innobase/ibuf/ibuf0ibuf.c | 295 | @@ -1565,6 +1616,10 @@ |
244 | 174 | --- a/innobase/ibuf/ibuf0ibuf.c Fri Jul 03 15:41:34 2009 -0700 | 296 | #ifdef UNIV_SYNC_DEBUG |
245 | 175 | +++ b/innobase/ibuf/ibuf0ibuf.c Fri Jul 03 15:41:41 2009 -0700 | 297 | ut_ad(mutex_own(&(dict_sys->mutex))); |
246 | 298 | #endif /* UNIV_SYNC_DEBUG */ | ||
247 | 299 | + /* remove all entry of the index from adaptive hash index, | ||
248 | 300 | + because removing from adaptive hash index needs dict_index */ | ||
249 | 301 | + if (srv_use_adaptive_hash_indexes && srv_dict_size_limit) | ||
250 | 302 | + btr_search_drop_page_hash_index_on_index(index); | ||
251 | 303 | |||
252 | 304 | /* We always create search info whether or not adaptive | ||
253 | 305 | hash index is enabled or not. */ | ||
254 | 306 | diff -ruN a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c | ||
255 | 307 | --- a/innobase/ibuf/ibuf0ibuf.c 2009-08-27 18:42:17.000000000 +0900 | ||
256 | 308 | +++ b/innobase/ibuf/ibuf0ibuf.c 2009-08-27 18:42:59.000000000 +0900 | ||
257 | 176 | @@ -535,6 +535,7 @@ | 309 | @@ -535,6 +535,7 @@ |
258 | 177 | sprintf(buf, "SYS_IBUF_TABLE_%lu", (ulong) space); | 310 | sprintf(buf, "SYS_IBUF_TABLE_%lu", (ulong) space); |
259 | 178 | /* use old-style record format for the insert buffer */ | 311 | /* use old-style record format for the insert buffer */ |
260 | @@ -181,9 +314,26 @@ | |||
261 | 181 | 314 | ||
262 | 182 | dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0, 0); | 315 | dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0, 0); |
263 | 183 | dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0, 0); | 316 | dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0, 0); |
267 | 184 | diff -r 6eeee157fd40 innobase/include/dict0dict.h | 317 | diff -ruN a/innobase/include/btr0sea.h b/innobase/include/btr0sea.h |
268 | 185 | --- a/innobase/include/dict0dict.h Fri Jul 03 15:41:34 2009 -0700 | 318 | --- a/innobase/include/btr0sea.h 2009-07-07 21:54:00.000000000 +0900 |
269 | 186 | +++ b/innobase/include/dict0dict.h Fri Jul 03 15:41:41 2009 -0700 | 319 | +++ b/innobase/include/btr0sea.h 2009-08-27 18:43:11.000000000 +0900 |
270 | 320 | @@ -97,6 +97,13 @@ | ||
271 | 321 | /*============================*/ | ||
272 | 322 | page_t* page); /* in: index page, s- or x-latched */ | ||
273 | 323 | /************************************************************************ | ||
274 | 324 | +Drops a page hash index based on index */ | ||
275 | 325 | + | ||
276 | 326 | +void | ||
277 | 327 | +btr_search_drop_page_hash_index_on_index( | ||
278 | 328 | +/*=====================================*/ | ||
279 | 329 | + dict_index_t* index); /* in: record descriptor */ | ||
280 | 330 | +/************************************************************************ | ||
281 | 331 | Drops a page hash index when a page is freed from a fseg to the file system. | ||
282 | 332 | Drops possible hash index if the page happens to be in the buffer pool. */ | ||
283 | 333 | |||
284 | 334 | diff -ruN a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h | ||
285 | 335 | --- a/innobase/include/dict0dict.h 2009-07-07 21:54:01.000000000 +0900 | ||
286 | 336 | +++ b/innobase/include/dict0dict.h 2009-08-27 18:42:59.000000000 +0900 | ||
287 | 187 | @@ -938,6 +938,11 @@ | 337 | @@ -938,6 +938,11 @@ |
288 | 188 | const char* ptr, /* in: scan from */ | 338 | const char* ptr, /* in: scan from */ |
289 | 189 | const char* string);/* in: look for this */ | 339 | const char* string);/* in: look for this */ |
290 | @@ -196,9 +346,9 @@ | |||
291 | 196 | /* Buffers for storing detailed information about the latest foreign key | 346 | /* Buffers for storing detailed information about the latest foreign key |
292 | 197 | and unique key errors */ | 347 | and unique key errors */ |
293 | 198 | extern FILE* dict_foreign_err_file; | 348 | extern FILE* dict_foreign_err_file; |
297 | 199 | diff -r 6eeee157fd40 innobase/include/dict0dict.ic | 349 | diff -ruN a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic |
298 | 200 | --- a/innobase/include/dict0dict.ic Fri Jul 03 15:41:34 2009 -0700 | 350 | --- a/innobase/include/dict0dict.ic 2009-07-07 21:54:01.000000000 +0900 |
299 | 201 | +++ b/innobase/include/dict0dict.ic Fri Jul 03 15:41:41 2009 -0700 | 351 | +++ b/innobase/include/dict0dict.ic 2009-08-27 18:42:59.000000000 +0900 |
300 | 202 | @@ -533,6 +533,13 @@ | 352 | @@ -533,6 +533,13 @@ |
301 | 203 | 353 | ||
302 | 204 | HASH_SEARCH(name_hash, dict_sys->table_hash, table_fold, table, | 354 | HASH_SEARCH(name_hash, dict_sys->table_hash, table_fold, table, |
303 | @@ -224,18 +374,18 @@ | |||
304 | 224 | /* lock_push(trx, table, LOCK_DICT_MEM_FIX) */ | 374 | /* lock_push(trx, table, LOCK_DICT_MEM_FIX) */ |
305 | 225 | } | 375 | } |
306 | 226 | 376 | ||
312 | 227 | diff -r 6eeee157fd40 innobase/include/srv0srv.h | 377 | diff -ruN a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h |
313 | 228 | --- a/innobase/include/srv0srv.h Fri Jul 03 15:41:34 2009 -0700 | 378 | --- a/innobase/include/srv0srv.h 2009-08-27 18:42:17.000000000 +0900 |
314 | 229 | +++ b/innobase/include/srv0srv.h Fri Jul 03 15:41:41 2009 -0700 | 379 | +++ b/innobase/include/srv0srv.h 2009-08-27 18:42:59.000000000 +0900 |
315 | 230 | @@ -146,6 +146,8 @@ | 380 | @@ -147,6 +147,8 @@ |
311 | 231 | extern ulint srv_enable_unsafe_group_commit; | ||
316 | 232 | extern uint srv_read_ahead; | 381 | extern uint srv_read_ahead; |
317 | 233 | extern uint srv_adaptive_checkpoint; | 382 | extern uint srv_adaptive_checkpoint; |
319 | 234 | + | 383 | |
320 | 235 | +extern ulint srv_dict_size_limit; | 384 | +extern ulint srv_dict_size_limit; |
322 | 236 | 385 | + | |
323 | 237 | extern volatile ibool srv_io_pattern; | 386 | extern volatile ibool srv_io_pattern; |
324 | 238 | extern ulong srv_io_pattern_trace; | 387 | extern ulong srv_io_pattern_trace; |
325 | 388 | extern ulong srv_io_pattern_trace_running; | ||
326 | 239 | @@ -552,6 +554,7 @@ | 389 | @@ -552,6 +554,7 @@ |
327 | 240 | ulint innodb_data_writes; | 390 | ulint innodb_data_writes; |
328 | 241 | ulint innodb_data_written; | 391 | ulint innodb_data_written; |
329 | @@ -244,18 +394,18 @@ | |||
330 | 244 | ulint innodb_buffer_pool_pages_total; | 394 | ulint innodb_buffer_pool_pages_total; |
331 | 245 | ulint innodb_buffer_pool_pages_data; | 395 | ulint innodb_buffer_pool_pages_data; |
332 | 246 | ulint innodb_buffer_pool_pages_dirty; | 396 | ulint innodb_buffer_pool_pages_dirty; |
338 | 247 | diff -r 6eeee157fd40 innobase/srv/srv0srv.c | 397 | diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c |
339 | 248 | --- a/innobase/srv/srv0srv.c Fri Jul 03 15:41:34 2009 -0700 | 398 | --- a/innobase/srv/srv0srv.c 2009-08-27 18:42:17.000000000 +0900 |
340 | 249 | +++ b/innobase/srv/srv0srv.c Fri Jul 03 15:41:41 2009 -0700 | 399 | +++ b/innobase/srv/srv0srv.c 2009-08-27 18:42:59.000000000 +0900 |
341 | 250 | @@ -352,6 +352,8 @@ | 400 | @@ -353,6 +353,8 @@ |
337 | 251 | |||
342 | 252 | uint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */ | 401 | uint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */ |
343 | 253 | uint srv_adaptive_checkpoint = 0; /* 0: none 1: reflex 2: estimate */ | 402 | uint srv_adaptive_checkpoint = 0; /* 0: none 1: reflex 2: estimate */ |
345 | 254 | + | 403 | |
346 | 255 | +ulint srv_dict_size_limit = 0; | 404 | +ulint srv_dict_size_limit = 0; |
348 | 256 | 405 | + | |
349 | 257 | volatile ibool srv_io_pattern = FALSE; | 406 | volatile ibool srv_io_pattern = FALSE; |
350 | 258 | ulint srv_io_pattern_trace = 0; | 407 | ulint srv_io_pattern_trace = 0; |
351 | 408 | ulint srv_io_pattern_trace_running = 0; | ||
352 | 259 | @@ -1953,6 +1955,7 @@ | 409 | @@ -1953,6 +1955,7 @@ |
353 | 260 | export_vars.innodb_data_reads= os_n_file_reads; | 410 | export_vars.innodb_data_reads= os_n_file_reads; |
354 | 261 | export_vars.innodb_data_writes= os_n_file_writes; | 411 | export_vars.innodb_data_writes= os_n_file_writes; |
355 | @@ -264,9 +414,9 @@ | |||
356 | 264 | export_vars.innodb_buffer_pool_read_requests= buf_pool->n_page_gets; | 414 | export_vars.innodb_buffer_pool_read_requests= buf_pool->n_page_gets; |
357 | 265 | export_vars.innodb_buffer_pool_write_requests= srv_buf_pool_write_requests; | 415 | export_vars.innodb_buffer_pool_write_requests= srv_buf_pool_write_requests; |
358 | 266 | export_vars.innodb_buffer_pool_wait_free= srv_buf_pool_wait_free; | 416 | export_vars.innodb_buffer_pool_wait_free= srv_buf_pool_wait_free; |
362 | 267 | diff -r 6eeee157fd40 mysql-test/r/innodb_dict_size_limit.result | 417 | diff -ruN a/mysql-test/r/innodb_dict_size_limit.result b/mysql-test/r/innodb_dict_size_limit.result |
363 | 268 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | 418 | --- /dev/null 1970-01-01 09:00:00.000000000 +0900 |
364 | 269 | +++ b/mysql-test/r/innodb_dict_size_limit.result Fri Jul 03 15:41:41 2009 -0700 | 419 | +++ b/mysql-test/r/innodb_dict_size_limit.result 2009-08-27 18:42:59.000000000 +0900 |
365 | 270 | @@ -0,0 +1,60 @@ | 420 | @@ -0,0 +1,60 @@ |
366 | 271 | +DROP TABLE IF EXISTS `test_5`; | 421 | +DROP TABLE IF EXISTS `test_5`; |
367 | 272 | +DROP TABLE IF EXISTS `test_4`; | 422 | +DROP TABLE IF EXISTS `test_4`; |
368 | @@ -328,9 +478,9 @@ | |||
369 | 328 | +DROP TABLE `test_3`; | 478 | +DROP TABLE `test_3`; |
370 | 329 | +DROP TABLE `test_2`; | 479 | +DROP TABLE `test_2`; |
371 | 330 | +DROP TABLE `test_1`; | 480 | +DROP TABLE `test_1`; |
375 | 331 | diff -r 6eeee157fd40 mysql-test/t/innodb_dict_size_limit.test | 481 | diff -ruN a/mysql-test/t/innodb_dict_size_limit.test b/mysql-test/t/innodb_dict_size_limit.test |
376 | 332 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | 482 | --- /dev/null 1970-01-01 09:00:00.000000000 +0900 |
377 | 333 | +++ b/mysql-test/t/innodb_dict_size_limit.test Fri Jul 03 15:41:41 2009 -0700 | 483 | +++ b/mysql-test/t/innodb_dict_size_limit.test 2009-08-27 18:42:59.000000000 +0900 |
378 | 334 | @@ -0,0 +1,63 @@ | 484 | @@ -0,0 +1,63 @@ |
379 | 335 | +# | 485 | +# |
380 | 336 | +# Test for new variable innodb_dict_size_limit; | 486 | +# Test for new variable innodb_dict_size_limit; |
381 | @@ -395,9 +545,9 @@ | |||
382 | 395 | +DROP TABLE `test_2`; | 545 | +DROP TABLE `test_2`; |
383 | 396 | +DROP TABLE `test_1`; | 546 | +DROP TABLE `test_1`; |
384 | 397 | + | 547 | + |
388 | 398 | diff -r 6eeee157fd40 patch_info/innodb_dict_size_limit.info | 548 | diff -ruN a/patch_info/innodb_dict_size_limit.info b/patch_info/innodb_dict_size_limit.info |
389 | 399 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | 549 | --- /dev/null 1970-01-01 09:00:00.000000000 +0900 |
390 | 400 | +++ b/patch_info/innodb_dict_size_limit.info Fri Jul 03 15:41:41 2009 -0700 | 550 | +++ b/patch_info/innodb_dict_size_limit.info 2009-08-27 18:42:59.000000000 +0900 |
391 | 401 | @@ -0,0 +1,9 @@ | 551 | @@ -0,0 +1,9 @@ |
392 | 402 | +File=innodb_dict_size_limit.patch | 552 | +File=innodb_dict_size_limit.patch |
393 | 403 | +Name=Limit dictionary cache size | 553 | +Name=Limit dictionary cache size |
394 | @@ -408,9 +558,9 @@ | |||
395 | 408 | +ChangeLog= | 558 | +ChangeLog= |
396 | 409 | +2009-01-26 | 559 | +2009-01-26 |
397 | 410 | +YK: Initial release | 560 | +YK: Initial release |
401 | 411 | diff -r 6eeee157fd40 sql/ha_innodb.cc | 561 | diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc |
402 | 412 | --- a/sql/ha_innodb.cc Fri Jul 03 15:41:34 2009 -0700 | 562 | --- a/sql/ha_innodb.cc 2009-08-27 18:42:17.000000000 +0900 |
403 | 413 | +++ b/sql/ha_innodb.cc Fri Jul 03 15:41:41 2009 -0700 | 563 | +++ b/sql/ha_innodb.cc 2009-08-27 18:42:59.000000000 +0900 |
404 | 414 | @@ -288,6 +288,8 @@ | 564 | @@ -288,6 +288,8 @@ |
405 | 415 | (char*) &export_vars.innodb_dblwr_pages_written, SHOW_LONG}, | 565 | (char*) &export_vars.innodb_dblwr_pages_written, SHOW_LONG}, |
406 | 416 | {"dblwr_writes", | 566 | {"dblwr_writes", |
407 | @@ -420,9 +570,9 @@ | |||
408 | 420 | {"log_waits", | 570 | {"log_waits", |
409 | 421 | (char*) &export_vars.innodb_log_waits, SHOW_LONG}, | 571 | (char*) &export_vars.innodb_log_waits, SHOW_LONG}, |
410 | 422 | {"log_write_requests", | 572 | {"log_write_requests", |
414 | 423 | diff -r 6eeee157fd40 sql/ha_innodb.h | 573 | diff -ruN a/sql/ha_innodb.h b/sql/ha_innodb.h |
415 | 424 | --- a/sql/ha_innodb.h Fri Jul 03 15:41:34 2009 -0700 | 574 | --- a/sql/ha_innodb.h 2009-08-27 18:42:17.000000000 +0900 |
416 | 425 | +++ b/sql/ha_innodb.h Fri Jul 03 15:41:41 2009 -0700 | 575 | +++ b/sql/ha_innodb.h 2009-08-27 18:42:59.000000000 +0900 |
417 | 426 | @@ -243,6 +243,7 @@ | 576 | @@ -243,6 +243,7 @@ |
418 | 427 | extern ulong srv_enable_unsafe_group_commit; | 577 | extern ulong srv_enable_unsafe_group_commit; |
419 | 428 | extern uint srv_read_ahead; | 578 | extern uint srv_read_ahead; |
420 | @@ -431,9 +581,9 @@ | |||
421 | 431 | extern ulong srv_show_locks_held; | 581 | extern ulong srv_show_locks_held; |
422 | 432 | extern ulong srv_show_verbose_locks; | 582 | extern ulong srv_show_verbose_locks; |
423 | 433 | extern ulong srv_io_pattern_trace; | 583 | extern ulong srv_io_pattern_trace; |
427 | 434 | diff -r 6eeee157fd40 sql/mysqld.cc | 584 | diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc |
428 | 435 | --- a/sql/mysqld.cc Fri Jul 03 15:41:34 2009 -0700 | 585 | --- a/sql/mysqld.cc 2009-08-27 18:42:17.000000000 +0900 |
429 | 436 | +++ b/sql/mysqld.cc Fri Jul 03 15:41:41 2009 -0700 | 586 | +++ b/sql/mysqld.cc 2009-08-27 18:42:59.000000000 +0900 |
430 | 437 | @@ -5101,6 +5101,7 @@ | 587 | @@ -5101,6 +5101,7 @@ |
431 | 438 | OPT_INNODB_ADAPTIVE_CHECKPOINT, | 588 | OPT_INNODB_ADAPTIVE_CHECKPOINT, |
432 | 439 | OPT_INNODB_READ_IO_THREADS, | 589 | OPT_INNODB_READ_IO_THREADS, |
433 | @@ -453,9 +603,9 @@ | |||
434 | 453 | {"innodb_io_pattern_trace", OPT_INNODB_IO_PATTERN_TRACE, | 603 | {"innodb_io_pattern_trace", OPT_INNODB_IO_PATTERN_TRACE, |
435 | 454 | "Create/Drop the internal hash table for IO pattern tracing.", | 604 | "Create/Drop the internal hash table for IO pattern tracing.", |
436 | 455 | (gptr*) &srv_io_pattern_trace, (gptr*) &srv_io_pattern_trace, | 605 | (gptr*) &srv_io_pattern_trace, (gptr*) &srv_io_pattern_trace, |
440 | 456 | diff -r 6eeee157fd40 sql/set_var.cc | 606 | diff -ruN a/sql/set_var.cc b/sql/set_var.cc |
441 | 457 | --- a/sql/set_var.cc Fri Jul 03 15:41:34 2009 -0700 | 607 | --- a/sql/set_var.cc 2009-08-27 18:42:17.000000000 +0900 |
442 | 458 | +++ b/sql/set_var.cc Fri Jul 03 15:41:41 2009 -0700 | 608 | +++ b/sql/set_var.cc 2009-08-27 18:42:59.000000000 +0900 |
443 | 459 | @@ -540,6 +540,8 @@ | 609 | @@ -540,6 +540,8 @@ |
444 | 460 | sys_var_enum sys_innodb_adaptive_checkpoint("innodb_adaptive_checkpoint", | 610 | sys_var_enum sys_innodb_adaptive_checkpoint("innodb_adaptive_checkpoint", |
445 | 461 | &srv_adaptive_checkpoint, | 611 | &srv_adaptive_checkpoint, |
446 | 462 | 612 | ||
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 @@ | |||
454 | 1 | diff -r 7ac364cc9b41 innobase/buf/buf0buf.c | 1 | diff -ruN a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c |
455 | 2 | --- a/innobase/buf/buf0buf.c Fri Jul 03 15:41:50 2009 -0700 | 2 | --- a/innobase/btr/btr0sea.c 2009-08-28 11:08:16.000000000 +0900 |
456 | 3 | +++ b/innobase/buf/buf0buf.c Fri Jul 03 15:41:57 2009 -0700 | 3 | +++ b/innobase/btr/btr0sea.c 2009-08-28 11:06:20.000000000 +0900 |
457 | 4 | @@ -1101,7 +1101,7 @@ | ||
458 | 5 | ulint* offsets; | ||
459 | 6 | |||
460 | 7 | rw_lock_x_lock(&btr_search_latch); | ||
461 | 8 | - mutex_enter(&buf_pool->mutex); | ||
462 | 9 | + mutex_enter(&buf_pool->LRU_mutex); | ||
463 | 10 | |||
464 | 11 | table = btr_search_sys->hash_index; | ||
465 | 12 | |||
466 | 13 | @@ -1186,7 +1186,7 @@ | ||
467 | 14 | block = UT_LIST_GET_PREV(LRU, block); | ||
468 | 15 | } | ||
469 | 16 | |||
470 | 17 | - mutex_exit(&buf_pool->mutex); | ||
471 | 18 | + mutex_exit(&buf_pool->LRU_mutex); | ||
472 | 19 | rw_lock_x_unlock(&btr_search_latch); | ||
473 | 20 | |||
474 | 21 | if (UNIV_LIKELY_NULL(heap)) { | ||
475 | 22 | diff -ruN a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c | ||
476 | 23 | --- a/innobase/buf/buf0buf.c 2009-08-28 11:08:16.000000000 +0900 | ||
477 | 24 | +++ b/innobase/buf/buf0buf.c 2009-08-28 11:06:30.000000000 +0900 | ||
478 | 4 | @@ -549,6 +549,17 @@ | 25 | @@ -549,6 +549,17 @@ |
479 | 5 | mutex_create(&(buf_pool->mutex)); | 26 | mutex_create(&(buf_pool->mutex)); |
480 | 6 | mutex_set_level(&(buf_pool->mutex), SYNC_BUF_POOL); | 27 | mutex_set_level(&(buf_pool->mutex), SYNC_BUF_POOL); |
481 | @@ -377,7 +398,7 @@ | |||
482 | 377 | #ifdef UNIV_DEBUG | 398 | #ifdef UNIV_DEBUG |
483 | 378 | if (buf_debug_prints) { | 399 | if (buf_debug_prints) { |
484 | 379 | fputs("Has read ", stderr); | 400 | fputs("Has read ", stderr); |
486 | 380 | @@ -2103,10 +2136,23 @@ | 401 | @@ -2103,11 +2136,24 @@ |
487 | 381 | } else { | 402 | } else { |
488 | 382 | ut_ad(io_type == BUF_IO_WRITE); | 403 | ut_ad(io_type == BUF_IO_WRITE); |
489 | 383 | 404 | ||
490 | @@ -394,13 +415,14 @@ | |||
491 | 394 | routine in the flush system */ | 415 | routine in the flush system */ |
492 | 395 | 416 | ||
493 | 396 | buf_flush_write_complete(block); | 417 | buf_flush_write_complete(block); |
495 | 397 | + | 418 | |
496 | 398 | + if (flush_type == BUF_FLUSH_LRU) { | 419 | + if (flush_type == BUF_FLUSH_LRU) { |
497 | 399 | + mutex_exit(&(buf_pool->LRU_mutex)); | 420 | + mutex_exit(&(buf_pool->LRU_mutex)); |
498 | 400 | + } | 421 | + } |
500 | 401 | 422 | + | |
501 | 402 | rw_lock_s_unlock_gen(&(block->lock), BUF_IO_WRITE); | 423 | rw_lock_s_unlock_gen(&(block->lock), BUF_IO_WRITE); |
502 | 403 | /* io_counter here */ | 424 | /* io_counter here */ |
503 | 425 | if (srv_io_pattern && srv_io_pattern_trace_running) { | ||
504 | 404 | @@ -2132,6 +2178,9 @@ | 426 | @@ -2132,6 +2178,9 @@ |
505 | 405 | 427 | ||
506 | 406 | buf_pool->n_pages_written++; | 428 | buf_pool->n_pages_written++; |
507 | @@ -587,9 +609,9 @@ | |||
508 | 587 | 609 | ||
509 | 588 | return(len); | 610 | return(len); |
510 | 589 | } | 611 | } |
514 | 590 | diff -r 7ac364cc9b41 innobase/buf/buf0flu.c | 612 | diff -ruN a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c |
515 | 591 | --- a/innobase/buf/buf0flu.c Fri Jul 03 15:41:50 2009 -0700 | 613 | --- a/innobase/buf/buf0flu.c 2009-08-28 11:08:17.000000000 +0900 |
516 | 592 | +++ b/innobase/buf/buf0flu.c Fri Jul 03 15:41:57 2009 -0700 | 614 | +++ b/innobase/buf/buf0flu.c 2009-08-28 11:06:30.000000000 +0900 |
517 | 593 | @@ -49,7 +49,9 @@ | 615 | @@ -49,7 +49,9 @@ |
518 | 594 | buf_block_t* block) /* in: block which is modified */ | 616 | buf_block_t* block) /* in: block which is modified */ |
519 | 595 | { | 617 | { |
520 | @@ -612,7 +634,7 @@ | |||
521 | 612 | #endif /* UNIV_SYNC_DEBUG */ | 634 | #endif /* UNIV_SYNC_DEBUG */ |
522 | 613 | 635 | ||
523 | 614 | prev_b = NULL; | 636 | prev_b = NULL; |
525 | 615 | @@ -113,16 +117,18 @@ | 637 | @@ -130,16 +134,18 @@ |
526 | 616 | BUF_BLOCK_FILE_PAGE and in the LRU list */ | 638 | BUF_BLOCK_FILE_PAGE and in the LRU list */ |
527 | 617 | { | 639 | { |
528 | 618 | #ifdef UNIV_SYNC_DEBUG | 640 | #ifdef UNIV_SYNC_DEBUG |
529 | @@ -634,7 +656,7 @@ | |||
530 | 634 | return(FALSE); | 656 | return(FALSE); |
531 | 635 | } | 657 | } |
532 | 636 | 658 | ||
534 | 637 | @@ -148,12 +154,13 @@ | 659 | @@ -165,12 +171,13 @@ |
535 | 638 | ulint flush_type)/* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */ | 660 | ulint flush_type)/* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */ |
536 | 639 | { | 661 | { |
537 | 640 | #ifdef UNIV_SYNC_DEBUG | 662 | #ifdef UNIV_SYNC_DEBUG |
538 | @@ -651,7 +673,7 @@ | |||
539 | 651 | && (block->io_fix == 0)) { | 673 | && (block->io_fix == 0)) { |
540 | 652 | if (flush_type != BUF_FLUSH_LRU) { | 674 | if (flush_type != BUF_FLUSH_LRU) { |
541 | 653 | 675 | ||
543 | 654 | @@ -182,15 +189,17 @@ | 676 | @@ -199,15 +206,17 @@ |
544 | 655 | { | 677 | { |
545 | 656 | ut_ad(block); | 678 | ut_ad(block); |
546 | 657 | #ifdef UNIV_SYNC_DEBUG | 679 | #ifdef UNIV_SYNC_DEBUG |
547 | @@ -670,7 +692,7 @@ | |||
548 | 670 | 692 | ||
549 | 671 | (buf_pool->n_flush[block->flush_type])--; | 693 | (buf_pool->n_flush[block->flush_type])--; |
550 | 672 | 694 | ||
552 | 673 | @@ -536,18 +545,20 @@ | 695 | @@ -553,18 +562,20 @@ |
553 | 674 | ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST | 696 | ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST |
554 | 675 | || flush_type == BUF_FLUSH_SINGLE_PAGE); | 697 | || flush_type == BUF_FLUSH_SINGLE_PAGE); |
555 | 676 | 698 | ||
556 | @@ -693,7 +715,7 @@ | |||
557 | 693 | 715 | ||
558 | 694 | if (flush_type == BUF_FLUSH_LIST | 716 | if (flush_type == BUF_FLUSH_LIST |
559 | 695 | && buf_flush_ready_for_flush(block, flush_type)) { | 717 | && buf_flush_ready_for_flush(block, flush_type)) { |
561 | 696 | @@ -744,7 +755,7 @@ | 718 | @@ -761,7 +772,7 @@ |
562 | 697 | high = fil_space_get_size(space); | 719 | high = fil_space_get_size(space); |
563 | 698 | } | 720 | } |
564 | 699 | 721 | ||
565 | @@ -702,7 +724,7 @@ | |||
566 | 702 | 724 | ||
567 | 703 | for (i = low; i < high; i++) { | 725 | for (i = low; i < high; i++) { |
568 | 704 | 726 | ||
570 | 705 | @@ -778,7 +789,7 @@ | 727 | @@ -795,7 +806,7 @@ |
571 | 706 | 728 | ||
572 | 707 | mutex_exit(&block->mutex); | 729 | mutex_exit(&block->mutex); |
573 | 708 | 730 | ||
574 | @@ -711,7 +733,7 @@ | |||
575 | 711 | 733 | ||
576 | 712 | /* Note: as we release the buf_pool mutex | 734 | /* Note: as we release the buf_pool mutex |
577 | 713 | above, in buf_flush_try_page we cannot be sure | 735 | above, in buf_flush_try_page we cannot be sure |
579 | 714 | @@ -789,14 +800,14 @@ | 736 | @@ -806,14 +817,14 @@ |
580 | 715 | count += buf_flush_try_page(space, i, | 737 | count += buf_flush_try_page(space, i, |
581 | 716 | flush_type); | 738 | flush_type); |
582 | 717 | 739 | ||
583 | @@ -728,7 +750,7 @@ | |||
584 | 728 | 750 | ||
585 | 729 | return(count); | 751 | return(count); |
586 | 730 | } | 752 | } |
588 | 731 | @@ -831,6 +842,7 @@ | 753 | @@ -848,6 +859,7 @@ |
589 | 732 | ulint space; | 754 | ulint space; |
590 | 733 | ulint offset; | 755 | ulint offset; |
591 | 734 | ibool found; | 756 | ibool found; |
592 | @@ -736,7 +758,7 @@ | |||
593 | 736 | 758 | ||
594 | 737 | ut_ad((flush_type == BUF_FLUSH_LRU) | 759 | ut_ad((flush_type == BUF_FLUSH_LRU) |
595 | 738 | || (flush_type == BUF_FLUSH_LIST)); | 760 | || (flush_type == BUF_FLUSH_LIST)); |
597 | 739 | @@ -849,6 +861,12 @@ | 761 | @@ -866,6 +878,12 @@ |
598 | 740 | } | 762 | } |
599 | 741 | 763 | ||
600 | 742 | (buf_pool->init_flush)[flush_type] = TRUE; | 764 | (buf_pool->init_flush)[flush_type] = TRUE; |
601 | @@ -749,7 +771,7 @@ | |||
602 | 749 | 771 | ||
603 | 750 | for (;;) { | 772 | for (;;) { |
604 | 751 | /* If we have flushed enough, leave the loop */ | 773 | /* If we have flushed enough, leave the loop */ |
606 | 752 | @@ -865,7 +883,10 @@ | 774 | @@ -882,7 +900,10 @@ |
607 | 753 | } else { | 775 | } else { |
608 | 754 | ut_ad(flush_type == BUF_FLUSH_LIST); | 776 | ut_ad(flush_type == BUF_FLUSH_LIST); |
609 | 755 | 777 | ||
610 | @@ -760,7 +782,7 @@ | |||
611 | 760 | if (!block | 782 | if (!block |
612 | 761 | || (ut_dulint_cmp(block->oldest_modification, | 783 | || (ut_dulint_cmp(block->oldest_modification, |
613 | 762 | lsn_limit) >= 0)) { | 784 | lsn_limit) >= 0)) { |
615 | 763 | @@ -895,7 +916,9 @@ | 785 | @@ -912,7 +933,9 @@ |
616 | 764 | offset = block->offset; | 786 | offset = block->offset; |
617 | 765 | 787 | ||
618 | 766 | mutex_exit(&block->mutex); | 788 | mutex_exit(&block->mutex); |
619 | @@ -771,7 +793,7 @@ | |||
620 | 771 | 793 | ||
621 | 772 | old_page_count = page_count; | 794 | old_page_count = page_count; |
622 | 773 | 795 | ||
624 | 774 | @@ -915,7 +938,9 @@ | 796 | @@ -932,7 +955,9 @@ |
625 | 775 | flush_type, offset, | 797 | flush_type, offset, |
626 | 776 | page_count - old_page_count); */ | 798 | page_count - old_page_count); */ |
627 | 777 | 799 | ||
628 | @@ -782,7 +804,7 @@ | |||
629 | 782 | 804 | ||
630 | 783 | } else if (flush_type == BUF_FLUSH_LRU) { | 805 | } else if (flush_type == BUF_FLUSH_LRU) { |
631 | 784 | 806 | ||
633 | 785 | @@ -927,16 +952,25 @@ | 807 | @@ -944,17 +969,26 @@ |
634 | 786 | 808 | ||
635 | 787 | mutex_exit(&block->mutex); | 809 | mutex_exit(&block->mutex); |
636 | 788 | 810 | ||
637 | @@ -800,16 +822,17 @@ | |||
638 | 800 | break; | 822 | break; |
639 | 801 | } | 823 | } |
640 | 802 | } | 824 | } |
642 | 803 | + | 825 | |
643 | 804 | + if (flush_type == BUF_FLUSH_LRU) { | 826 | + if (flush_type == BUF_FLUSH_LRU) { |
644 | 805 | + mutex_exit(&(buf_pool->LRU_mutex)); | 827 | + mutex_exit(&(buf_pool->LRU_mutex)); |
645 | 806 | + } | 828 | + } |
646 | 807 | + | 829 | + |
647 | 808 | + mutex_enter(&(buf_pool->mutex)); | 830 | + mutex_enter(&(buf_pool->mutex)); |
649 | 809 | 831 | + | |
650 | 810 | (buf_pool->init_flush)[flush_type] = FALSE; | 832 | (buf_pool->init_flush)[flush_type] = FALSE; |
651 | 811 | 833 | ||
653 | 812 | @@ -997,7 +1031,7 @@ | 834 | if ((buf_pool->n_flush[flush_type] == 0) |
654 | 835 | @@ -1014,7 +1048,7 @@ | ||
655 | 813 | ulint n_replaceable; | 836 | ulint n_replaceable; |
656 | 814 | ulint distance = 0; | 837 | ulint distance = 0; |
657 | 815 | 838 | ||
658 | @@ -818,20 +841,20 @@ | |||
659 | 818 | 841 | ||
660 | 819 | n_replaceable = UT_LIST_GET_LEN(buf_pool->free); | 842 | n_replaceable = UT_LIST_GET_LEN(buf_pool->free); |
661 | 820 | 843 | ||
664 | 821 | @@ -1007,6 +1041,12 @@ | 844 | @@ -1025,6 +1059,12 @@ |
663 | 822 | && (n_replaceable < BUF_FLUSH_FREE_BLOCK_MARGIN | ||
665 | 823 | + BUF_FLUSH_EXTRA_MARGIN) | 845 | + BUF_FLUSH_EXTRA_MARGIN) |
666 | 824 | && (distance < BUF_LRU_FREE_SEARCH_LEN)) { | 846 | && (distance < BUF_LRU_FREE_SEARCH_LEN)) { |
668 | 825 | + | 847 | |
669 | 826 | + if (!block->in_LRU_list) { | 848 | + if (!block->in_LRU_list) { |
670 | 827 | + /* reatart. but it is very optimistic */ | 849 | + /* reatart. but it is very optimistic */ |
671 | 828 | + block = UT_LIST_GET_LAST(buf_pool->LRU); | 850 | + block = UT_LIST_GET_LAST(buf_pool->LRU); |
672 | 829 | + continue; | 851 | + continue; |
673 | 830 | + } | 852 | + } |
675 | 831 | 853 | + | |
676 | 832 | mutex_enter(&block->mutex); | 854 | mutex_enter(&block->mutex); |
677 | 833 | 855 | ||
679 | 834 | @@ -1021,7 +1061,7 @@ | 856 | if (buf_flush_ready_for_replace(block)) { |
680 | 857 | @@ -1038,7 +1078,7 @@ | ||
681 | 835 | block = UT_LIST_GET_PREV(LRU, block); | 858 | block = UT_LIST_GET_PREV(LRU, block); |
682 | 836 | } | 859 | } |
683 | 837 | 860 | ||
684 | @@ -840,7 +863,7 @@ | |||
685 | 840 | 863 | ||
686 | 841 | if (n_replaceable >= BUF_FLUSH_FREE_BLOCK_MARGIN) { | 864 | if (n_replaceable >= BUF_FLUSH_FREE_BLOCK_MARGIN) { |
687 | 842 | 865 | ||
689 | 843 | @@ -1040,8 +1080,9 @@ | 866 | @@ -1057,8 +1097,9 @@ |
690 | 844 | immediately, without waiting. */ | 867 | immediately, without waiting. */ |
691 | 845 | 868 | ||
692 | 846 | void | 869 | void |
693 | @@ -851,7 +874,7 @@ | |||
694 | 851 | { | 874 | { |
695 | 852 | ulint n_to_flush; | 875 | ulint n_to_flush; |
696 | 853 | ulint n_flushed; | 876 | ulint n_flushed; |
698 | 854 | @@ -1051,7 +1092,7 @@ | 877 | @@ -1068,7 +1109,7 @@ |
699 | 855 | if (n_to_flush > 0) { | 878 | if (n_to_flush > 0) { |
700 | 856 | n_flushed = buf_flush_batch(BUF_FLUSH_LRU, n_to_flush, | 879 | n_flushed = buf_flush_batch(BUF_FLUSH_LRU, n_to_flush, |
701 | 857 | ut_dulint_zero); | 880 | ut_dulint_zero); |
702 | @@ -860,7 +883,7 @@ | |||
703 | 860 | /* There was an LRU type flush batch already running; | 883 | /* There was an LRU type flush batch already running; |
704 | 861 | let us wait for it to end */ | 884 | let us wait for it to end */ |
705 | 862 | 885 | ||
707 | 863 | @@ -1101,11 +1142,11 @@ | 886 | @@ -1118,11 +1159,11 @@ |
708 | 864 | { | 887 | { |
709 | 865 | ibool ret; | 888 | ibool ret; |
710 | 866 | 889 | ||
711 | @@ -874,9 +897,9 @@ | |||
712 | 874 | 897 | ||
713 | 875 | return(ret); | 898 | return(ret); |
714 | 876 | } | 899 | } |
718 | 877 | diff -r 7ac364cc9b41 innobase/buf/buf0lru.c | 900 | diff -ruN a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c |
719 | 878 | --- a/innobase/buf/buf0lru.c Fri Jul 03 15:41:50 2009 -0700 | 901 | --- a/innobase/buf/buf0lru.c 2009-07-07 21:53:57.000000000 +0900 |
720 | 879 | +++ b/innobase/buf/buf0lru.c Fri Jul 03 15:41:57 2009 -0700 | 902 | +++ b/innobase/buf/buf0lru.c 2009-08-28 11:06:30.000000000 +0900 |
721 | 880 | @@ -108,7 +108,7 @@ | 903 | @@ -108,7 +108,7 @@ |
722 | 881 | 904 | ||
723 | 882 | page_arr = ut_malloc(sizeof(ulint) | 905 | page_arr = ut_malloc(sizeof(ulint) |
724 | @@ -1242,10 +1265,10 @@ | |||
725 | 1242 | - mutex_exit(&(buf_pool->mutex)); | 1265 | - mutex_exit(&(buf_pool->mutex)); |
726 | 1243 | + mutex_exit(&(buf_pool->LRU_mutex)); | 1266 | + mutex_exit(&(buf_pool->LRU_mutex)); |
727 | 1244 | } | 1267 | } |
732 | 1245 | diff -r 7ac364cc9b41 innobase/buf/buf0rea.c | 1268 | diff -ruN a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c |
733 | 1246 | --- a/innobase/buf/buf0rea.c Fri Jul 03 15:41:50 2009 -0700 | 1269 | --- a/innobase/buf/buf0rea.c 2009-08-28 11:08:17.000000000 +0900 |
734 | 1247 | +++ b/innobase/buf/buf0rea.c Fri Jul 03 15:41:57 2009 -0700 | 1270 | +++ b/innobase/buf/buf0rea.c 2009-08-28 11:06:30.000000000 +0900 |
735 | 1248 | @@ -237,10 +237,12 @@ | 1271 | @@ -277,10 +277,12 @@ |
736 | 1249 | 1272 | ||
737 | 1250 | return(0); | 1273 | return(0); |
738 | 1251 | } | 1274 | } |
739 | @@ -1258,7 +1281,7 @@ | |||
740 | 1258 | for (i = low; i < high; i++) { | 1281 | for (i = low; i < high; i++) { |
741 | 1259 | block = buf_page_hash_get(space, i); | 1282 | block = buf_page_hash_get(space, i); |
742 | 1260 | 1283 | ||
744 | 1261 | @@ -252,7 +254,7 @@ | 1284 | @@ -292,7 +294,7 @@ |
745 | 1262 | } | 1285 | } |
746 | 1263 | } | 1286 | } |
747 | 1264 | 1287 | ||
748 | @@ -1267,7 +1290,7 @@ | |||
749 | 1267 | 1290 | ||
750 | 1268 | if (recent_blocks < BUF_READ_AHEAD_RANDOM_THRESHOLD) { | 1291 | if (recent_blocks < BUF_READ_AHEAD_RANDOM_THRESHOLD) { |
751 | 1269 | /* Do nothing */ | 1292 | /* Do nothing */ |
753 | 1270 | @@ -348,7 +350,7 @@ | 1293 | @@ -388,7 +390,7 @@ |
754 | 1271 | } | 1294 | } |
755 | 1272 | 1295 | ||
756 | 1273 | /* Flush pages from the end of the LRU list if necessary */ | 1296 | /* Flush pages from the end of the LRU list if necessary */ |
757 | @@ -1276,7 +1299,7 @@ | |||
758 | 1276 | 1299 | ||
759 | 1277 | return(count + count2); | 1300 | return(count + count2); |
760 | 1278 | } | 1301 | } |
762 | 1279 | @@ -451,6 +453,7 @@ | 1302 | @@ -491,6 +493,7 @@ |
763 | 1280 | 1303 | ||
764 | 1281 | return(0); | 1304 | return(0); |
765 | 1282 | } | 1305 | } |
766 | @@ -1284,7 +1307,7 @@ | |||
767 | 1284 | 1307 | ||
768 | 1285 | /* Check that almost all pages in the area have been accessed; if | 1308 | /* Check that almost all pages in the area have been accessed; if |
769 | 1286 | offset == low, the accesses must be in a descending order, otherwise, | 1309 | offset == low, the accesses must be in a descending order, otherwise, |
771 | 1287 | @@ -464,6 +467,7 @@ | 1310 | @@ -504,6 +507,7 @@ |
772 | 1288 | 1311 | ||
773 | 1289 | fail_count = 0; | 1312 | fail_count = 0; |
774 | 1290 | 1313 | ||
775 | @@ -1292,7 +1315,7 @@ | |||
776 | 1292 | for (i = low; i < high; i++) { | 1315 | for (i = low; i < high; i++) { |
777 | 1293 | block = buf_page_hash_get(space, i); | 1316 | block = buf_page_hash_get(space, i); |
778 | 1294 | 1317 | ||
780 | 1295 | @@ -480,12 +484,11 @@ | 1318 | @@ -520,23 +524,23 @@ |
781 | 1296 | pred_block = block; | 1319 | pred_block = block; |
782 | 1297 | } | 1320 | } |
783 | 1298 | } | 1321 | } |
784 | @@ -1301,12 +1324,12 @@ | |||
785 | 1301 | if (fail_count > BUF_READ_AHEAD_LINEAR_AREA - | 1324 | if (fail_count > BUF_READ_AHEAD_LINEAR_AREA - |
786 | 1302 | BUF_READ_AHEAD_LINEAR_THRESHOLD) { | 1325 | BUF_READ_AHEAD_LINEAR_THRESHOLD) { |
787 | 1303 | /* Too many failures: return */ | 1326 | /* Too many failures: return */ |
788 | 1327 | |||
789 | 1328 | - mutex_exit(&(buf_pool->mutex)); | ||
790 | 1304 | - | 1329 | - |
791 | 1305 | - mutex_exit(&(buf_pool->mutex)); | ||
792 | 1306 | |||
793 | 1307 | return(0); | 1330 | return(0); |
794 | 1308 | } | 1331 | } |
796 | 1309 | @@ -493,10 +496,11 @@ | 1332 | |
797 | 1310 | /* If we got this far, we know that enough pages in the area have | 1333 | /* If we got this far, we know that enough pages in the area have |
798 | 1311 | been accessed in the right order: linear read-ahead can be sensible */ | 1334 | been accessed in the right order: linear read-ahead can be sensible */ |
799 | 1312 | 1335 | ||
800 | @@ -1319,7 +1342,7 @@ | |||
801 | 1319 | 1342 | ||
802 | 1320 | return(0); | 1343 | return(0); |
803 | 1321 | } | 1344 | } |
805 | 1322 | @@ -512,7 +516,7 @@ | 1345 | @@ -552,7 +556,7 @@ |
806 | 1323 | pred_offset = fil_page_get_prev(frame); | 1346 | pred_offset = fil_page_get_prev(frame); |
807 | 1324 | succ_offset = fil_page_get_next(frame); | 1347 | succ_offset = fil_page_get_next(frame); |
808 | 1325 | 1348 | ||
809 | @@ -1328,7 +1351,7 @@ | |||
810 | 1328 | 1351 | ||
811 | 1329 | if ((offset == low) && (succ_offset == offset + 1)) { | 1352 | if ((offset == low) && (succ_offset == offset + 1)) { |
812 | 1330 | 1353 | ||
814 | 1331 | @@ -588,7 +592,7 @@ | 1354 | @@ -628,7 +632,7 @@ |
815 | 1332 | os_aio_simulated_wake_handler_threads(); | 1355 | os_aio_simulated_wake_handler_threads(); |
816 | 1333 | 1356 | ||
817 | 1334 | /* Flush pages from the end of the LRU list if necessary */ | 1357 | /* Flush pages from the end of the LRU list if necessary */ |
818 | @@ -1337,27 +1360,27 @@ | |||
819 | 1337 | 1360 | ||
820 | 1338 | #ifdef UNIV_DEBUG | 1361 | #ifdef UNIV_DEBUG |
821 | 1339 | if (buf_debug_prints && (count > 0)) { | 1362 | if (buf_debug_prints && (count > 0)) { |
843 | 1340 | @@ -656,7 +660,7 @@ | 1363 | @@ -696,7 +700,7 @@ |
844 | 1341 | os_aio_simulated_wake_handler_threads(); | 1364 | os_aio_simulated_wake_handler_threads(); |
845 | 1342 | 1365 | ||
846 | 1343 | /* Flush pages from the end of the LRU list if necessary */ | 1366 | /* Flush pages from the end of the LRU list if necessary */ |
847 | 1344 | - buf_flush_free_margin(); | 1367 | - buf_flush_free_margin(); |
848 | 1345 | + buf_flush_free_margin(FALSE); | 1368 | + buf_flush_free_margin(FALSE); |
849 | 1346 | 1369 | ||
850 | 1347 | #ifdef UNIV_DEBUG | 1370 | #ifdef UNIV_DEBUG |
851 | 1348 | if (buf_debug_prints) { | 1371 | if (buf_debug_prints) { |
852 | 1349 | @@ -728,7 +732,7 @@ | 1372 | @@ -768,7 +772,7 @@ |
853 | 1350 | os_aio_simulated_wake_handler_threads(); | 1373 | os_aio_simulated_wake_handler_threads(); |
854 | 1351 | 1374 | ||
855 | 1352 | /* Flush pages from the end of the LRU list if necessary */ | 1375 | /* Flush pages from the end of the LRU list if necessary */ |
856 | 1353 | - buf_flush_free_margin(); | 1376 | - buf_flush_free_margin(); |
857 | 1354 | + buf_flush_free_margin(FALSE); | 1377 | + buf_flush_free_margin(FALSE); |
858 | 1355 | 1378 | ||
859 | 1356 | #ifdef UNIV_DEBUG | 1379 | #ifdef UNIV_DEBUG |
860 | 1357 | if (buf_debug_prints) { | 1380 | if (buf_debug_prints) { |
861 | 1358 | diff -r 7ac364cc9b41 innobase/include/buf0buf.h | 1381 | diff -ruN a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h |
862 | 1359 | --- a/innobase/include/buf0buf.h Fri Jul 03 15:41:50 2009 -0700 | 1382 | --- a/innobase/include/buf0buf.h 2009-08-28 11:08:16.000000000 +0900 |
863 | 1360 | +++ b/innobase/include/buf0buf.h Fri Jul 03 15:41:57 2009 -0700 | 1383 | +++ b/innobase/include/buf0buf.h 2009-08-28 11:06:30.000000000 +0900 |
864 | 1361 | @@ -946,6 +946,7 @@ | 1384 | @@ -946,6 +946,7 @@ |
865 | 1362 | mem_heap_t* io_counter_heap; | 1385 | mem_heap_t* io_counter_heap; |
866 | 1363 | ulint io_counters; | 1386 | ulint io_counters; |
867 | @@ -1385,9 +1408,9 @@ | |||
868 | 1385 | buf_block_t* LRU_old; /* pointer to the about 3/8 oldest | 1408 | buf_block_t* LRU_old; /* pointer to the about 3/8 oldest |
869 | 1386 | blocks in the LRU list; NULL if LRU | 1409 | blocks in the LRU list; NULL if LRU |
870 | 1387 | length less than BUF_LRU_OLD_MIN_LEN */ | 1410 | length less than BUF_LRU_OLD_MIN_LEN */ |
874 | 1388 | diff -r 7ac364cc9b41 innobase/include/buf0buf.ic | 1411 | diff -ruN a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic |
875 | 1389 | --- a/innobase/include/buf0buf.ic Fri Jul 03 15:41:50 2009 -0700 | 1412 | --- a/innobase/include/buf0buf.ic 2009-07-07 21:54:00.000000000 +0900 |
876 | 1390 | +++ b/innobase/include/buf0buf.ic Fri Jul 03 15:41:57 2009 -0700 | 1413 | +++ b/innobase/include/buf0buf.ic 2009-08-28 11:06:30.000000000 +0900 |
877 | 1391 | @@ -112,7 +112,8 @@ | 1414 | @@ -112,7 +112,8 @@ |
878 | 1392 | buf_block_t* block; | 1415 | buf_block_t* block; |
879 | 1393 | dulint lsn; | 1416 | dulint lsn; |
880 | @@ -1505,9 +1528,9 @@ | |||
881 | 1505 | 1528 | ||
882 | 1506 | mutex_enter(&block->mutex); | 1529 | mutex_enter(&block->mutex); |
883 | 1507 | 1530 | ||
887 | 1508 | diff -r 7ac364cc9b41 innobase/include/buf0flu.h | 1531 | diff -ruN a/innobase/include/buf0flu.h b/innobase/include/buf0flu.h |
888 | 1509 | --- a/innobase/include/buf0flu.h Fri Jul 03 15:41:50 2009 -0700 | 1532 | --- a/innobase/include/buf0flu.h 2009-07-07 21:54:00.000000000 +0900 |
889 | 1510 | +++ b/innobase/include/buf0flu.h Fri Jul 03 15:41:57 2009 -0700 | 1533 | +++ b/innobase/include/buf0flu.h 2009-08-28 11:06:30.000000000 +0900 |
890 | 1511 | @@ -26,8 +26,9 @@ | 1534 | @@ -26,8 +26,9 @@ |
891 | 1512 | a margin of replaceable pages there. */ | 1535 | a margin of replaceable pages there. */ |
892 | 1513 | 1536 | ||
893 | @@ -1519,9 +1542,9 @@ | |||
894 | 1519 | /************************************************************************ | 1542 | /************************************************************************ |
895 | 1520 | Initializes a page for writing to the tablespace. */ | 1543 | Initializes a page for writing to the tablespace. */ |
896 | 1521 | 1544 | ||
900 | 1522 | diff -r 7ac364cc9b41 innobase/include/buf0flu.ic | 1545 | diff -ruN a/innobase/include/buf0flu.ic b/innobase/include/buf0flu.ic |
901 | 1523 | --- a/innobase/include/buf0flu.ic Fri Jul 03 15:41:50 2009 -0700 | 1546 | --- a/innobase/include/buf0flu.ic 2009-07-07 21:54:00.000000000 +0900 |
902 | 1524 | +++ b/innobase/include/buf0flu.ic Fri Jul 03 15:41:57 2009 -0700 | 1547 | +++ b/innobase/include/buf0flu.ic 2009-08-28 11:06:30.000000000 +0900 |
903 | 1525 | @@ -38,11 +38,14 @@ | 1548 | @@ -38,11 +38,14 @@ |
904 | 1526 | mtr_t* mtr) /* in: mtr */ | 1549 | mtr_t* mtr) /* in: mtr */ |
905 | 1527 | { | 1550 | { |
906 | @@ -1538,7 +1561,7 @@ | |||
907 | 1538 | #endif /* UNIV_SYNC_DEBUG */ | 1561 | #endif /* UNIV_SYNC_DEBUG */ |
908 | 1539 | 1562 | ||
909 | 1540 | ut_ad(ut_dulint_cmp(mtr->start_lsn, ut_dulint_zero) != 0); | 1563 | ut_ad(ut_dulint_cmp(mtr->start_lsn, ut_dulint_zero) != 0); |
911 | 1541 | @@ -52,15 +55,19 @@ | 1564 | @@ -52,16 +55,20 @@ |
912 | 1542 | block->newest_modification = mtr->end_lsn; | 1565 | block->newest_modification = mtr->end_lsn; |
913 | 1543 | 1566 | ||
914 | 1544 | if (ut_dulint_is_zero(block->oldest_modification)) { | 1567 | if (ut_dulint_is_zero(block->oldest_modification)) { |
915 | @@ -1553,11 +1576,12 @@ | |||
916 | 1553 | ut_ad(ut_dulint_cmp(block->oldest_modification, | 1576 | ut_ad(ut_dulint_cmp(block->oldest_modification, |
917 | 1554 | mtr->start_lsn) <= 0); | 1577 | mtr->start_lsn) <= 0); |
918 | 1555 | } | 1578 | } |
919 | 1579 | |||
920 | 1580 | + mutex_exit(&block->mutex); | ||
921 | 1556 | + | 1581 | + |
922 | 1557 | + mutex_exit(&block->mutex); | ||
923 | 1558 | |||
924 | 1559 | ++srv_buf_pool_write_requests; | 1582 | ++srv_buf_pool_write_requests; |
925 | 1560 | } | 1583 | } |
926 | 1584 | |||
927 | 1561 | @@ -78,29 +85,32 @@ | 1585 | @@ -78,29 +85,32 @@ |
928 | 1562 | set of mtr's */ | 1586 | set of mtr's */ |
929 | 1563 | { | 1587 | { |
930 | @@ -1594,9 +1618,9 @@ | |||
931 | 1594 | - mutex_exit(&(buf_pool->mutex)); | 1618 | - mutex_exit(&(buf_pool->mutex)); |
932 | 1595 | + mutex_exit(&(block->mutex)); | 1619 | + mutex_exit(&(block->mutex)); |
933 | 1596 | } | 1620 | } |
937 | 1597 | diff -r 7ac364cc9b41 innobase/include/sync0sync.h | 1621 | diff -ruN a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h |
938 | 1598 | --- a/innobase/include/sync0sync.h Fri Jul 03 15:41:50 2009 -0700 | 1622 | --- a/innobase/include/sync0sync.h 2009-07-07 21:54:06.000000000 +0900 |
939 | 1599 | +++ b/innobase/include/sync0sync.h Fri Jul 03 15:41:57 2009 -0700 | 1623 | +++ b/innobase/include/sync0sync.h 2009-08-28 11:06:30.000000000 +0900 |
940 | 1600 | @@ -438,8 +438,12 @@ | 1624 | @@ -438,8 +438,12 @@ |
941 | 1601 | SYNC_SEARCH_SYS, as memory allocation | 1625 | SYNC_SEARCH_SYS, as memory allocation |
942 | 1602 | can call routines there! Otherwise | 1626 | can call routines there! Otherwise |
943 | @@ -1611,10 +1635,10 @@ | |||
944 | 1611 | #define SYNC_DOUBLEWRITE 140 | 1635 | #define SYNC_DOUBLEWRITE 140 |
945 | 1612 | #define SYNC_ANY_LATCH 135 | 1636 | #define SYNC_ANY_LATCH 135 |
946 | 1613 | #define SYNC_THR_LOCAL 133 | 1637 | #define SYNC_THR_LOCAL 133 |
951 | 1614 | diff -r 7ac364cc9b41 innobase/log/log0recv.c | 1638 | diff -ruN a/innobase/log/log0recv.c b/innobase/log/log0recv.c |
952 | 1615 | --- a/innobase/log/log0recv.c Fri Jul 03 15:41:50 2009 -0700 | 1639 | --- a/innobase/log/log0recv.c 2009-08-28 11:08:17.000000000 +0900 |
953 | 1616 | +++ b/innobase/log/log0recv.c Fri Jul 03 15:41:57 2009 -0700 | 1640 | +++ b/innobase/log/log0recv.c 2009-08-28 11:06:30.000000000 +0900 |
954 | 1617 | @@ -1693,11 +1693,11 @@ | 1641 | @@ -1695,11 +1695,11 @@ |
955 | 1618 | 1642 | ||
956 | 1619 | mtr_start(&mtr); | 1643 | mtr_start(&mtr); |
957 | 1620 | 1644 | ||
958 | @@ -1628,9 +1652,9 @@ | |||
959 | 1628 | 1652 | ||
960 | 1629 | replica = buf_page_get(space + RECV_REPLICA_SPACE_ADD, page_no, | 1653 | replica = buf_page_get(space + RECV_REPLICA_SPACE_ADD, page_no, |
961 | 1630 | RW_X_LATCH, &mtr); | 1654 | RW_X_LATCH, &mtr); |
965 | 1631 | diff -r 7ac364cc9b41 innobase/mtr/mtr0mtr.c | 1655 | diff -ruN a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c |
966 | 1632 | --- a/innobase/mtr/mtr0mtr.c Fri Jul 03 15:41:50 2009 -0700 | 1656 | --- a/innobase/mtr/mtr0mtr.c 2009-07-07 21:54:08.000000000 +0900 |
967 | 1633 | +++ b/innobase/mtr/mtr0mtr.c Fri Jul 03 15:41:57 2009 -0700 | 1657 | +++ b/innobase/mtr/mtr0mtr.c 2009-08-28 11:06:30.000000000 +0900 |
968 | 1634 | @@ -103,6 +103,38 @@ | 1658 | @@ -103,6 +103,38 @@ |
969 | 1635 | } | 1659 | } |
970 | 1636 | } | 1660 | } |
971 | @@ -1679,7 +1703,7 @@ | |||
972 | 1679 | } | 1703 | } |
973 | 1680 | 1704 | ||
974 | 1681 | /* We first update the modification info to buffer pages, and only | 1705 | /* We first update the modification info to buffer pages, and only |
976 | 1682 | @@ -187,11 +221,12 @@ | 1706 | @@ -187,12 +221,13 @@ |
977 | 1683 | required when we insert modified buffer pages in to the flush list | 1707 | required when we insert modified buffer pages in to the flush list |
978 | 1684 | which must be sorted on oldest_modification. */ | 1708 | which must be sorted on oldest_modification. */ |
979 | 1685 | 1709 | ||
980 | @@ -1688,12 +1712,13 @@ | |||
981 | 1688 | if (mtr->modifications) { | 1712 | if (mtr->modifications) { |
982 | 1689 | log_release(); | 1713 | log_release(); |
983 | 1690 | } | 1714 | } |
985 | 1691 | + | 1715 | |
986 | 1692 | + /* All unlocking has been moved here, after log_sys mutex release. */ | 1716 | + /* All unlocking has been moved here, after log_sys mutex release. */ |
987 | 1693 | + mtr_memo_pop_all(mtr); | 1717 | + mtr_memo_pop_all(mtr); |
989 | 1694 | 1718 | + | |
990 | 1695 | #ifdef UNIV_DEBUG | 1719 | #ifdef UNIV_DEBUG |
991 | 1696 | mtr->state = MTR_COMMITTED; | 1720 | mtr->state = MTR_COMMITTED; |
992 | 1721 | #endif | ||
993 | 1697 | @@ -262,6 +297,12 @@ | 1722 | @@ -262,6 +297,12 @@ |
994 | 1698 | slot = dyn_array_get_element(memo, offset); | 1723 | slot = dyn_array_get_element(memo, offset); |
995 | 1699 | 1724 | ||
996 | @@ -1707,10 +1732,10 @@ | |||
997 | 1707 | 1732 | ||
998 | 1708 | mtr_memo_slot_release(mtr, slot); | 1733 | mtr_memo_slot_release(mtr, slot); |
999 | 1709 | 1734 | ||
1004 | 1710 | diff -r 7ac364cc9b41 innobase/srv/srv0srv.c | 1735 | diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c |
1005 | 1711 | --- a/innobase/srv/srv0srv.c Fri Jul 03 15:41:50 2009 -0700 | 1736 | --- a/innobase/srv/srv0srv.c 2009-08-28 11:08:17.000000000 +0900 |
1006 | 1712 | +++ b/innobase/srv/srv0srv.c Fri Jul 03 15:41:57 2009 -0700 | 1737 | +++ b/innobase/srv/srv0srv.c 2009-08-28 11:06:30.000000000 +0900 |
1007 | 1713 | @@ -367,6 +367,7 @@ | 1738 | @@ -370,6 +370,7 @@ |
1008 | 1714 | ulong srv_n_free_tickets_to_enter = 500; | 1739 | ulong srv_n_free_tickets_to_enter = 500; |
1009 | 1715 | ulong srv_thread_sleep_delay = 10000; | 1740 | ulong srv_thread_sleep_delay = 10000; |
1010 | 1716 | ulint srv_spin_wait_delay = 5; | 1741 | ulint srv_spin_wait_delay = 5; |
1011 | @@ -1718,7 +1743,7 @@ | |||
1012 | 1718 | ibool srv_priority_boost = TRUE; | 1743 | ibool srv_priority_boost = TRUE; |
1013 | 1719 | 1744 | ||
1014 | 1720 | ibool srv_print_thread_releases = FALSE; | 1745 | ibool srv_print_thread_releases = FALSE; |
1016 | 1721 | @@ -673,6 +674,47 @@ | 1746 | @@ -676,6 +677,47 @@ |
1017 | 1722 | ulint srv_n_threads_active[SRV_MASTER + 1]; | 1747 | ulint srv_n_threads_active[SRV_MASTER + 1]; |
1018 | 1723 | ulint srv_n_threads[SRV_MASTER + 1]; | 1748 | ulint srv_n_threads[SRV_MASTER + 1]; |
1019 | 1724 | 1749 | ||
1020 | @@ -1766,16 +1791,16 @@ | |||
1021 | 1766 | /************************************************************************* | 1791 | /************************************************************************* |
1022 | 1767 | Sets the info describing an i/o thread current state. */ | 1792 | Sets the info describing an i/o thread current state. */ |
1023 | 1768 | 1793 | ||
1026 | 1769 | @@ -905,6 +947,8 @@ | 1794 | @@ -909,6 +951,8 @@ |
1025 | 1770 | srv_slot_t* slot; | ||
1027 | 1771 | dict_table_t* table; | 1795 | dict_table_t* table; |
1028 | 1772 | ulint i; | 1796 | ulint i; |
1030 | 1773 | + | 1797 | |
1031 | 1774 | + srv_align_spins_microsec(); | 1798 | + srv_align_spins_microsec(); |
1033 | 1775 | 1799 | + | |
1034 | 1776 | srv_sys = mem_alloc(sizeof(srv_sys_t)); | 1800 | srv_sys = mem_alloc(sizeof(srv_sys_t)); |
1035 | 1777 | 1801 | ||
1037 | 1778 | @@ -2661,7 +2705,7 @@ | 1802 | kernel_mutex_temp = mem_alloc(sizeof(mutex_t)); |
1038 | 1803 | @@ -2665,7 +2709,7 @@ | ||
1039 | 1779 | ib_longlong level, bpl; | 1804 | ib_longlong level, bpl; |
1040 | 1780 | buf_block_t* bpage; | 1805 | buf_block_t* bpage; |
1041 | 1781 | 1806 | ||
1042 | @@ -1784,7 +1809,7 @@ | |||
1043 | 1784 | 1809 | ||
1044 | 1785 | level = 0; | 1810 | level = 0; |
1045 | 1786 | bpage = UT_LIST_GET_FIRST(buf_pool->flush_list); | 1811 | bpage = UT_LIST_GET_FIRST(buf_pool->flush_list); |
1047 | 1787 | @@ -2683,7 +2727,7 @@ | 1812 | @@ -2687,7 +2731,7 @@ |
1048 | 1788 | bpl = 0; | 1813 | bpl = 0; |
1049 | 1789 | } | 1814 | } |
1050 | 1790 | 1815 | ||
1051 | @@ -1793,9 +1818,9 @@ | |||
1052 | 1793 | 1818 | ||
1053 | 1794 | if (!srv_use_doublewrite_buf) { | 1819 | if (!srv_use_doublewrite_buf) { |
1054 | 1795 | /* flush is faster than when doublewrite */ | 1820 | /* flush is faster than when doublewrite */ |
1058 | 1796 | diff -r 7ac364cc9b41 innobase/sync/sync0sync.c | 1821 | diff -ruN a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c |
1059 | 1797 | --- a/innobase/sync/sync0sync.c Fri Jul 03 15:41:50 2009 -0700 | 1822 | --- a/innobase/sync/sync0sync.c 2009-07-07 21:54:10.000000000 +0900 |
1060 | 1798 | +++ b/innobase/sync/sync0sync.c Fri Jul 03 15:41:57 2009 -0700 | 1823 | +++ b/innobase/sync/sync0sync.c 2009-08-28 11:06:30.000000000 +0900 |
1061 | 1799 | @@ -1105,11 +1105,19 @@ | 1824 | @@ -1105,11 +1105,19 @@ |
1062 | 1800 | } else if (level == SYNC_DOUBLEWRITE) { | 1825 | } else if (level == SYNC_DOUBLEWRITE) { |
1063 | 1801 | ut_a(sync_thread_levels_g(array, SYNC_DOUBLEWRITE)); | 1826 | ut_a(sync_thread_levels_g(array, SYNC_DOUBLEWRITE)); |
1064 | @@ -1817,9 +1842,9 @@ | |||
1065 | 1817 | } else if (level == SYNC_SEARCH_SYS) { | 1842 | } else if (level == SYNC_SEARCH_SYS) { |
1066 | 1818 | ut_a(sync_thread_levels_g(array, SYNC_SEARCH_SYS)); | 1843 | ut_a(sync_thread_levels_g(array, SYNC_SEARCH_SYS)); |
1067 | 1819 | } else if (level == SYNC_TRX_LOCK_HEAP) { | 1844 | } else if (level == SYNC_TRX_LOCK_HEAP) { |
1071 | 1820 | diff -r 7ac364cc9b41 innobase/ut/ut0ut.c | 1845 | diff -ruN a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c |
1072 | 1821 | --- a/innobase/ut/ut0ut.c Fri Jul 03 15:41:50 2009 -0700 | 1846 | --- a/innobase/ut/ut0ut.c 2009-07-07 21:54:12.000000000 +0900 |
1073 | 1822 | +++ b/innobase/ut/ut0ut.c Fri Jul 03 15:41:57 2009 -0700 | 1847 | +++ b/innobase/ut/ut0ut.c 2009-08-28 11:06:30.000000000 +0900 |
1074 | 1823 | @@ -347,6 +347,7 @@ | 1848 | @@ -347,6 +347,7 @@ |
1075 | 1824 | /***************************************************************** | 1849 | /***************************************************************** |
1076 | 1825 | Runs an idle loop on CPU. The argument gives the desired delay | 1850 | Runs an idle loop on CPU. The argument gives the desired delay |
1077 | @@ -1841,9 +1866,9 @@ | |||
1078 | 1841 | j += i; | 1866 | j += i; |
1079 | 1842 | } | 1867 | } |
1080 | 1843 | 1868 | ||
1084 | 1844 | diff -r 7ac364cc9b41 patch_info/innodb_split_buf_pool_mutex.info | 1869 | diff -ruN a/patch_info/innodb_split_buf_pool_mutex.info b/patch_info/innodb_split_buf_pool_mutex.info |
1085 | 1845 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | 1870 | --- /dev/null 1970-01-01 09:00:00.000000000 +0900 |
1086 | 1846 | +++ b/patch_info/innodb_split_buf_pool_mutex.info Fri Jul 03 15:41:57 2009 -0700 | 1871 | +++ b/patch_info/innodb_split_buf_pool_mutex.info 2009-08-28 11:06:30.000000000 +0900 |
1087 | 1847 | @@ -0,0 +1,6 @@ | 1872 | @@ -0,0 +1,6 @@ |
1088 | 1848 | +File=innodb_split_buf_pool_mutex.patch | 1873 | +File=innodb_split_buf_pool_mutex.patch |
1089 | 1849 | +Name=InnoDB patch to fix buffer pool scalability | 1874 | +Name=InnoDB patch to fix buffer pool scalability |
1090 | @@ -1851,10 +1876,10 @@ | |||
1091 | 1851 | +Author=Yasufumi Kinoshita | 1876 | +Author=Yasufumi Kinoshita |
1092 | 1852 | +License=BSD | 1877 | +License=BSD |
1093 | 1853 | +Comment=Backport from XtraDB | 1878 | +Comment=Backport from XtraDB |
1098 | 1854 | diff -r 7ac364cc9b41 sql/ha_innodb.cc | 1879 | diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc |
1099 | 1855 | --- a/sql/ha_innodb.cc Fri Jul 03 15:41:50 2009 -0700 | 1880 | --- a/sql/ha_innodb.cc 2009-08-28 11:08:17.000000000 +0900 |
1100 | 1856 | +++ b/sql/ha_innodb.cc Fri Jul 03 15:41:57 2009 -0700 | 1881 | +++ b/sql/ha_innodb.cc 2009-08-28 11:06:30.000000000 +0900 |
1101 | 1857 | @@ -1503,6 +1503,13 @@ | 1882 | @@ -1507,6 +1507,13 @@ |
1102 | 1858 | /* We set srv_pool_size here in units of 1 kB. InnoDB internally | 1883 | /* We set srv_pool_size here in units of 1 kB. InnoDB internally |
1103 | 1859 | changes the value so that it becomes the number of database pages. */ | 1884 | changes the value so that it becomes the number of database pages. */ |
1104 | 1860 | 1885 |