~vlad-lesin/percona-server/pintables

« back to all changes in this revision

Viewing changes to innodb_fast_checksum.patch

  • Committer: Laurynas Biveinis
  • Date: 2011-06-21 02:36:36 UTC
  • mfrom: (123 merge)
  • mto: This revision was merged to the branch mainline in revision 124.
  • Revision ID: laurynas.biveinis@percona.com-20110621023636-ccp1iyyrncj181zt
MergeĀ fromĀ lp:percona-server

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
110
110
--- a/storage/innobase/fil/fil0fil.c    2010-12-04 15:52:23.406513743 +0900
111
111
+++ b/storage/innobase/fil/fil0fil.c    2010-12-04 15:53:45.020513800 +0900
112
 
@@ -3199,7 +3199,9 @@
113
 
                        mach_write_to_8(page + FIL_PAGE_FILE_FLUSH_LSN, current_lsn);
 
112
@@ -3094,13 +3094,24 @@
 
113
                return(TRUE);
 
114
        }
 
115
 
 
116
-       if (checksum_field != 0
 
117
+       if (!srv_fast_checksum
 
118
+           && checksum_field != 0
 
119
            && checksum_field != BUF_NO_CHECKSUM_MAGIC
 
120
            && checksum_field
 
121
            != buf_calc_page_new_checksum(page)) {
 
122
                return(TRUE);
 
123
        }
 
124
 
 
125
+       if (srv_fast_checksum
 
126
+           && checksum_field != 0
 
127
+           && checksum_field != BUF_NO_CHECKSUM_MAGIC
 
128
+           && checksum_field
 
129
+           != buf_calc_page_new_checksum_32(page)
 
130
+           && checksum_field
 
131
+           != buf_calc_page_new_checksum(page)) {
 
132
+               return(TRUE);
 
133
+       }
 
134
+
 
135
        return(FALSE);
 
136
 }
 
137
 
 
138
@@ -3116,7 +3127,9 @@
 
139
        if (!zip_size) {
114
140
                mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
115
141
                                srv_use_checksums
116
142
-                               ? buf_calc_page_new_checksum(page)
120
146
                                                : BUF_NO_CHECKSUM_MAGIC);
121
147
                mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
122
148
                                srv_use_checksums
123
 
@@ -3331,7 +3333,8 @@
124
 
                                        page_is_corrupt = TRUE;
125
 
                                }
126
 
 
127
 
-                               if (checksum_field != 0
128
 
+                               if (!srv_fast_checksum
129
 
+                                   && checksum_field != 0
130
 
                                    && checksum_field != BUF_NO_CHECKSUM_MAGIC
131
 
                                    && checksum_field
132
 
                                    != buf_calc_page_new_checksum(page)) {
133
 
@@ -3339,6 +3342,17 @@
134
 
                                        page_is_corrupt = TRUE;
135
 
                                }
136
 
 
137
 
+                               if (srv_fast_checksum
138
 
+                                   && checksum_field != 0
139
 
+                                   && checksum_field != BUF_NO_CHECKSUM_MAGIC
140
 
+                                   && checksum_field
141
 
+                                   != buf_calc_page_new_checksum_32(page)
142
 
+                                   && checksum_field
143
 
+                                   != buf_calc_page_new_checksum(page)) {
144
 
+
145
 
+                                       page_is_corrupt = TRUE;
146
 
+                               }
147
 
+
148
 
                                /* if it is free page, inconsistency is acceptable */
149
 
                                if (!offset) {
150
 
                                        /* header page*/
151
 
@@ -3484,7 +3498,9 @@
152
 
 
153
 
                                        mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
154
 
                                                        srv_use_checksums
155
 
-                                                       ? buf_calc_page_new_checksum(page)
156
 
+                                                       ? (!srv_fast_checksum
157
 
+                                                          ? buf_calc_page_new_checksum(page)
158
 
+                                                          : buf_calc_page_new_checksum_32(page))
159
 
                                                                        : BUF_NO_CHECKSUM_MAGIC);
160
 
                                        mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
161
 
                                                        srv_use_checksums
162
149
diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
163
150
--- a/storage/innobase/handler/ha_innodb.cc     2010-12-04 15:52:23.420480329 +0900
164
151
+++ b/storage/innobase/handler/ha_innodb.cc     2010-12-04 15:53:45.029551892 +0900
170
157
 static my_bool innobase_recovery_stats                 = TRUE;
171
158
 static my_bool innobase_locks_unsafe_for_binlog        = FALSE;
172
159
 static my_bool innobase_overwrite_relay_log_info       = FALSE;
173
 
@@ -2606,6 +2607,7 @@
 
160
@@ -2620,6 +2621,7 @@
174
161
 
175
162
        srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
176
163
        srv_use_checksums = (ibool) innobase_use_checksums;
178
165
 
179
166
 #ifdef HAVE_LARGE_PAGES
180
167
         if ((os_use_large_pages = (ibool) my_use_large_pages))
181
 
@@ -11414,6 +11416,15 @@
 
168
@@ -11421,6 +11423,15 @@
182
169
   "Disable with --skip-innodb-checksums.",
183
170
   NULL, NULL, TRUE);
184
171
 
194
181
 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
195
182
   PLUGIN_VAR_READONLY,
196
183
   "The common part for InnoDB table spaces.",
197
 
@@ -11922,6 +11933,7 @@
 
184
@@ -11930,6 +11941,7 @@
198
185
   MYSQL_SYSVAR(buffer_pool_size),
199
186
   MYSQL_SYSVAR(buffer_pool_instances),
200
187
   MYSQL_SYSVAR(checksums),
231
218
diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
232
219
--- a/storage/innobase/include/srv0srv.h        2010-12-04 15:52:23.474482590 +0900
233
220
+++ b/storage/innobase/include/srv0srv.h        2010-12-04 15:53:45.048512100 +0900
234
 
@@ -227,6 +227,7 @@
 
221
@@ -224,6 +224,7 @@
235
222
 
236
223
 extern ibool   srv_use_doublewrite_buf;
237
224
 extern ibool   srv_use_checksums;
291
278
diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
292
279
--- a/storage/innobase/srv/srv0srv.c    2010-12-04 15:52:23.498513634 +0900
293
280
+++ b/storage/innobase/srv/srv0srv.c    2010-12-04 15:53:45.053550283 +0900
294
 
@@ -420,6 +420,7 @@
 
281
@@ -414,6 +414,7 @@
295
282
 
296
283
 UNIV_INTERN ibool      srv_use_doublewrite_buf = TRUE;
297
284
 UNIV_INTERN ibool      srv_use_checksums = TRUE;