Merge lp:~percona-dev/percona-server/5.5.13-fix_bug802348 into lp:percona-server/5.5
- 5.5.13-fix_bug802348
- Merge into 5.5
Proposed by
Yasufumi Kinoshita
Status: | Merged |
---|---|
Approved by: | Stewart Smith |
Approved revision: | no longer in the source branch. |
Merged at revision: | 134 |
Proposed branch: | lp:~percona-dev/percona-server/5.5.13-fix_bug802348 |
Merge into: | lp:percona-server/5.5 |
Diff against target: |
827 lines (+112/-88) 7 files modified
innodb_adaptive_hash_index_partitions.patch (+1/-1) innodb_buffer_pool_pages_i_s.patch (+1/-1) innodb_extend_slow.patch (+14/-14) innodb_fix_misc.patch (+1/-1) innodb_pass_corrupt_table.patch (+6/-6) innodb_separate_doublewrite.patch (+1/-1) innodb_split_buf_pool_mutex.patch (+88/-64) |
To merge this branch: | bzr merge lp:~percona-dev/percona-server/5.5.13-fix_bug802348 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stewart Smith | Pending | ||
Review via email: mp+65939@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'innodb_adaptive_hash_index_partitions.patch' | |||
2 | --- innodb_adaptive_hash_index_partitions.patch 2011-06-23 07:32:16 +0000 | |||
3 | +++ innodb_adaptive_hash_index_partitions.patch 2011-06-27 07:15:55 +0000 | |||
4 | @@ -1008,7 +1008,7 @@ | |||
5 | 1008 | #endif /* UNIV_SYNC_DEBUG */ | 1008 | #endif /* UNIV_SYNC_DEBUG */ |
6 | 1009 | ut_ad(!btr_search_enabled); | 1009 | ut_ad(!btr_search_enabled); |
7 | 1010 | 1010 | ||
9 | 1011 | @@ -2636,6 +2641,7 @@ | 1011 | @@ -2655,6 +2660,7 @@ |
10 | 1012 | { | 1012 | { |
11 | 1013 | block->check_index_page_at_flush = FALSE; | 1013 | block->check_index_page_at_flush = FALSE; |
12 | 1014 | block->index = NULL; | 1014 | block->index = NULL; |
13 | 1015 | 1015 | ||
14 | === modified file 'innodb_buffer_pool_pages_i_s.patch' | |||
15 | --- innodb_buffer_pool_pages_i_s.patch 2011-06-23 07:32:16 +0000 | |||
16 | +++ innodb_buffer_pool_pages_i_s.patch 2011-06-27 07:15:55 +0000 | |||
17 | @@ -8,7 +8,7 @@ | |||
18 | 8 | diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c | 8 | diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c |
19 | 9 | --- a/storage/innobase/buf/buf0buf.c 2010-12-04 20:20:44.595483291 +0900 | 9 | --- a/storage/innobase/buf/buf0buf.c 2010-12-04 20:20:44.595483291 +0900 |
20 | 10 | +++ b/storage/innobase/buf/buf0buf.c 2010-12-06 19:28:04.055227506 +0900 | 10 | +++ b/storage/innobase/buf/buf0buf.c 2010-12-06 19:28:04.055227506 +0900 |
22 | 11 | @@ -4541,6 +4541,36 @@ | 11 | @@ -4560,6 +4560,36 @@ |
23 | 12 | mutex_exit(block_mutex); | 12 | mutex_exit(block_mutex); |
24 | 13 | } | 13 | } |
25 | 14 | 14 | ||
26 | 15 | 15 | ||
27 | === modified file 'innodb_extend_slow.patch' | |||
28 | --- innodb_extend_slow.patch 2011-06-23 07:32:16 +0000 | |||
29 | +++ innodb_extend_slow.patch 2011-06-27 07:15:55 +0000 | |||
30 | @@ -75,7 +75,7 @@ | |||
31 | 75 | 75 | ||
32 | 76 | #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG | 76 | #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG |
33 | 77 | ut_a(++buf_dbg_counter % 37 || buf_validate()); | 77 | ut_a(++buf_dbg_counter % 37 || buf_validate()); |
35 | 78 | @@ -2499,6 +2541,13 @@ | 78 | @@ -2518,6 +2560,13 @@ |
36 | 79 | /* Let us wait until the read operation | 79 | /* Let us wait until the read operation |
37 | 80 | completes */ | 80 | completes */ |
38 | 81 | 81 | ||
39 | @@ -89,7 +89,7 @@ | |||
40 | 89 | for (;;) { | 89 | for (;;) { |
41 | 90 | enum buf_io_fix io_fix; | 90 | enum buf_io_fix io_fix; |
42 | 91 | 91 | ||
44 | 92 | @@ -2513,6 +2562,12 @@ | 92 | @@ -2532,6 +2581,12 @@ |
45 | 93 | break; | 93 | break; |
46 | 94 | } | 94 | } |
47 | 95 | } | 95 | } |
48 | @@ -102,7 +102,7 @@ | |||
49 | 102 | } | 102 | } |
50 | 103 | 103 | ||
51 | 104 | #ifdef UNIV_IBUF_COUNT_DEBUG | 104 | #ifdef UNIV_IBUF_COUNT_DEBUG |
53 | 105 | @@ -2828,6 +2883,11 @@ | 105 | @@ -2847,6 +2902,11 @@ |
54 | 106 | ibool must_read; | 106 | ibool must_read; |
55 | 107 | ulint retries = 0; | 107 | ulint retries = 0; |
56 | 108 | mutex_t* block_mutex = NULL; | 108 | mutex_t* block_mutex = NULL; |
57 | @@ -114,7 +114,7 @@ | |||
58 | 114 | buf_pool_t* buf_pool = buf_pool_get(space, offset); | 114 | buf_pool_t* buf_pool = buf_pool_get(space, offset); |
59 | 115 | 115 | ||
60 | 116 | ut_ad(mtr); | 116 | ut_ad(mtr); |
62 | 117 | @@ -2856,6 +2916,9 @@ | 117 | @@ -2875,6 +2935,9 @@ |
63 | 118 | || ibuf_page_low(space, zip_size, offset, | 118 | || ibuf_page_low(space, zip_size, offset, |
64 | 119 | FALSE, file, line, NULL)); | 119 | FALSE, file, line, NULL)); |
65 | 120 | #endif | 120 | #endif |
66 | @@ -124,7 +124,7 @@ | |||
67 | 124 | buf_pool->stat.n_page_gets++; | 124 | buf_pool->stat.n_page_gets++; |
68 | 125 | fold = buf_page_address_fold(space, offset); | 125 | fold = buf_page_address_fold(space, offset); |
69 | 126 | loop: | 126 | loop: |
71 | 127 | @@ -2930,7 +2993,7 @@ | 127 | @@ -2949,7 +3012,7 @@ |
72 | 128 | return(NULL); | 128 | return(NULL); |
73 | 129 | } | 129 | } |
74 | 130 | 130 | ||
75 | @@ -133,7 +133,7 @@ | |||
76 | 133 | retries = 0; | 133 | retries = 0; |
77 | 134 | } else if (retries < BUF_PAGE_READ_MAX_RETRIES) { | 134 | } else if (retries < BUF_PAGE_READ_MAX_RETRIES) { |
78 | 135 | ++retries; | 135 | ++retries; |
80 | 136 | @@ -3239,6 +3302,13 @@ | 136 | @@ -3258,6 +3321,13 @@ |
81 | 137 | /* Let us wait until the read operation | 137 | /* Let us wait until the read operation |
82 | 138 | completes */ | 138 | completes */ |
83 | 139 | 139 | ||
84 | @@ -147,7 +147,7 @@ | |||
85 | 147 | for (;;) { | 147 | for (;;) { |
86 | 148 | enum buf_io_fix io_fix; | 148 | enum buf_io_fix io_fix; |
87 | 149 | 149 | ||
89 | 150 | @@ -3253,6 +3323,12 @@ | 150 | @@ -3272,6 +3342,12 @@ |
90 | 151 | break; | 151 | break; |
91 | 152 | } | 152 | } |
92 | 153 | } | 153 | } |
93 | @@ -160,7 +160,7 @@ | |||
94 | 160 | } | 160 | } |
95 | 161 | 161 | ||
96 | 162 | fix_type = MTR_MEMO_BUF_FIX; | 162 | fix_type = MTR_MEMO_BUF_FIX; |
98 | 163 | @@ -3279,13 +3355,17 @@ | 163 | @@ -3298,13 +3374,17 @@ |
99 | 164 | read-ahead */ | 164 | read-ahead */ |
100 | 165 | 165 | ||
101 | 166 | buf_read_ahead_linear(space, zip_size, offset, | 166 | buf_read_ahead_linear(space, zip_size, offset, |
102 | @@ -179,7 +179,7 @@ | |||
103 | 179 | return(block); | 179 | return(block); |
104 | 180 | } | 180 | } |
105 | 181 | 181 | ||
107 | 182 | @@ -3309,6 +3389,7 @@ | 182 | @@ -3328,6 +3408,7 @@ |
108 | 183 | unsigned access_time; | 183 | unsigned access_time; |
109 | 184 | ibool success; | 184 | ibool success; |
110 | 185 | ulint fix_type; | 185 | ulint fix_type; |
111 | @@ -187,7 +187,7 @@ | |||
112 | 187 | 187 | ||
113 | 188 | ut_ad(block); | 188 | ut_ad(block); |
114 | 189 | ut_ad(mtr); | 189 | ut_ad(mtr); |
116 | 190 | @@ -3386,6 +3467,10 @@ | 190 | @@ -3405,6 +3486,10 @@ |
117 | 191 | #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG | 191 | #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG |
118 | 192 | ut_a(block->page.file_page_was_freed == FALSE); | 192 | ut_a(block->page.file_page_was_freed == FALSE); |
119 | 193 | #endif | 193 | #endif |
120 | @@ -198,7 +198,7 @@ | |||
121 | 198 | if (UNIV_UNLIKELY(!access_time)) { | 198 | if (UNIV_UNLIKELY(!access_time)) { |
122 | 199 | /* In the case of a first access, try to apply linear | 199 | /* In the case of a first access, try to apply linear |
123 | 200 | read-ahead */ | 200 | read-ahead */ |
125 | 201 | @@ -3393,7 +3478,7 @@ | 201 | @@ -3412,7 +3497,7 @@ |
126 | 202 | buf_read_ahead_linear(buf_block_get_space(block), | 202 | buf_read_ahead_linear(buf_block_get_space(block), |
127 | 203 | buf_block_get_zip_size(block), | 203 | buf_block_get_zip_size(block), |
128 | 204 | buf_block_get_page_no(block), | 204 | buf_block_get_page_no(block), |
129 | @@ -207,7 +207,7 @@ | |||
130 | 207 | } | 207 | } |
131 | 208 | 208 | ||
132 | 209 | #ifdef UNIV_IBUF_COUNT_DEBUG | 209 | #ifdef UNIV_IBUF_COUNT_DEBUG |
134 | 210 | @@ -3403,6 +3488,9 @@ | 210 | @@ -3422,6 +3507,9 @@ |
135 | 211 | buf_pool = buf_pool_from_block(block); | 211 | buf_pool = buf_pool_from_block(block); |
136 | 212 | buf_pool->stat.n_page_gets++; | 212 | buf_pool->stat.n_page_gets++; |
137 | 213 | 213 | ||
138 | @@ -217,7 +217,7 @@ | |||
139 | 217 | return(TRUE); | 217 | return(TRUE); |
140 | 218 | } | 218 | } |
141 | 219 | 219 | ||
143 | 220 | @@ -3425,6 +3513,7 @@ | 220 | @@ -3444,6 +3532,7 @@ |
144 | 221 | buf_pool_t* buf_pool; | 221 | buf_pool_t* buf_pool; |
145 | 222 | ibool success; | 222 | ibool success; |
146 | 223 | ulint fix_type; | 223 | ulint fix_type; |
147 | @@ -225,7 +225,7 @@ | |||
148 | 225 | 225 | ||
149 | 226 | ut_ad(mtr); | 226 | ut_ad(mtr); |
150 | 227 | ut_ad(mtr->state == MTR_ACTIVE); | 227 | ut_ad(mtr->state == MTR_ACTIVE); |
152 | 228 | @@ -3511,6 +3600,11 @@ | 228 | @@ -3530,6 +3619,11 @@ |
153 | 229 | #endif | 229 | #endif |
154 | 230 | buf_pool->stat.n_page_gets++; | 230 | buf_pool->stat.n_page_gets++; |
155 | 231 | 231 | ||
156 | 232 | 232 | ||
157 | === modified file 'innodb_fix_misc.patch' | |||
158 | --- innodb_fix_misc.patch 2011-06-23 07:32:16 +0000 | |||
159 | +++ innodb_fix_misc.patch 2011-06-27 07:15:55 +0000 | |||
160 | @@ -13,7 +13,7 @@ | |||
161 | 13 | diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c | 13 | diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c |
162 | 14 | --- a/storage/innobase/buf/buf0buf.c 2011-02-23 19:00:48.178696354 +0900 | 14 | --- a/storage/innobase/buf/buf0buf.c 2011-02-23 19:00:48.178696354 +0900 |
163 | 15 | +++ b/storage/innobase/buf/buf0buf.c 2011-02-23 19:01:19.138826278 +0900 | 15 | +++ b/storage/innobase/buf/buf0buf.c 2011-02-23 19:01:19.138826278 +0900 |
165 | 16 | @@ -4065,6 +4065,7 @@ | 16 | @@ -4084,6 +4084,7 @@ |
166 | 17 | bpage->state = BUF_BLOCK_ZIP_PAGE; | 17 | bpage->state = BUF_BLOCK_ZIP_PAGE; |
167 | 18 | bpage->space = space; | 18 | bpage->space = space; |
168 | 19 | bpage->offset = offset; | 19 | bpage->offset = offset; |
169 | 20 | 20 | ||
170 | === modified file 'innodb_pass_corrupt_table.patch' | |||
171 | --- innodb_pass_corrupt_table.patch 2011-06-23 07:32:16 +0000 | |||
172 | +++ innodb_pass_corrupt_table.patch 2011-06-27 07:15:55 +0000 | |||
173 | @@ -357,7 +357,7 @@ | |||
174 | 357 | block_mutex = buf_page_get_mutex_enter(bpage); | 357 | block_mutex = buf_page_get_mutex_enter(bpage); |
175 | 358 | 358 | ||
176 | 359 | rw_lock_s_unlock(&buf_pool->page_hash_latch); | 359 | rw_lock_s_unlock(&buf_pool->page_hash_latch); |
178 | 360 | @@ -3040,6 +3053,13 @@ | 360 | @@ -3059,6 +3072,13 @@ |
179 | 361 | return(NULL); | 361 | return(NULL); |
180 | 362 | } | 362 | } |
181 | 363 | 363 | ||
182 | @@ -371,7 +371,7 @@ | |||
183 | 371 | switch (buf_block_get_state(block)) { | 371 | switch (buf_block_get_state(block)) { |
184 | 372 | buf_page_t* bpage; | 372 | buf_page_t* bpage; |
185 | 373 | ibool success; | 373 | ibool success; |
187 | 374 | @@ -3714,6 +3734,7 @@ | 374 | @@ -3733,6 +3753,7 @@ |
188 | 375 | bpage->newest_modification = 0; | 375 | bpage->newest_modification = 0; |
189 | 376 | bpage->oldest_modification = 0; | 376 | bpage->oldest_modification = 0; |
190 | 377 | HASH_INVALIDATE(bpage, hash); | 377 | HASH_INVALIDATE(bpage, hash); |
191 | @@ -379,7 +379,7 @@ | |||
192 | 379 | #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG | 379 | #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG |
193 | 380 | bpage->file_page_was_freed = FALSE; | 380 | bpage->file_page_was_freed = FALSE; |
194 | 381 | #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ | 381 | #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ |
196 | 382 | @@ -4303,6 +4324,7 @@ | 382 | @@ -4322,6 +4343,7 @@ |
197 | 383 | (ulong) bpage->offset); | 383 | (ulong) bpage->offset); |
198 | 384 | } | 384 | } |
199 | 385 | 385 | ||
200 | @@ -387,7 +387,7 @@ | |||
201 | 387 | /* From version 3.23.38 up we store the page checksum | 387 | /* From version 3.23.38 up we store the page checksum |
202 | 388 | to the 4 first bytes of the page end lsn field */ | 388 | to the 4 first bytes of the page end lsn field */ |
203 | 389 | 389 | ||
205 | 390 | @@ -4344,6 +4366,23 @@ | 390 | @@ -4363,6 +4385,23 @@ |
206 | 391 | REFMAN "forcing-innodb-recovery.html\n" | 391 | REFMAN "forcing-innodb-recovery.html\n" |
207 | 392 | "InnoDB: about forcing recovery.\n", stderr); | 392 | "InnoDB: about forcing recovery.\n", stderr); |
208 | 393 | 393 | ||
209 | @@ -411,7 +411,7 @@ | |||
210 | 411 | if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) { | 411 | if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) { |
211 | 412 | fputs("InnoDB: Ending processing because of" | 412 | fputs("InnoDB: Ending processing because of" |
212 | 413 | " a corrupt database page.\n", | 413 | " a corrupt database page.\n", |
214 | 414 | @@ -4351,6 +4390,7 @@ | 414 | @@ -4370,6 +4409,7 @@ |
215 | 415 | exit(1); | 415 | exit(1); |
216 | 416 | } | 416 | } |
217 | 417 | } | 417 | } |
218 | @@ -419,7 +419,7 @@ | |||
219 | 419 | 419 | ||
220 | 420 | if (recv_recovery_is_on()) { | 420 | if (recv_recovery_is_on()) { |
221 | 421 | /* Pages must be uncompressed for crash recovery. */ | 421 | /* Pages must be uncompressed for crash recovery. */ |
223 | 422 | @@ -4360,8 +4400,11 @@ | 422 | @@ -4379,8 +4419,11 @@ |
224 | 423 | 423 | ||
225 | 424 | if (uncompressed && !recv_no_ibuf_operations) { | 424 | if (uncompressed && !recv_no_ibuf_operations) { |
226 | 425 | ibuf_merge_or_delete_for_page( | 425 | ibuf_merge_or_delete_for_page( |
227 | 426 | 426 | ||
228 | === modified file 'innodb_separate_doublewrite.patch' | |||
229 | --- innodb_separate_doublewrite.patch 2011-06-23 07:32:16 +0000 | |||
230 | +++ innodb_separate_doublewrite.patch 2011-06-27 07:15:55 +0000 | |||
231 | @@ -8,7 +8,7 @@ | |||
232 | 8 | diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c | 8 | diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c |
233 | 9 | --- a/storage/innobase/buf/buf0buf.c 2010-12-03 17:49:11.574962867 +0900 | 9 | --- a/storage/innobase/buf/buf0buf.c 2010-12-03 17:49:11.574962867 +0900 |
234 | 10 | +++ b/storage/innobase/buf/buf0buf.c 2010-12-04 15:35:58.624514033 +0900 | 10 | +++ b/storage/innobase/buf/buf0buf.c 2010-12-04 15:35:58.624514033 +0900 |
236 | 11 | @@ -4272,7 +4272,8 @@ | 11 | @@ -4291,7 +4291,8 @@ |
237 | 12 | read_space_id = mach_read_from_4( | 12 | read_space_id = mach_read_from_4( |
238 | 13 | frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); | 13 | frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); |
239 | 14 | 14 | ||
240 | 15 | 15 | ||
241 | === modified file 'innodb_split_buf_pool_mutex.patch' | |||
242 | --- innodb_split_buf_pool_mutex.patch 2011-06-23 07:32:16 +0000 | |||
243 | +++ innodb_split_buf_pool_mutex.patch 2011-06-27 07:15:55 +0000 | |||
244 | @@ -1093,7 +1093,7 @@ | |||
245 | 1093 | ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage)); | 1093 | ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage)); |
246 | 1094 | 1094 | ||
247 | 1095 | switch (buf_page_get_state(bpage)) { | 1095 | switch (buf_page_get_state(bpage)) { |
249 | 1096 | @@ -2355,19 +2449,19 @@ | 1096 | @@ -2355,24 +2449,43 @@ |
250 | 1097 | case BUF_BLOCK_MEMORY: | 1097 | case BUF_BLOCK_MEMORY: |
251 | 1098 | case BUF_BLOCK_REMOVE_HASH: | 1098 | case BUF_BLOCK_REMOVE_HASH: |
252 | 1099 | case BUF_BLOCK_ZIP_FREE: | 1099 | case BUF_BLOCK_ZIP_FREE: |
253 | @@ -1109,16 +1109,40 @@ | |||
254 | 1109 | goto got_block; | 1109 | goto got_block; |
255 | 1110 | case BUF_BLOCK_FILE_PAGE: | 1110 | case BUF_BLOCK_FILE_PAGE: |
256 | 1111 | - block_mutex = &((buf_block_t*) bpage)->mutex; | 1111 | - block_mutex = &((buf_block_t*) bpage)->mutex; |
257 | 1112 | - mutex_enter(block_mutex); | ||
258 | 1113 | + ut_a(block_mutex == &((buf_block_t*) bpage)->mutex); | 1112 | + ut_a(block_mutex == &((buf_block_t*) bpage)->mutex); |
259 | 1113 | + | ||
260 | 1114 | + /* release mutex to obey to latch-order */ | ||
261 | 1115 | + mutex_exit(block_mutex); | ||
262 | 1116 | + | ||
263 | 1117 | + /* get LRU_list_mutex for buf_LRU_free_block() */ | ||
264 | 1118 | + mutex_enter(&buf_pool->LRU_list_mutex); | ||
265 | 1119 | mutex_enter(block_mutex); | ||
266 | 1114 | 1120 | ||
268 | 1115 | /* Discard the uncompressed page frame if possible. */ | 1121 | - /* Discard the uncompressed page frame if possible. */ |
269 | 1116 | - if (buf_LRU_free_block(bpage, FALSE) == BUF_LRU_FREED) { | 1122 | - if (buf_LRU_free_block(bpage, FALSE) == BUF_LRU_FREED) { |
271 | 1117 | + if (buf_LRU_free_block(bpage, FALSE, FALSE) == BUF_LRU_FREED) { | 1123 | + if (UNIV_UNLIKELY(bpage->space != space |
272 | 1124 | + || bpage->offset != offset | ||
273 | 1125 | + || !bpage->in_LRU_list | ||
274 | 1126 | + || !bpage->zip.data)) { | ||
275 | 1127 | + /* someone should interrupt, retry */ | ||
276 | 1128 | + mutex_exit(&buf_pool->LRU_list_mutex); | ||
277 | 1129 | + mutex_exit(block_mutex); | ||
278 | 1130 | + goto lookup; | ||
279 | 1131 | + } | ||
280 | 1118 | 1132 | ||
281 | 1133 | + /* Discard the uncompressed page frame if possible. */ | ||
282 | 1134 | + if (buf_LRU_free_block(bpage, FALSE, TRUE) == BUF_LRU_FREED) { | ||
283 | 1135 | + mutex_exit(&buf_pool->LRU_list_mutex); | ||
284 | 1119 | mutex_exit(block_mutex); | 1136 | mutex_exit(block_mutex); |
285 | 1120 | goto lookup; | 1137 | goto lookup; |
287 | 1121 | @@ -2385,7 +2479,7 @@ | 1138 | } |
288 | 1139 | |||
289 | 1140 | + mutex_exit(&buf_pool->LRU_list_mutex); | ||
290 | 1141 | + | ||
291 | 1142 | buf_block_buf_fix_inc((buf_block_t*) bpage, | ||
292 | 1143 | __FILE__, __LINE__); | ||
293 | 1144 | goto got_block; | ||
294 | 1145 | @@ -2385,7 +2498,7 @@ | ||
295 | 1122 | must_read = buf_page_get_io_fix(bpage) == BUF_IO_READ; | 1146 | must_read = buf_page_get_io_fix(bpage) == BUF_IO_READ; |
296 | 1123 | access_time = buf_page_is_accessed(bpage); | 1147 | access_time = buf_page_is_accessed(bpage); |
297 | 1124 | 1148 | ||
298 | @@ -1127,7 +1151,7 @@ | |||
299 | 1127 | 1151 | ||
300 | 1128 | mutex_exit(block_mutex); | 1152 | mutex_exit(block_mutex); |
301 | 1129 | 1153 | ||
303 | 1130 | @@ -2697,7 +2791,7 @@ | 1154 | @@ -2697,7 +2810,7 @@ |
304 | 1131 | const buf_block_t* block) /*!< in: pointer to block, | 1155 | const buf_block_t* block) /*!< in: pointer to block, |
305 | 1132 | not dereferenced */ | 1156 | not dereferenced */ |
306 | 1133 | { | 1157 | { |
307 | @@ -1136,7 +1160,7 @@ | |||
308 | 1136 | 1160 | ||
309 | 1137 | if (UNIV_UNLIKELY((((ulint) block) % sizeof *block) != 0)) { | 1161 | if (UNIV_UNLIKELY((((ulint) block) % sizeof *block) != 0)) { |
310 | 1138 | /* The pointer should be aligned. */ | 1162 | /* The pointer should be aligned. */ |
312 | 1139 | @@ -2733,6 +2827,7 @@ | 1163 | @@ -2733,6 +2846,7 @@ |
313 | 1140 | ulint fix_type; | 1164 | ulint fix_type; |
314 | 1141 | ibool must_read; | 1165 | ibool must_read; |
315 | 1142 | ulint retries = 0; | 1166 | ulint retries = 0; |
316 | @@ -1144,7 +1168,7 @@ | |||
317 | 1144 | buf_pool_t* buf_pool = buf_pool_get(space, offset); | 1168 | buf_pool_t* buf_pool = buf_pool_get(space, offset); |
318 | 1145 | 1169 | ||
319 | 1146 | ut_ad(mtr); | 1170 | ut_ad(mtr); |
321 | 1147 | @@ -2765,9 +2860,11 @@ | 1171 | @@ -2765,9 +2879,11 @@ |
322 | 1148 | fold = buf_page_address_fold(space, offset); | 1172 | fold = buf_page_address_fold(space, offset); |
323 | 1149 | loop: | 1173 | loop: |
324 | 1150 | block = guess; | 1174 | block = guess; |
325 | @@ -1157,7 +1181,7 @@ | |||
326 | 1157 | /* If the guess is a compressed page descriptor that | 1181 | /* If the guess is a compressed page descriptor that |
327 | 1158 | has been allocated by buf_buddy_alloc(), it may have | 1182 | has been allocated by buf_buddy_alloc(), it may have |
328 | 1159 | been invalidated by buf_buddy_relocate(). In that | 1183 | been invalidated by buf_buddy_relocate(). In that |
330 | 1160 | @@ -2776,11 +2873,15 @@ | 1184 | @@ -2776,11 +2892,15 @@ |
331 | 1161 | the guess may be pointing to a buffer pool chunk that | 1185 | the guess may be pointing to a buffer pool chunk that |
332 | 1162 | has been released when resizing the buffer pool. */ | 1186 | has been released when resizing the buffer pool. */ |
333 | 1163 | 1187 | ||
334 | @@ -1174,7 +1198,7 @@ | |||
335 | 1174 | block = guess = NULL; | 1198 | block = guess = NULL; |
336 | 1175 | } else { | 1199 | } else { |
337 | 1176 | ut_ad(!block->page.in_zip_hash); | 1200 | ut_ad(!block->page.in_zip_hash); |
339 | 1177 | @@ -2789,12 +2890,19 @@ | 1201 | @@ -2789,12 +2909,19 @@ |
340 | 1178 | } | 1202 | } |
341 | 1179 | 1203 | ||
342 | 1180 | if (block == NULL) { | 1204 | if (block == NULL) { |
343 | @@ -1194,7 +1218,7 @@ | |||
344 | 1194 | block = NULL; | 1218 | block = NULL; |
345 | 1195 | } | 1219 | } |
346 | 1196 | 1220 | ||
348 | 1197 | @@ -2806,12 +2914,14 @@ | 1221 | @@ -2806,12 +2933,14 @@ |
349 | 1198 | space, offset, fold); | 1222 | space, offset, fold); |
350 | 1199 | 1223 | ||
351 | 1200 | if (UNIV_LIKELY_NULL(block)) { | 1224 | if (UNIV_LIKELY_NULL(block)) { |
352 | @@ -1211,7 +1235,7 @@ | |||
353 | 1211 | 1235 | ||
354 | 1212 | if (mode == BUF_GET_IF_IN_POOL | 1236 | if (mode == BUF_GET_IF_IN_POOL |
355 | 1213 | || mode == BUF_PEEK_IF_IN_POOL | 1237 | || mode == BUF_PEEK_IF_IN_POOL |
357 | 1214 | @@ -2861,7 +2971,8 @@ | 1238 | @@ -2861,7 +2990,8 @@ |
358 | 1215 | /* The page is being read to buffer pool, | 1239 | /* The page is being read to buffer pool, |
359 | 1216 | but we cannot wait around for the read to | 1240 | but we cannot wait around for the read to |
360 | 1217 | complete. */ | 1241 | complete. */ |
361 | @@ -1221,7 +1245,7 @@ | |||
362 | 1221 | 1245 | ||
363 | 1222 | return(NULL); | 1246 | return(NULL); |
364 | 1223 | } | 1247 | } |
366 | 1224 | @@ -2871,38 +2982,49 @@ | 1248 | @@ -2871,38 +3001,49 @@ |
367 | 1225 | ibool success; | 1249 | ibool success; |
368 | 1226 | 1250 | ||
369 | 1227 | case BUF_BLOCK_FILE_PAGE: | 1251 | case BUF_BLOCK_FILE_PAGE: |
370 | @@ -1278,7 +1302,7 @@ | |||
371 | 1278 | 1302 | ||
372 | 1279 | { | 1303 | { |
373 | 1280 | buf_page_t* hash_bpage; | 1304 | buf_page_t* hash_bpage; |
375 | 1281 | @@ -2915,35 +3037,47 @@ | 1305 | @@ -2915,35 +3056,47 @@ |
376 | 1282 | while buf_pool->mutex was released. | 1306 | while buf_pool->mutex was released. |
377 | 1283 | Free the block that was allocated. */ | 1307 | Free the block that was allocated. */ |
378 | 1284 | 1308 | ||
379 | @@ -1332,7 +1356,7 @@ | |||
380 | 1332 | buf_block_init_low(block); | 1356 | buf_block_init_low(block); |
381 | 1333 | block->lock_hash_val = lock_rec_hash(space, offset); | 1357 | block->lock_hash_val = lock_rec_hash(space, offset); |
382 | 1334 | 1358 | ||
384 | 1335 | @@ -2952,7 +3086,7 @@ | 1359 | @@ -2952,7 +3105,7 @@ |
385 | 1336 | 1360 | ||
386 | 1337 | if (buf_page_get_state(&block->page) | 1361 | if (buf_page_get_state(&block->page) |
387 | 1338 | == BUF_BLOCK_ZIP_PAGE) { | 1362 | == BUF_BLOCK_ZIP_PAGE) { |
388 | @@ -1341,7 +1365,7 @@ | |||
389 | 1341 | &block->page); | 1365 | &block->page); |
390 | 1342 | ut_ad(!block->page.in_flush_list); | 1366 | ut_ad(!block->page.in_flush_list); |
391 | 1343 | } else { | 1367 | } else { |
393 | 1344 | @@ -2969,20 +3103,25 @@ | 1368 | @@ -2969,20 +3122,25 @@ |
394 | 1345 | /* Insert at the front of unzip_LRU list */ | 1369 | /* Insert at the front of unzip_LRU list */ |
395 | 1346 | buf_unzip_LRU_add_block(block, FALSE); | 1370 | buf_unzip_LRU_add_block(block, FALSE); |
396 | 1347 | 1371 | ||
397 | @@ -1370,7 +1394,7 @@ | |||
398 | 1370 | 1394 | ||
399 | 1371 | /* Decompress the page and apply buffered operations | 1395 | /* Decompress the page and apply buffered operations |
400 | 1372 | while not holding buf_pool->mutex or block->mutex. */ | 1396 | while not holding buf_pool->mutex or block->mutex. */ |
402 | 1373 | @@ -2995,12 +3134,15 @@ | 1397 | @@ -2995,12 +3153,15 @@ |
403 | 1374 | } | 1398 | } |
404 | 1375 | 1399 | ||
405 | 1376 | /* Unfix and unlatch the block. */ | 1400 | /* Unfix and unlatch the block. */ |
406 | @@ -1389,7 +1413,7 @@ | |||
407 | 1389 | rw_lock_x_unlock(&block->lock); | 1413 | rw_lock_x_unlock(&block->lock); |
408 | 1390 | 1414 | ||
409 | 1391 | break; | 1415 | break; |
411 | 1392 | @@ -3016,7 +3158,7 @@ | 1416 | @@ -3016,7 +3177,7 @@ |
412 | 1393 | 1417 | ||
413 | 1394 | ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); | 1418 | ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); |
414 | 1395 | 1419 | ||
415 | @@ -1398,7 +1422,7 @@ | |||
416 | 1398 | #if UNIV_WORD_SIZE == 4 | 1422 | #if UNIV_WORD_SIZE == 4 |
417 | 1399 | /* On 32-bit systems, there is no padding in buf_page_t. On | 1423 | /* On 32-bit systems, there is no padding in buf_page_t. On |
418 | 1400 | other systems, Valgrind could complain about uninitialized pad | 1424 | other systems, Valgrind could complain about uninitialized pad |
420 | 1401 | @@ -3029,8 +3171,8 @@ | 1425 | @@ -3029,8 +3190,8 @@ |
421 | 1402 | /* Try to evict the block from the buffer pool, to use the | 1426 | /* Try to evict the block from the buffer pool, to use the |
422 | 1403 | insert buffer (change buffer) as much as possible. */ | 1427 | insert buffer (change buffer) as much as possible. */ |
423 | 1404 | 1428 | ||
424 | @@ -1409,7 +1433,7 @@ | |||
425 | 1409 | if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) { | 1433 | if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) { |
426 | 1410 | /* Set the watch, as it would have | 1434 | /* Set the watch, as it would have |
427 | 1411 | been set if the page were not in the | 1435 | been set if the page were not in the |
429 | 1412 | @@ -3039,6 +3181,9 @@ | 1436 | @@ -3039,6 +3200,9 @@ |
430 | 1413 | space, offset, fold); | 1437 | space, offset, fold); |
431 | 1414 | 1438 | ||
432 | 1415 | if (UNIV_LIKELY_NULL(block)) { | 1439 | if (UNIV_LIKELY_NULL(block)) { |
433 | @@ -1419,7 +1443,7 @@ | |||
434 | 1419 | 1443 | ||
435 | 1420 | /* The page entered the buffer | 1444 | /* The page entered the buffer |
436 | 1421 | pool for some reason. Try to | 1445 | pool for some reason. Try to |
438 | 1422 | @@ -3046,7 +3191,7 @@ | 1446 | @@ -3046,7 +3210,7 @@ |
439 | 1423 | goto got_block; | 1447 | goto got_block; |
440 | 1424 | } | 1448 | } |
441 | 1425 | } | 1449 | } |
442 | @@ -1428,7 +1452,7 @@ | |||
443 | 1428 | fprintf(stderr, | 1452 | fprintf(stderr, |
444 | 1429 | "innodb_change_buffering_debug evict %u %u\n", | 1453 | "innodb_change_buffering_debug evict %u %u\n", |
445 | 1430 | (unsigned) space, (unsigned) offset); | 1454 | (unsigned) space, (unsigned) offset); |
447 | 1431 | @@ -3065,13 +3210,14 @@ | 1455 | @@ -3065,13 +3229,14 @@ |
448 | 1432 | 1456 | ||
449 | 1433 | buf_block_buf_fix_inc(block, file, line); | 1457 | buf_block_buf_fix_inc(block, file, line); |
450 | 1434 | 1458 | ||
451 | @@ -1445,7 +1469,7 @@ | |||
452 | 1445 | 1469 | ||
453 | 1446 | if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL)) { | 1470 | if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL)) { |
454 | 1447 | buf_page_set_accessed_make_young(&block->page, access_time); | 1471 | buf_page_set_accessed_make_young(&block->page, access_time); |
456 | 1448 | @@ -3308,9 +3454,11 @@ | 1472 | @@ -3308,9 +3473,11 @@ |
457 | 1449 | buf_pool = buf_pool_from_block(block); | 1473 | buf_pool = buf_pool_from_block(block); |
458 | 1450 | 1474 | ||
459 | 1451 | if (mode == BUF_MAKE_YOUNG && buf_page_peek_if_too_old(&block->page)) { | 1475 | if (mode == BUF_MAKE_YOUNG && buf_page_peek_if_too_old(&block->page)) { |
460 | @@ -1459,7 +1483,7 @@ | |||
461 | 1459 | } else if (!buf_page_is_accessed(&block->page)) { | 1483 | } else if (!buf_page_is_accessed(&block->page)) { |
462 | 1460 | /* Above, we do a dirty read on purpose, to avoid | 1484 | /* Above, we do a dirty read on purpose, to avoid |
463 | 1461 | mutex contention. The field buf_page_t::access_time | 1485 | mutex contention. The field buf_page_t::access_time |
465 | 1462 | @@ -3318,9 +3466,11 @@ | 1486 | @@ -3318,9 +3485,11 @@ |
466 | 1463 | field must be protected by mutex, however. */ | 1487 | field must be protected by mutex, however. */ |
467 | 1464 | ulint time_ms = ut_time_ms(); | 1488 | ulint time_ms = ut_time_ms(); |
468 | 1465 | 1489 | ||
469 | @@ -1473,7 +1497,7 @@ | |||
470 | 1473 | } | 1497 | } |
471 | 1474 | 1498 | ||
472 | 1475 | ut_ad(!ibuf_inside(mtr) || mode == BUF_KEEP_OLD); | 1499 | ut_ad(!ibuf_inside(mtr) || mode == BUF_KEEP_OLD); |
474 | 1476 | @@ -3387,18 +3537,21 @@ | 1500 | @@ -3387,18 +3556,21 @@ |
475 | 1477 | ut_ad(mtr); | 1501 | ut_ad(mtr); |
476 | 1478 | ut_ad(mtr->state == MTR_ACTIVE); | 1502 | ut_ad(mtr->state == MTR_ACTIVE); |
477 | 1479 | 1503 | ||
478 | @@ -1498,7 +1522,7 @@ | |||
479 | 1498 | 1522 | ||
480 | 1499 | #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG | 1523 | #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG |
481 | 1500 | ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); | 1524 | ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); |
483 | 1501 | @@ -3487,7 +3640,10 @@ | 1525 | @@ -3487,7 +3659,10 @@ |
484 | 1502 | buf_page_t* hash_page; | 1526 | buf_page_t* hash_page; |
485 | 1503 | buf_pool_t* buf_pool = buf_pool_get(space, offset); | 1527 | buf_pool_t* buf_pool = buf_pool_get(space, offset); |
486 | 1504 | 1528 | ||
487 | @@ -1510,7 +1534,7 @@ | |||
488 | 1510 | ut_ad(mutex_own(&(block->mutex))); | 1534 | ut_ad(mutex_own(&(block->mutex))); |
489 | 1511 | ut_a(buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE); | 1535 | ut_a(buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE); |
490 | 1512 | 1536 | ||
492 | 1513 | @@ -3516,11 +3672,14 @@ | 1537 | @@ -3516,11 +3691,14 @@ |
493 | 1514 | if (UNIV_LIKELY(!hash_page)) { | 1538 | if (UNIV_LIKELY(!hash_page)) { |
494 | 1515 | } else if (buf_pool_watch_is_sentinel(buf_pool, hash_page)) { | 1539 | } else if (buf_pool_watch_is_sentinel(buf_pool, hash_page)) { |
495 | 1516 | /* Preserve the reference count. */ | 1540 | /* Preserve the reference count. */ |
496 | @@ -1526,7 +1550,7 @@ | |||
497 | 1526 | } else { | 1550 | } else { |
498 | 1527 | fprintf(stderr, | 1551 | fprintf(stderr, |
499 | 1528 | "InnoDB: Error: page %lu %lu already found" | 1552 | "InnoDB: Error: page %lu %lu already found" |
501 | 1529 | @@ -3530,7 +3689,8 @@ | 1553 | @@ -3530,7 +3708,8 @@ |
502 | 1530 | (const void*) hash_page, (const void*) block); | 1554 | (const void*) hash_page, (const void*) block); |
503 | 1531 | #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG | 1555 | #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG |
504 | 1532 | mutex_exit(&block->mutex); | 1556 | mutex_exit(&block->mutex); |
505 | @@ -1536,7 +1560,7 @@ | |||
506 | 1536 | buf_print(); | 1560 | buf_print(); |
507 | 1537 | buf_LRU_print(); | 1561 | buf_LRU_print(); |
508 | 1538 | buf_validate(); | 1562 | buf_validate(); |
510 | 1539 | @@ -3613,7 +3773,9 @@ | 1563 | @@ -3613,7 +3792,9 @@ |
511 | 1540 | 1564 | ||
512 | 1541 | fold = buf_page_address_fold(space, offset); | 1565 | fold = buf_page_address_fold(space, offset); |
513 | 1542 | 1566 | ||
514 | @@ -1547,7 +1571,7 @@ | |||
515 | 1547 | 1571 | ||
516 | 1548 | watch_page = buf_page_hash_get_low(buf_pool, space, offset, fold); | 1572 | watch_page = buf_page_hash_get_low(buf_pool, space, offset, fold); |
517 | 1549 | if (watch_page && !buf_pool_watch_is_sentinel(buf_pool, watch_page)) { | 1573 | if (watch_page && !buf_pool_watch_is_sentinel(buf_pool, watch_page)) { |
519 | 1550 | @@ -3622,9 +3784,15 @@ | 1574 | @@ -3622,9 +3803,15 @@ |
520 | 1551 | err_exit: | 1575 | err_exit: |
521 | 1552 | if (block) { | 1576 | if (block) { |
522 | 1553 | mutex_enter(&block->mutex); | 1577 | mutex_enter(&block->mutex); |
523 | @@ -1564,7 +1588,7 @@ | |||
524 | 1564 | 1588 | ||
525 | 1565 | bpage = NULL; | 1589 | bpage = NULL; |
526 | 1566 | goto func_exit; | 1590 | goto func_exit; |
528 | 1567 | @@ -3647,6 +3815,8 @@ | 1591 | @@ -3647,6 +3834,8 @@ |
529 | 1568 | 1592 | ||
530 | 1569 | buf_page_init(space, offset, fold, block); | 1593 | buf_page_init(space, offset, fold, block); |
531 | 1570 | 1594 | ||
532 | @@ -1573,7 +1597,7 @@ | |||
533 | 1573 | /* The block must be put to the LRU list, to the old blocks */ | 1597 | /* The block must be put to the LRU list, to the old blocks */ |
534 | 1574 | buf_LRU_add_block(bpage, TRUE/* to old blocks */); | 1598 | buf_LRU_add_block(bpage, TRUE/* to old blocks */); |
535 | 1575 | 1599 | ||
537 | 1576 | @@ -3674,7 +3844,7 @@ | 1600 | @@ -3674,7 +3863,7 @@ |
538 | 1577 | been added to buf_pool->LRU and | 1601 | been added to buf_pool->LRU and |
539 | 1578 | buf_pool->page_hash. */ | 1602 | buf_pool->page_hash. */ |
540 | 1579 | mutex_exit(&block->mutex); | 1603 | mutex_exit(&block->mutex); |
541 | @@ -1582,7 +1606,7 @@ | |||
542 | 1582 | mutex_enter(&block->mutex); | 1606 | mutex_enter(&block->mutex); |
543 | 1583 | block->page.zip.data = data; | 1607 | block->page.zip.data = data; |
544 | 1584 | 1608 | ||
546 | 1585 | @@ -3687,6 +3857,7 @@ | 1609 | @@ -3687,6 +3876,7 @@ |
547 | 1586 | buf_unzip_LRU_add_block(block, TRUE); | 1610 | buf_unzip_LRU_add_block(block, TRUE); |
548 | 1587 | } | 1611 | } |
549 | 1588 | 1612 | ||
550 | @@ -1590,7 +1614,7 @@ | |||
551 | 1590 | mutex_exit(&block->mutex); | 1614 | mutex_exit(&block->mutex); |
552 | 1591 | } else { | 1615 | } else { |
553 | 1592 | /* Defer buf_buddy_alloc() until after the block has | 1616 | /* Defer buf_buddy_alloc() until after the block has |
555 | 1593 | @@ -3698,8 +3869,8 @@ | 1617 | @@ -3698,8 +3888,8 @@ |
556 | 1594 | control block (bpage), in order to avoid the | 1618 | control block (bpage), in order to avoid the |
557 | 1595 | invocation of buf_buddy_relocate_block() on | 1619 | invocation of buf_buddy_relocate_block() on |
558 | 1596 | uninitialized data. */ | 1620 | uninitialized data. */ |
559 | @@ -1601,7 +1625,7 @@ | |||
560 | 1601 | 1625 | ||
561 | 1602 | /* Initialize the buf_pool pointer. */ | 1626 | /* Initialize the buf_pool pointer. */ |
562 | 1603 | bpage->buf_pool_index = buf_pool_index(buf_pool); | 1627 | bpage->buf_pool_index = buf_pool_index(buf_pool); |
564 | 1604 | @@ -3719,8 +3890,11 @@ | 1628 | @@ -3719,8 +3909,11 @@ |
565 | 1605 | /* The block was added by some other thread. */ | 1629 | /* The block was added by some other thread. */ |
566 | 1606 | watch_page = NULL; | 1630 | watch_page = NULL; |
567 | 1607 | bpage->state = BUF_BLOCK_ZIP_FREE; | 1631 | bpage->state = BUF_BLOCK_ZIP_FREE; |
568 | @@ -1615,7 +1639,7 @@ | |||
569 | 1615 | 1639 | ||
570 | 1616 | bpage = NULL; | 1640 | bpage = NULL; |
571 | 1617 | goto func_exit; | 1641 | goto func_exit; |
573 | 1618 | @@ -3764,18 +3938,24 @@ | 1642 | @@ -3764,18 +3957,24 @@ |
574 | 1619 | HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, | 1643 | HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, |
575 | 1620 | bpage); | 1644 | bpage); |
576 | 1621 | 1645 | ||
577 | @@ -1641,7 +1665,7 @@ | |||
578 | 1641 | 1665 | ||
579 | 1642 | if (mode == BUF_READ_IBUF_PAGES_ONLY) { | 1666 | if (mode == BUF_READ_IBUF_PAGES_ONLY) { |
580 | 1643 | 1667 | ||
582 | 1644 | @@ -3817,7 +3997,9 @@ | 1668 | @@ -3817,7 +4016,9 @@ |
583 | 1645 | 1669 | ||
584 | 1646 | fold = buf_page_address_fold(space, offset); | 1670 | fold = buf_page_address_fold(space, offset); |
585 | 1647 | 1671 | ||
586 | @@ -1652,7 +1676,7 @@ | |||
587 | 1652 | 1676 | ||
588 | 1653 | block = (buf_block_t*) buf_page_hash_get_low( | 1677 | block = (buf_block_t*) buf_page_hash_get_low( |
589 | 1654 | buf_pool, space, offset, fold); | 1678 | buf_pool, space, offset, fold); |
591 | 1655 | @@ -3833,7 +4015,9 @@ | 1679 | @@ -3833,7 +4034,9 @@ |
592 | 1656 | #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ | 1680 | #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ |
593 | 1657 | 1681 | ||
594 | 1658 | /* Page can be found in buf_pool */ | 1682 | /* Page can be found in buf_pool */ |
595 | @@ -1663,7 +1687,7 @@ | |||
596 | 1663 | 1687 | ||
597 | 1664 | buf_block_free(free_block); | 1688 | buf_block_free(free_block); |
598 | 1665 | 1689 | ||
600 | 1666 | @@ -3855,6 +4039,7 @@ | 1690 | @@ -3855,6 +4058,7 @@ |
601 | 1667 | mutex_enter(&block->mutex); | 1691 | mutex_enter(&block->mutex); |
602 | 1668 | 1692 | ||
603 | 1669 | buf_page_init(space, offset, fold, block); | 1693 | buf_page_init(space, offset, fold, block); |
604 | @@ -1671,7 +1695,7 @@ | |||
605 | 1671 | 1695 | ||
606 | 1672 | /* The block must be put to the LRU list */ | 1696 | /* The block must be put to the LRU list */ |
607 | 1673 | buf_LRU_add_block(&block->page, FALSE); | 1697 | buf_LRU_add_block(&block->page, FALSE); |
609 | 1674 | @@ -3881,7 +4066,7 @@ | 1698 | @@ -3881,7 +4085,7 @@ |
610 | 1675 | the reacquisition of buf_pool->mutex. We also must | 1699 | the reacquisition of buf_pool->mutex. We also must |
611 | 1676 | defer this operation until after the block descriptor | 1700 | defer this operation until after the block descriptor |
612 | 1677 | has been added to buf_pool->LRU and buf_pool->page_hash. */ | 1701 | has been added to buf_pool->LRU and buf_pool->page_hash. */ |
613 | @@ -1680,7 +1704,7 @@ | |||
614 | 1680 | mutex_enter(&block->mutex); | 1704 | mutex_enter(&block->mutex); |
615 | 1681 | block->page.zip.data = data; | 1705 | block->page.zip.data = data; |
616 | 1682 | 1706 | ||
618 | 1683 | @@ -3899,7 +4084,8 @@ | 1707 | @@ -3899,7 +4103,8 @@ |
619 | 1684 | 1708 | ||
620 | 1685 | buf_page_set_accessed(&block->page, time_ms); | 1709 | buf_page_set_accessed(&block->page, time_ms); |
621 | 1686 | 1710 | ||
622 | @@ -1690,7 +1714,7 @@ | |||
623 | 1690 | 1714 | ||
624 | 1691 | mtr_memo_push(mtr, block, MTR_MEMO_BUF_FIX); | 1715 | mtr_memo_push(mtr, block, MTR_MEMO_BUF_FIX); |
625 | 1692 | 1716 | ||
627 | 1693 | @@ -3950,6 +4136,8 @@ | 1717 | @@ -3950,6 +4155,8 @@ |
628 | 1694 | buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); | 1718 | buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); |
629 | 1695 | const ibool uncompressed = (buf_page_get_state(bpage) | 1719 | const ibool uncompressed = (buf_page_get_state(bpage) |
630 | 1696 | == BUF_BLOCK_FILE_PAGE); | 1720 | == BUF_BLOCK_FILE_PAGE); |
631 | @@ -1699,7 +1723,7 @@ | |||
632 | 1699 | 1723 | ||
633 | 1700 | ut_a(buf_page_in_file(bpage)); | 1724 | ut_a(buf_page_in_file(bpage)); |
634 | 1701 | 1725 | ||
636 | 1702 | @@ -4083,8 +4271,26 @@ | 1726 | @@ -4083,8 +4290,26 @@ |
637 | 1703 | } | 1727 | } |
638 | 1704 | } | 1728 | } |
639 | 1705 | 1729 | ||
640 | @@ -1727,7 +1751,7 @@ | |||
641 | 1727 | 1751 | ||
642 | 1728 | #ifdef UNIV_IBUF_COUNT_DEBUG | 1752 | #ifdef UNIV_IBUF_COUNT_DEBUG |
643 | 1729 | if (io_type == BUF_IO_WRITE || uncompressed) { | 1753 | if (io_type == BUF_IO_WRITE || uncompressed) { |
645 | 1730 | @@ -4107,6 +4313,7 @@ | 1754 | @@ -4107,6 +4332,7 @@ |
646 | 1731 | the x-latch to this OS thread: do not let this confuse you in | 1755 | the x-latch to this OS thread: do not let this confuse you in |
647 | 1732 | debugging! */ | 1756 | debugging! */ |
648 | 1733 | 1757 | ||
649 | @@ -1735,7 +1759,7 @@ | |||
650 | 1735 | ut_ad(buf_pool->n_pend_reads > 0); | 1759 | ut_ad(buf_pool->n_pend_reads > 0); |
651 | 1736 | buf_pool->n_pend_reads--; | 1760 | buf_pool->n_pend_reads--; |
652 | 1737 | buf_pool->stat.n_pages_read++; | 1761 | buf_pool->stat.n_pages_read++; |
654 | 1738 | @@ -4124,6 +4331,9 @@ | 1762 | @@ -4124,6 +4350,9 @@ |
655 | 1739 | 1763 | ||
656 | 1740 | buf_flush_write_complete(bpage); | 1764 | buf_flush_write_complete(bpage); |
657 | 1741 | 1765 | ||
658 | @@ -1745,7 +1769,7 @@ | |||
659 | 1745 | if (uncompressed) { | 1769 | if (uncompressed) { |
660 | 1746 | rw_lock_s_unlock_gen(&((buf_block_t*) bpage)->lock, | 1770 | rw_lock_s_unlock_gen(&((buf_block_t*) bpage)->lock, |
661 | 1747 | BUF_IO_WRITE); | 1771 | BUF_IO_WRITE); |
663 | 1748 | @@ -4146,8 +4356,8 @@ | 1772 | @@ -4146,8 +4375,8 @@ |
664 | 1749 | } | 1773 | } |
665 | 1750 | #endif /* UNIV_DEBUG */ | 1774 | #endif /* UNIV_DEBUG */ |
666 | 1751 | 1775 | ||
667 | @@ -1755,7 +1779,7 @@ | |||
668 | 1755 | } | 1779 | } |
669 | 1756 | 1780 | ||
670 | 1757 | /*********************************************************************//** | 1781 | /*********************************************************************//** |
672 | 1758 | @@ -4164,7 +4374,9 @@ | 1782 | @@ -4164,7 +4393,9 @@ |
673 | 1759 | 1783 | ||
674 | 1760 | ut_ad(buf_pool); | 1784 | ut_ad(buf_pool); |
675 | 1761 | 1785 | ||
676 | @@ -1766,7 +1790,7 @@ | |||
677 | 1766 | 1790 | ||
678 | 1767 | chunk = buf_pool->chunks; | 1791 | chunk = buf_pool->chunks; |
679 | 1768 | 1792 | ||
681 | 1769 | @@ -4181,7 +4393,9 @@ | 1793 | @@ -4181,7 +4412,9 @@ |
682 | 1770 | } | 1794 | } |
683 | 1771 | } | 1795 | } |
684 | 1772 | 1796 | ||
685 | @@ -1777,7 +1801,7 @@ | |||
686 | 1777 | 1801 | ||
687 | 1778 | return(TRUE); | 1802 | return(TRUE); |
688 | 1779 | } | 1803 | } |
690 | 1780 | @@ -4229,7 +4443,8 @@ | 1804 | @@ -4229,7 +4462,8 @@ |
691 | 1781 | freed = buf_LRU_search_and_free_block(buf_pool, 100); | 1805 | freed = buf_LRU_search_and_free_block(buf_pool, 100); |
692 | 1782 | } | 1806 | } |
693 | 1783 | 1807 | ||
694 | @@ -1787,7 +1811,7 @@ | |||
695 | 1787 | 1811 | ||
696 | 1788 | ut_ad(UT_LIST_GET_LEN(buf_pool->LRU) == 0); | 1812 | ut_ad(UT_LIST_GET_LEN(buf_pool->LRU) == 0); |
697 | 1789 | ut_ad(UT_LIST_GET_LEN(buf_pool->unzip_LRU) == 0); | 1813 | ut_ad(UT_LIST_GET_LEN(buf_pool->unzip_LRU) == 0); |
699 | 1790 | @@ -4242,7 +4457,8 @@ | 1814 | @@ -4242,7 +4476,8 @@ |
700 | 1791 | memset(&buf_pool->stat, 0x00, sizeof(buf_pool->stat)); | 1815 | memset(&buf_pool->stat, 0x00, sizeof(buf_pool->stat)); |
701 | 1792 | buf_refresh_io_stats(buf_pool); | 1816 | buf_refresh_io_stats(buf_pool); |
702 | 1793 | 1817 | ||
703 | @@ -1797,7 +1821,7 @@ | |||
704 | 1797 | } | 1821 | } |
705 | 1798 | 1822 | ||
706 | 1799 | /*********************************************************************//** | 1823 | /*********************************************************************//** |
708 | 1800 | @@ -4284,7 +4500,10 @@ | 1824 | @@ -4284,7 +4519,10 @@ |
709 | 1801 | 1825 | ||
710 | 1802 | ut_ad(buf_pool); | 1826 | ut_ad(buf_pool); |
711 | 1803 | 1827 | ||
712 | @@ -1809,7 +1833,7 @@ | |||
713 | 1809 | 1833 | ||
714 | 1810 | chunk = buf_pool->chunks; | 1834 | chunk = buf_pool->chunks; |
715 | 1811 | 1835 | ||
717 | 1812 | @@ -4379,7 +4598,7 @@ | 1836 | @@ -4379,7 +4617,7 @@ |
718 | 1813 | /* Check clean compressed-only blocks. */ | 1837 | /* Check clean compressed-only blocks. */ |
719 | 1814 | 1838 | ||
720 | 1815 | for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b; | 1839 | for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b; |
721 | @@ -1818,7 +1842,7 @@ | |||
722 | 1818 | ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE); | 1842 | ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE); |
723 | 1819 | switch (buf_page_get_io_fix(b)) { | 1843 | switch (buf_page_get_io_fix(b)) { |
724 | 1820 | case BUF_IO_NONE: | 1844 | case BUF_IO_NONE: |
726 | 1821 | @@ -4410,7 +4629,7 @@ | 1845 | @@ -4410,7 +4648,7 @@ |
727 | 1822 | 1846 | ||
728 | 1823 | buf_flush_list_mutex_enter(buf_pool); | 1847 | buf_flush_list_mutex_enter(buf_pool); |
729 | 1824 | for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b; | 1848 | for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b; |
730 | @@ -1827,7 +1851,7 @@ | |||
731 | 1827 | ut_ad(b->in_flush_list); | 1851 | ut_ad(b->in_flush_list); |
732 | 1828 | ut_a(b->oldest_modification); | 1852 | ut_a(b->oldest_modification); |
733 | 1829 | n_flush++; | 1853 | n_flush++; |
735 | 1830 | @@ -4469,6 +4688,8 @@ | 1854 | @@ -4469,6 +4707,8 @@ |
736 | 1831 | } | 1855 | } |
737 | 1832 | 1856 | ||
738 | 1833 | ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == n_lru); | 1857 | ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == n_lru); |
739 | @@ -1836,7 +1860,7 @@ | |||
740 | 1836 | if (UT_LIST_GET_LEN(buf_pool->free) != n_free) { | 1860 | if (UT_LIST_GET_LEN(buf_pool->free) != n_free) { |
741 | 1837 | fprintf(stderr, "Free list len %lu, free blocks %lu\n", | 1861 | fprintf(stderr, "Free list len %lu, free blocks %lu\n", |
742 | 1838 | (ulong) UT_LIST_GET_LEN(buf_pool->free), | 1862 | (ulong) UT_LIST_GET_LEN(buf_pool->free), |
744 | 1839 | @@ -4479,8 +4700,11 @@ | 1863 | @@ -4479,8 +4719,11 @@ |
745 | 1840 | ut_a(buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE] == n_single_flush); | 1864 | ut_a(buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE] == n_single_flush); |
746 | 1841 | ut_a(buf_pool->n_flush[BUF_FLUSH_LIST] == n_list_flush); | 1865 | ut_a(buf_pool->n_flush[BUF_FLUSH_LIST] == n_list_flush); |
747 | 1842 | ut_a(buf_pool->n_flush[BUF_FLUSH_LRU] == n_lru_flush); | 1866 | ut_a(buf_pool->n_flush[BUF_FLUSH_LRU] == n_lru_flush); |
748 | @@ -1849,7 +1873,7 @@ | |||
749 | 1849 | 1873 | ||
750 | 1850 | ut_a(buf_LRU_validate()); | 1874 | ut_a(buf_LRU_validate()); |
751 | 1851 | ut_a(buf_flush_validate(buf_pool)); | 1875 | ut_a(buf_flush_validate(buf_pool)); |
753 | 1852 | @@ -4536,7 +4760,9 @@ | 1876 | @@ -4536,7 +4779,9 @@ |
754 | 1853 | index_ids = mem_alloc(size * sizeof *index_ids); | 1877 | index_ids = mem_alloc(size * sizeof *index_ids); |
755 | 1854 | counts = mem_alloc(sizeof(ulint) * size); | 1878 | counts = mem_alloc(sizeof(ulint) * size); |
756 | 1855 | 1879 | ||
757 | @@ -1860,7 +1884,7 @@ | |||
758 | 1860 | buf_flush_list_mutex_enter(buf_pool); | 1884 | buf_flush_list_mutex_enter(buf_pool); |
759 | 1861 | 1885 | ||
760 | 1862 | fprintf(stderr, | 1886 | fprintf(stderr, |
762 | 1863 | @@ -4605,7 +4831,9 @@ | 1887 | @@ -4605,7 +4850,9 @@ |
763 | 1864 | } | 1888 | } |
764 | 1865 | } | 1889 | } |
765 | 1866 | 1890 | ||
766 | @@ -1871,7 +1895,7 @@ | |||
767 | 1871 | 1895 | ||
768 | 1872 | for (i = 0; i < n_found; i++) { | 1896 | for (i = 0; i < n_found; i++) { |
769 | 1873 | index = dict_index_get_if_in_cache(index_ids[i]); | 1897 | index = dict_index_get_if_in_cache(index_ids[i]); |
771 | 1874 | @@ -4662,7 +4890,7 @@ | 1898 | @@ -4662,7 +4909,7 @@ |
772 | 1875 | buf_chunk_t* chunk; | 1899 | buf_chunk_t* chunk; |
773 | 1876 | ulint fixed_pages_number = 0; | 1900 | ulint fixed_pages_number = 0; |
774 | 1877 | 1901 | ||
775 | @@ -1880,7 +1904,7 @@ | |||
776 | 1880 | 1904 | ||
777 | 1881 | chunk = buf_pool->chunks; | 1905 | chunk = buf_pool->chunks; |
778 | 1882 | 1906 | ||
780 | 1883 | @@ -4696,7 +4924,7 @@ | 1907 | @@ -4696,7 +4943,7 @@ |
781 | 1884 | /* Traverse the lists of clean and dirty compressed-only blocks. */ | 1908 | /* Traverse the lists of clean and dirty compressed-only blocks. */ |
782 | 1885 | 1909 | ||
783 | 1886 | for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b; | 1910 | for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b; |
784 | @@ -1889,7 +1913,7 @@ | |||
785 | 1889 | ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE); | 1913 | ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE); |
786 | 1890 | ut_a(buf_page_get_io_fix(b) != BUF_IO_WRITE); | 1914 | ut_a(buf_page_get_io_fix(b) != BUF_IO_WRITE); |
787 | 1891 | 1915 | ||
789 | 1892 | @@ -4708,7 +4936,7 @@ | 1916 | @@ -4708,7 +4955,7 @@ |
790 | 1893 | 1917 | ||
791 | 1894 | buf_flush_list_mutex_enter(buf_pool); | 1918 | buf_flush_list_mutex_enter(buf_pool); |
792 | 1895 | for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b; | 1919 | for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b; |
793 | @@ -1898,7 +1922,7 @@ | |||
794 | 1898 | ut_ad(b->in_flush_list); | 1922 | ut_ad(b->in_flush_list); |
795 | 1899 | 1923 | ||
796 | 1900 | switch (buf_page_get_state(b)) { | 1924 | switch (buf_page_get_state(b)) { |
798 | 1901 | @@ -4734,7 +4962,7 @@ | 1925 | @@ -4734,7 +4981,7 @@ |
799 | 1902 | 1926 | ||
800 | 1903 | buf_flush_list_mutex_exit(buf_pool); | 1927 | buf_flush_list_mutex_exit(buf_pool); |
801 | 1904 | mutex_exit(&buf_pool->zip_mutex); | 1928 | mutex_exit(&buf_pool->zip_mutex); |
802 | @@ -1907,7 +1931,7 @@ | |||
803 | 1907 | 1931 | ||
804 | 1908 | return(fixed_pages_number); | 1932 | return(fixed_pages_number); |
805 | 1909 | } | 1933 | } |
807 | 1910 | @@ -4890,6 +5118,8 @@ | 1934 | @@ -4890,6 +5137,8 @@ |
808 | 1911 | /* Find appropriate pool_info to store stats for this buffer pool */ | 1935 | /* Find appropriate pool_info to store stats for this buffer pool */ |
809 | 1912 | pool_info = &all_pool_info[pool_id]; | 1936 | pool_info = &all_pool_info[pool_id]; |
810 | 1913 | 1937 | ||
811 | @@ -1916,7 +1940,7 @@ | |||
812 | 1916 | buf_pool_mutex_enter(buf_pool); | 1940 | buf_pool_mutex_enter(buf_pool); |
813 | 1917 | buf_flush_list_mutex_enter(buf_pool); | 1941 | buf_flush_list_mutex_enter(buf_pool); |
814 | 1918 | 1942 | ||
816 | 1919 | @@ -5000,6 +5230,8 @@ | 1943 | @@ -5000,6 +5249,8 @@ |
817 | 1920 | pool_info->unzip_cur = buf_LRU_stat_cur.unzip; | 1944 | pool_info->unzip_cur = buf_LRU_stat_cur.unzip; |
818 | 1921 | 1945 | ||
819 | 1922 | buf_refresh_io_stats(buf_pool); | 1946 | buf_refresh_io_stats(buf_pool); |
820 | @@ -1925,7 +1949,7 @@ | |||
821 | 1925 | buf_pool_mutex_exit(buf_pool); | 1949 | buf_pool_mutex_exit(buf_pool); |
822 | 1926 | } | 1950 | } |
823 | 1927 | 1951 | ||
825 | 1928 | @@ -5241,11 +5473,13 @@ | 1952 | @@ -5241,11 +5492,13 @@ |
826 | 1929 | { | 1953 | { |
827 | 1930 | ulint len; | 1954 | ulint len; |
828 | 1931 | 1955 |
running param-build http:// jenkins. percona. com/view/ Percona% 20Server% 205.5/job/ percona- server- 5.5-param/ 23/