Merge lp:~percona-dev/percona-server/release-5.1.50-12-fix_bug643650 into lp:percona-server/release-5.1.50-12

Proposed by Yasufumi Kinoshita
Status: Merged
Approved by: Vadim Tkachenko
Approved revision: no longer in the source branch.
Merged at revision: 118
Proposed branch: lp:~percona-dev/percona-server/release-5.1.50-12-fix_bug643650
Merge into: lp:percona-server/release-5.1.50-12
Diff against target: 131 lines (+17/-13)
1 file modified
innodb_buffer_pool_shm.patch (+17/-13)
To merge this branch: bzr merge lp:~percona-dev/percona-server/release-5.1.50-12-fix_bug643650
Reviewer Review Type Date Requested Status
Vadim Tkachenko Approve
Review via email: mp+36694@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

no documentation needed, just entry in RN

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'innodb_buffer_pool_shm.patch'
--- innodb_buffer_pool_shm.patch 2010-09-24 10:32:15 +0000
+++ innodb_buffer_pool_shm.patch 2010-09-27 10:11:07 +0000
@@ -96,7 +96,7 @@
96 /********************************************************************//**96 /********************************************************************//**
97 Allocates a chunk of buffer frames.97 Allocates a chunk of buffer frames.
98 @return chunk, or NULL on failure */98 @return chunk, or NULL on failure */
99@@ -768,26 +835,170 @@99@@ -768,26 +835,174 @@
100 {100 {
101 buf_block_t* block;101 buf_block_t* block;
102 byte* frame;102 byte* frame;
@@ -167,6 +167,10 @@
167+ memset(chunk->mem, '\0', chunk->mem_size);167+ memset(chunk->mem, '\0', chunk->mem_size);
168+ }168+ }
169+#endif169+#endif
170+ /* for ut_fold_binary_32(), these values should be 32-bit aligned */
171+ ut_a(sizeof(buf_shm_info_t) % 4 == 0);
172+ ut_a((ulint)chunk->mem % 4 == 0);
173+ ut_a(chunk->mem_size % 4 == 0);
170+174+
171+ shm_info = chunk->mem;175+ shm_info = chunk->mem;
172+176+
@@ -227,7 +231,7 @@
227+ ut_a(shm_info->zip_hash_n == zip_hash_n);231+ ut_a(shm_info->zip_hash_n == zip_hash_n);
228+232+
229+ /* check checksum */233+ /* check checksum */
230+ checksum = ut_fold_binary((byte*)chunk->mem + sizeof(buf_shm_info_t),234+ checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
231+ chunk->mem_size - sizeof(buf_shm_info_t));235+ chunk->mem_size - sizeof(buf_shm_info_t));
232+ if (shm_info->checksum != checksum) {236+ if (shm_info->checksum != checksum) {
233+ fprintf(stderr,237+ fprintf(stderr,
@@ -267,7 +271,7 @@
267 271
268 /* Align a pointer to the first frame. Note that when272 /* Align a pointer to the first frame. Note that when
269 os_large_page_size is smaller than UNIV_PAGE_SIZE,273 os_large_page_size is smaller than UNIV_PAGE_SIZE,
270@@ -795,8 +1006,13 @@274@@ -795,8 +1010,13 @@
271 it is bigger, we may allocate more blocks than requested. */275 it is bigger, we may allocate more blocks than requested. */
272 276
273 frame = ut_align(chunk->mem, UNIV_PAGE_SIZE);277 frame = ut_align(chunk->mem, UNIV_PAGE_SIZE);
@@ -281,7 +285,7 @@
281 285
282 /* Subtract the space needed for block descriptors. */286 /* Subtract the space needed for block descriptors. */
283 {287 {
284@@ -810,6 +1026,98 @@288@@ -810,6 +1030,98 @@
285 chunk->size = size;289 chunk->size = size;
286 }290 }
287 291
@@ -380,7 +384,7 @@
380 /* Init block structs and assign frames for them. Then we384 /* Init block structs and assign frames for them. Then we
381 assign the frames to the first blocks (we already mapped the385 assign the frames to the first blocks (we already mapped the
382 memory above). */386 memory above). */
383@@ -833,6 +1141,11 @@387@@ -833,6 +1145,11 @@
384 block++;388 block++;
385 frame += UNIV_PAGE_SIZE;389 frame += UNIV_PAGE_SIZE;
386 }390 }
@@ -392,7 +396,7 @@
392 396
393 return(chunk);397 return(chunk);
394 }398 }
395@@ -1014,6 +1327,8 @@399@@ -1014,6 +1331,8 @@
396 UNIV_MEM_UNDESC(block);400 UNIV_MEM_UNDESC(block);
397 }401 }
398 402
@@ -401,7 +405,7 @@
401 os_mem_free_large(chunk->mem, chunk->mem_size);405 os_mem_free_large(chunk->mem, chunk->mem_size);
402 }406 }
403 407
404@@ -1063,7 +1378,10 @@408@@ -1063,7 +1382,10 @@
405 srv_buf_pool_curr_size = buf_pool->curr_size * UNIV_PAGE_SIZE;409 srv_buf_pool_curr_size = buf_pool->curr_size * UNIV_PAGE_SIZE;
406 410
407 buf_pool->page_hash = hash_create(2 * buf_pool->curr_size);411 buf_pool->page_hash = hash_create(2 * buf_pool->curr_size);
@@ -412,7 +416,7 @@
412 416
413 buf_pool->last_printout_time = time(NULL);417 buf_pool->last_printout_time = time(NULL);
414 418
415@@ -1078,6 +1396,86 @@419@@ -1078,6 +1400,86 @@
416 --------------------------- */420 --------------------------- */
417 /* All fields are initialized by mem_zalloc(). */421 /* All fields are initialized by mem_zalloc(). */
418 422
@@ -499,7 +503,7 @@
499 mutex_exit(&LRU_list_mutex);503 mutex_exit(&LRU_list_mutex);
500 rw_lock_x_unlock(&page_hash_latch);504 rw_lock_x_unlock(&page_hash_latch);
501 buf_pool_mutex_exit();505 buf_pool_mutex_exit();
502@@ -1102,6 +1500,30 @@506@@ -1102,6 +1504,30 @@
503 buf_chunk_t* chunk;507 buf_chunk_t* chunk;
504 buf_chunk_t* chunks;508 buf_chunk_t* chunks;
505 509
@@ -520,7 +524,7 @@
520+ memcpy(&(shm_info->chunk_backup), chunk, sizeof(buf_chunk_t));524+ memcpy(&(shm_info->chunk_backup), chunk, sizeof(buf_chunk_t));
521+525+
522+ if (srv_fast_shutdown < 2) {526+ if (srv_fast_shutdown < 2) {
523+ shm_info->checksum = ut_fold_binary((byte*)chunk->mem + sizeof(buf_shm_info_t),527+ shm_info->checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
524+ chunk->mem_size - sizeof(buf_shm_info_t));528+ chunk->mem_size - sizeof(buf_shm_info_t));
525+ shm_info->clean = TRUE;529+ shm_info->clean = TRUE;
526+ }530+ }
@@ -530,7 +534,7 @@
530 chunks = buf_pool->chunks;534 chunks = buf_pool->chunks;
531 chunk = chunks + buf_pool->n_chunks;535 chunk = chunks + buf_pool->n_chunks;
532 536
533@@ -1110,10 +1532,13 @@537@@ -1110,10 +1536,13 @@
534 would fail at shutdown. */538 would fail at shutdown. */
535 os_mem_free_large(chunk->mem, chunk->mem_size);539 os_mem_free_large(chunk->mem, chunk->mem_size);
536 }540 }
@@ -544,7 +548,7 @@
544 mem_free(buf_pool);548 mem_free(buf_pool);
545 buf_pool = NULL;549 buf_pool = NULL;
546 }550 }
547@@ -1308,6 +1733,11 @@551@@ -1308,6 +1737,11 @@
548 //buf_pool_mutex_enter();552 //buf_pool_mutex_enter();
549 mutex_enter(&LRU_list_mutex);553 mutex_enter(&LRU_list_mutex);
550 554
@@ -556,7 +560,7 @@
556 shrink_again:560 shrink_again:
557 if (buf_pool->n_chunks <= 1) {561 if (buf_pool->n_chunks <= 1) {
558 562
559@@ -1551,6 +1981,11 @@563@@ -1551,6 +1985,11 @@
560 buf_pool_resize(void)564 buf_pool_resize(void)
561 /*=================*/565 /*=================*/
562 {566 {

Subscribers

People subscribed via source and target branches

to all changes: