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 on 2010-09-27
Status: Merged
Approved by: Vadim Tkachenko on 2010-09-27
Approved revision: 118
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 2010-09-27 Approve on 2010-09-27
Review via email: mp+36694@code.launchpad.net
To post a comment you must log in.
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
1=== modified file 'innodb_buffer_pool_shm.patch'
2--- innodb_buffer_pool_shm.patch 2010-09-24 10:32:15 +0000
3+++ innodb_buffer_pool_shm.patch 2010-09-27 10:11:07 +0000
4@@ -96,7 +96,7 @@
5 /********************************************************************//**
6 Allocates a chunk of buffer frames.
7 @return chunk, or NULL on failure */
8-@@ -768,26 +835,170 @@
9+@@ -768,26 +835,174 @@
10 {
11 buf_block_t* block;
12 byte* frame;
13@@ -167,6 +167,10 @@
14 + memset(chunk->mem, '\0', chunk->mem_size);
15 + }
16 +#endif
17++ /* for ut_fold_binary_32(), these values should be 32-bit aligned */
18++ ut_a(sizeof(buf_shm_info_t) % 4 == 0);
19++ ut_a((ulint)chunk->mem % 4 == 0);
20++ ut_a(chunk->mem_size % 4 == 0);
21 +
22 + shm_info = chunk->mem;
23 +
24@@ -227,7 +231,7 @@
25 + ut_a(shm_info->zip_hash_n == zip_hash_n);
26 +
27 + /* check checksum */
28-+ checksum = ut_fold_binary((byte*)chunk->mem + sizeof(buf_shm_info_t),
29++ checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
30 + chunk->mem_size - sizeof(buf_shm_info_t));
31 + if (shm_info->checksum != checksum) {
32 + fprintf(stderr,
33@@ -267,7 +271,7 @@
34
35 /* Align a pointer to the first frame. Note that when
36 os_large_page_size is smaller than UNIV_PAGE_SIZE,
37-@@ -795,8 +1006,13 @@
38+@@ -795,8 +1010,13 @@
39 it is bigger, we may allocate more blocks than requested. */
40
41 frame = ut_align(chunk->mem, UNIV_PAGE_SIZE);
42@@ -281,7 +285,7 @@
43
44 /* Subtract the space needed for block descriptors. */
45 {
46-@@ -810,6 +1026,98 @@
47+@@ -810,6 +1030,98 @@
48 chunk->size = size;
49 }
50
51@@ -380,7 +384,7 @@
52 /* Init block structs and assign frames for them. Then we
53 assign the frames to the first blocks (we already mapped the
54 memory above). */
55-@@ -833,6 +1141,11 @@
56+@@ -833,6 +1145,11 @@
57 block++;
58 frame += UNIV_PAGE_SIZE;
59 }
60@@ -392,7 +396,7 @@
61
62 return(chunk);
63 }
64-@@ -1014,6 +1327,8 @@
65+@@ -1014,6 +1331,8 @@
66 UNIV_MEM_UNDESC(block);
67 }
68
69@@ -401,7 +405,7 @@
70 os_mem_free_large(chunk->mem, chunk->mem_size);
71 }
72
73-@@ -1063,7 +1378,10 @@
74+@@ -1063,7 +1382,10 @@
75 srv_buf_pool_curr_size = buf_pool->curr_size * UNIV_PAGE_SIZE;
76
77 buf_pool->page_hash = hash_create(2 * buf_pool->curr_size);
78@@ -412,7 +416,7 @@
79
80 buf_pool->last_printout_time = time(NULL);
81
82-@@ -1078,6 +1396,86 @@
83+@@ -1078,6 +1400,86 @@
84 --------------------------- */
85 /* All fields are initialized by mem_zalloc(). */
86
87@@ -499,7 +503,7 @@
88 mutex_exit(&LRU_list_mutex);
89 rw_lock_x_unlock(&page_hash_latch);
90 buf_pool_mutex_exit();
91-@@ -1102,6 +1500,30 @@
92+@@ -1102,6 +1504,30 @@
93 buf_chunk_t* chunk;
94 buf_chunk_t* chunks;
95
96@@ -520,7 +524,7 @@
97 + memcpy(&(shm_info->chunk_backup), chunk, sizeof(buf_chunk_t));
98 +
99 + if (srv_fast_shutdown < 2) {
100-+ shm_info->checksum = ut_fold_binary((byte*)chunk->mem + sizeof(buf_shm_info_t),
101++ shm_info->checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
102 + chunk->mem_size - sizeof(buf_shm_info_t));
103 + shm_info->clean = TRUE;
104 + }
105@@ -530,7 +534,7 @@
106 chunks = buf_pool->chunks;
107 chunk = chunks + buf_pool->n_chunks;
108
109-@@ -1110,10 +1532,13 @@
110+@@ -1110,10 +1536,13 @@
111 would fail at shutdown. */
112 os_mem_free_large(chunk->mem, chunk->mem_size);
113 }
114@@ -544,7 +548,7 @@
115 mem_free(buf_pool);
116 buf_pool = NULL;
117 }
118-@@ -1308,6 +1733,11 @@
119+@@ -1308,6 +1737,11 @@
120 //buf_pool_mutex_enter();
121 mutex_enter(&LRU_list_mutex);
122
123@@ -556,7 +560,7 @@
124 shrink_again:
125 if (buf_pool->n_chunks <= 1) {
126
127-@@ -1551,6 +1981,11 @@
128+@@ -1551,6 +1985,11 @@
129 buf_pool_resize(void)
130 /*=================*/
131 {

Subscribers

People subscribed via source and target branches

to all changes: