Merge lp:~akopytov/percona-xtrabackup/rebase-2.1-on-newer-server-versions into lp:percona-xtrabackup/2.1
- rebase-2.1-on-newer-server-versions
- Merge into 2.1
Proposed by
Alexey Kopytov
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Laurynas Biveinis | ||||||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||||||
Merged at revision: | 630 | ||||||||||||||||
Proposed branch: | lp:~akopytov/percona-xtrabackup/rebase-2.1-on-newer-server-versions | ||||||||||||||||
Merge into: | lp:percona-xtrabackup/2.1 | ||||||||||||||||
Diff against target: |
4471 lines (+762/-724) 12 files modified
Makefile (+9/-39) patches/innodb51.patch (+87/-88) patches/innodb55.patch (+99/-92) patches/innodb56.patch (+70/-67) patches/xtradb51.patch (+114/-119) patches/xtradb55.patch (+238/-228) src/Makefile (+1/-1) src/compact.cc (+1/-1) src/innodb_int.cc (+58/-2) src/innodb_int.h (+52/-2) src/xtrabackup.cc (+8/-12) utils/build.sh (+25/-73) |
||||||||||||||||
To merge this branch: | bzr merge lp:~akopytov/percona-xtrabackup/rebase-2.1-on-newer-server-versions | ||||||||||||||||
Related bugs: |
|
||||||||||||||||
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Laurynas Biveinis (community) | Approve | ||
Review via email: mp+176200@code.launchpad.net |
Commit message
Description of the change
Rebased XtraBackup on MySQL versions 5.1.70, 5.5.30, 5.6.11 and Percona
Server versions 5.1.70-rel14.8 and 5.5.31-rel30.3.
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote : | # |
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
Indentation or tabs vs spaces in diff lines 4377 to the end?
review:
Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote : | # |
I have standardized on spaces for indentation for XB shell scripts, because that's what the majority of code uses. I fix that in existing code whenever I have to touch a line. I deliberately kept tabs on the lines I didn't have to touch to simplify the patch.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
OK
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile' |
2 | --- Makefile 2013-06-18 08:07:48 +0000 |
3 | +++ Makefile 2013-07-22 14:01:36 +0000 |
4 | @@ -4,61 +4,31 @@ |
5 | |
6 | # Here we specify what server versions we build against |
7 | |
8 | -MYSQL_51_SOURCE=mysql-5.1.59.tar.gz |
9 | -MYSQL_55_SOURCE=mysql-5.5.17.tar.gz |
10 | -MYSQL_56_SOURCE=mysql-5.6.10.tar.gz |
11 | -PS_51_VERSION=5.1.59-13.0 |
12 | -PS_51_SOURCE=Percona-Server-XtraBackup-$(PS_51_VERSION).tar.gz |
13 | -PS_55_VERSION=5.5.16-22.0 |
14 | -PS_55_SOURCE=Percona-Server-XtraBackup-$(PS_55_VERSION).tar.gz |
15 | +MYSQL_51_SOURCE=mysql-5.1.70.tar.gz |
16 | +MYSQL_55_SOURCE=mysql-5.5.31.tar.gz |
17 | +MYSQL_56_SOURCE=mysql-5.6.11.tar.gz |
18 | +PS_51_SOURCE=Percona-Server-5.1.70-rel14.8.tar.gz |
19 | +PS_55_SOURCE=Percona-Server-5.5.31-rel30.3.tar.gz |
20 | BZR_REVNO=$(shell bzr revno 2>/dev/null || cat REVNO) |
21 | XTRABACKUP_VERSION=$(shell sed -e 's/XTRABACKUP_VERSION=//' < VERSION) |
22 | |
23 | # targets for fetching server source tarballs |
24 | |
25 | -SERVER_SOURCE_TARBALLS=$(MYSQL_51_SOURCE) $(MYSQL_55_SOURCE) $(MYSQL_56_SOURCE) |
26 | -PS_SERVER=$(PS_51_SOURCE) $(PS_55_SOURCE) |
27 | - |
28 | -# PS server source tarballs are inadequate |
29 | -# for these older versions, so we have to make them ourselves |
30 | +SERVER_SOURCE_TARBALLS=$(MYSQL_51_SOURCE) $(MYSQL_55_SOURCE) \ |
31 | + $(MYSQL_56_SOURCE) $(PS_51_SOURCE) $(PS_55_SOURCE) |
32 | |
33 | .PHONY: ps51source ps55source |
34 | |
35 | ps51source: $(PS_51_SOURCE) |
36 | |
37 | - |
38 | -$(PS_51_SOURCE): |
39 | - rm -rf percona-server-5.1-xtrabackup |
40 | - bzr branch -r tag:Percona-Server-$(PS_51_VERSION) lp:percona-server/5.1 percona-server-5.1-xtrabackup |
41 | - cd percona-server-5.1-xtrabackup && bzr export percona-server-5.1-xtrabackup.tar.gz |
42 | - mv percona-server-5.1-xtrabackup/percona-server-5.1-xtrabackup.tar.gz . |
43 | - rm -rf percona-server-5.1-xtrabackup |
44 | - tar xfz percona-server-5.1-xtrabackup.tar.gz |
45 | - cd percona-server-5.1-xtrabackup && make mysql-$(shell echo $(PS_51_VERSION) | sed -e 's/-.*//').tar.gz |
46 | - rm percona-server-5.1-xtrabackup.tar.gz |
47 | - tar cfz $(PS_51_SOURCE) percona-server-5.1-xtrabackup |
48 | - rm -rf percona-server-5.1-xtrabackup |
49 | - |
50 | ps55source: $(PS_55_SOURCE) |
51 | |
52 | -$(PS_55_SOURCE): |
53 | - rm -rf percona-server-5.5-xtrabackup |
54 | - bzr branch -r tag:Percona-Server-$(PS_55_VERSION) lp:percona-server/5.5 percona-server-5.5-xtrabackup |
55 | - cd percona-server-5.5-xtrabackup && bzr export percona-server-5.5-xtrabackup.tar.gz |
56 | - mv percona-server-5.5-xtrabackup/percona-server-5.5-xtrabackup.tar.gz . |
57 | - rm -rf percona-server-5.5-xtrabackup |
58 | - tar xfz percona-server-5.5-xtrabackup.tar.gz |
59 | - cd percona-server-5.5-xtrabackup && make mysql-$(shell echo $(PS_55_VERSION) | sed -e 's/-.*//').tar.gz |
60 | - rm percona-server-5.5-xtrabackup.tar.gz |
61 | - tar cfz $(PS_55_SOURCE) percona-server-5.5-xtrabackup |
62 | - rm -rf percona-server-5.5-xtrabackup |
63 | - |
64 | # source dist targets |
65 | |
66 | -dist: $(SERVER_SOURCE_TARBALLS) $(PS_SERVER) |
67 | +dist: $(SERVER_SOURCE_TARBALLS) |
68 | bzr export percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz |
69 | tar xfz percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz |
70 | - cp $(SERVER_SOURCE_TARBALLS) $(PS_SERVER) percona-xtrabackup-$(XTRABACKUP_VERSION)/ |
71 | + cp $(SERVER_SOURCE_TARBALLS) percona-xtrabackup-$(XTRABACKUP_VERSION)/ |
72 | echo $(BZR_REVNO) > percona-xtrabackup-$(XTRABACKUP_VERSION)/REVNO |
73 | rm percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz |
74 | tar cfz percona-xtrabackup-$(XTRABACKUP_VERSION)-$(BZR_REVNO).tar.gz percona-xtrabackup-$(XTRABACKUP_VERSION) |
75 | |
76 | === modified file 'patches/innodb51.patch' |
77 | --- patches/innodb51.patch 2013-05-07 13:32:47 +0000 |
78 | +++ patches/innodb51.patch 2013-07-22 14:01:36 +0000 |
79 | @@ -9,7 +9,7 @@ |
80 | buf_block_t* |
81 | btr_root_block_get( |
82 | /*===============*/ |
83 | -@@ -1122,7 +1122,7 @@ |
84 | +@@ -1169,7 +1169,7 @@ |
85 | /************************************************************//** |
86 | Returns the child page of a node pointer and x-latches it. |
87 | @return child page, x-latched */ |
88 | @@ -18,16 +18,6 @@ |
89 | buf_block_t* |
90 | btr_node_ptr_get_child( |
91 | /*===================*/ |
92 | ---- a/storage/innodb_plugin/btr/btr0cur.c |
93 | -+++ b/storage/innodb_plugin/btr/btr0cur.c |
94 | -@@ -3308,6 +3308,7 @@ |
95 | - byte* field; |
96 | - |
97 | - field = rec_get_nth_field(rec, offsets, i, &rec_len); |
98 | -+ (void)field; |
99 | - |
100 | - if (rec_len != UNIV_SQL_NULL) { |
101 | - n_not_null[i]++; |
102 | --- a/storage/innodb_plugin/buf/buf0buf.c |
103 | +++ b/storage/innodb_plugin/buf/buf0buf.c |
104 | @@ -51,6 +51,7 @@ |
105 | @@ -38,7 +28,7 @@ |
106 | |
107 | /* |
108 | IMPLEMENTATION OF THE BUFFER POOL |
109 | -@@ -358,7 +359,7 @@ |
110 | +@@ -350,7 +351,7 @@ |
111 | return(TRUE); |
112 | } |
113 | |
114 | @@ -47,7 +37,7 @@ |
115 | if (recv_lsn_checks_on) { |
116 | ib_uint64_t current_lsn; |
117 | |
118 | -@@ -670,6 +671,7 @@ |
119 | +@@ -662,6 +663,7 @@ |
120 | block->page.in_flush_list = FALSE; |
121 | block->page.in_free_list = FALSE; |
122 | block->page.in_LRU_list = FALSE; |
123 | @@ -55,7 +45,7 @@ |
124 | block->in_unzip_LRU_list = FALSE; |
125 | #endif /* UNIV_DEBUG */ |
126 | #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG |
127 | -@@ -1690,7 +1692,9 @@ |
128 | +@@ -1588,7 +1590,9 @@ |
129 | ut_ad(zip_size == fil_space_get_zip_size(space)); |
130 | ut_ad(ut_is_2pow(zip_size)); |
131 | #ifndef UNIV_LOG_DEBUG |
132 | @@ -66,7 +56,7 @@ |
133 | #endif |
134 | buf_pool->stat.n_page_gets++; |
135 | loop: |
136 | -@@ -2802,6 +2806,12 @@ |
137 | +@@ -2704,6 +2708,12 @@ |
138 | frame = ((buf_block_t*) bpage)->frame; |
139 | } |
140 | |
141 | @@ -79,7 +69,7 @@ |
142 | /* If this page is not uninitialized and not in the |
143 | doublewrite buffer, then the page number and space id |
144 | should be the same as in block. */ |
145 | -@@ -2894,7 +2904,8 @@ |
146 | +@@ -2796,7 +2806,8 @@ |
147 | recv_recover_page(TRUE, (buf_block_t*) bpage); |
148 | } |
149 | |
150 | @@ -199,7 +189,7 @@ |
151 | |
152 | /* |
153 | IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE |
154 | -@@ -287,7 +289,7 @@ |
155 | +@@ -288,7 +290,7 @@ |
156 | |
157 | /** The tablespace memory cache. This variable is NULL before the module is |
158 | initialized. */ |
159 | @@ -208,7 +198,7 @@ |
160 | |
161 | |
162 | /********************************************************************//** |
163 | -@@ -298,7 +300,7 @@ |
164 | +@@ -299,7 +301,7 @@ |
165 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
166 | mutex. */ |
167 | static |
168 | @@ -217,7 +207,7 @@ |
169 | fil_node_prepare_for_io( |
170 | /*====================*/ |
171 | fil_node_t* node, /*!< in: file node */ |
172 | -@@ -623,7 +625,7 @@ |
173 | +@@ -624,7 +626,7 @@ |
174 | Opens a the file of a node of a tablespace. The caller must own the fil_system |
175 | mutex. */ |
176 | static |
177 | @@ -226,7 +216,7 @@ |
178 | fil_node_open_file( |
179 | /*===============*/ |
180 | fil_node_t* node, /*!< in: file node */ |
181 | -@@ -657,7 +659,17 @@ |
182 | +@@ -658,7 +660,17 @@ |
183 | node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success); |
184 | if (!success) { |
185 | /* The following call prints an error message */ |
186 | @@ -245,7 +235,7 @@ |
187 | |
188 | ut_print_timestamp(stderr); |
189 | |
190 | -@@ -718,12 +730,15 @@ |
191 | +@@ -719,12 +731,15 @@ |
192 | |
193 | if (UNIV_UNLIKELY(space_id != space->id)) { |
194 | fprintf(stderr, |
195 | @@ -264,7 +254,7 @@ |
196 | } |
197 | |
198 | if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED |
199 | -@@ -747,8 +762,8 @@ |
200 | +@@ -748,8 +763,8 @@ |
201 | } |
202 | |
203 | if (size_bytes >= 1024 * 1024) { |
204 | @@ -275,7 +265,7 @@ |
205 | } |
206 | |
207 | if (!(flags & DICT_TF_ZSSIZE_MASK)) { |
208 | -@@ -793,6 +808,8 @@ |
209 | +@@ -794,6 +809,8 @@ |
210 | /* Put the node to the LRU list */ |
211 | UT_LIST_ADD_FIRST(LRU, system->LRU, node); |
212 | } |
213 | @@ -284,7 +274,7 @@ |
214 | } |
215 | |
216 | /**********************************************************************//** |
217 | -@@ -1418,7 +1435,12 @@ |
218 | +@@ -1438,7 +1455,12 @@ |
219 | the file yet; the following calls will open it and update the |
220 | size fields */ |
221 | |
222 | @@ -298,7 +288,7 @@ |
223 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
224 | } |
225 | |
226 | -@@ -1470,7 +1492,12 @@ |
227 | +@@ -1490,7 +1512,12 @@ |
228 | the file yet; the following calls will open it and update the |
229 | size fields */ |
230 | |
231 | @@ -312,7 +302,7 @@ |
232 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
233 | } |
234 | |
235 | -@@ -1910,7 +1937,7 @@ |
236 | +@@ -1929,7 +1956,7 @@ |
237 | mem_free(path); |
238 | } |
239 | |
240 | @@ -321,7 +311,7 @@ |
241 | /********************************************************//** |
242 | Writes a log record about an .ibd file create/rename/delete. */ |
243 | static |
244 | -@@ -2134,7 +2161,7 @@ |
245 | +@@ -2153,7 +2180,7 @@ |
246 | if (fil_create_new_single_table_tablespace( |
247 | space_id, name, FALSE, flags, |
248 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { |
249 | @@ -330,7 +320,7 @@ |
250 | } |
251 | } |
252 | |
253 | -@@ -2297,7 +2324,7 @@ |
254 | +@@ -2317,7 +2344,7 @@ |
255 | } |
256 | |
257 | if (success) { |
258 | @@ -339,16 +329,16 @@ |
259 | /* Write a log record about the deletion of the .ibd |
260 | file, so that ibbackup can replay it in the |
261 | --apply-log phase. We use a dummy mtr and the familiar |
262 | -@@ -2598,7 +2625,7 @@ |
263 | +@@ -2618,7 +2645,7 @@ |
264 | |
265 | mutex_exit(&fil_system->mutex); |
266 | |
267 | -#ifndef UNIV_HOTBACKUP |
268 | +#ifdef UNDEFINED |
269 | - if (success) { |
270 | + if (success && !recv_recovery_on) { |
271 | mtr_t mtr; |
272 | |
273 | -@@ -2788,7 +2815,7 @@ |
274 | +@@ -2808,7 +2835,7 @@ |
275 | |
276 | fil_node_create(path, size, space_id, FALSE); |
277 | |
278 | @@ -357,7 +347,7 @@ |
279 | { |
280 | mtr_t mtr; |
281 | |
282 | -@@ -3041,19 +3068,97 @@ |
283 | +@@ -3061,19 +3088,97 @@ |
284 | "InnoDB: open the tablespace file ", stderr); |
285 | ut_print_filename(stderr, filepath); |
286 | fputs("!\n" |
287 | @@ -465,7 +455,7 @@ |
288 | return(FALSE); |
289 | } |
290 | |
291 | -@@ -3284,7 +3389,7 @@ |
292 | +@@ -3304,7 +3409,7 @@ |
293 | cannot be ok. */ |
294 | |
295 | size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low; |
296 | @@ -474,7 +464,7 @@ |
297 | if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) { |
298 | fprintf(stderr, |
299 | "InnoDB: Error: the size of single-table tablespace" |
300 | -@@ -3414,7 +3519,51 @@ |
301 | +@@ -3434,7 +3539,51 @@ |
302 | |
303 | fil_node_create(filepath, 0, space_id, FALSE); |
304 | func_exit: |
305 | @@ -527,7 +517,7 @@ |
306 | ut_free(buf2); |
307 | mem_free(filepath); |
308 | } |
309 | -@@ -3425,7 +3574,7 @@ |
310 | +@@ -3445,7 +3594,7 @@ |
311 | idea is to read as much good data as we can and jump over bad data. |
312 | @return 0 if ok, -1 if error even after the retries, 1 if at the end |
313 | of the directory */ |
314 | @@ -536,7 +526,7 @@ |
315 | int |
316 | fil_file_readdir_next_file( |
317 | /*=======================*/ |
318 | -@@ -3469,7 +3618,7 @@ |
319 | +@@ -3489,7 +3638,7 @@ |
320 | @return DB_SUCCESS or error number */ |
321 | UNIV_INTERN |
322 | ulint |
323 | @@ -545,7 +535,7 @@ |
324 | /*===================================*/ |
325 | { |
326 | int ret; |
327 | -@@ -3525,7 +3674,9 @@ |
328 | +@@ -3545,7 +3694,9 @@ |
329 | dbinfo.name); |
330 | srv_normalize_path_for_win(dbpath); |
331 | |
332 | @@ -556,7 +546,7 @@ |
333 | |
334 | if (dbdir != NULL) { |
335 | /* printf("Opened dir %s\n", dbinfo.name); */ |
336 | -@@ -3551,8 +3702,11 @@ |
337 | +@@ -3571,8 +3722,11 @@ |
338 | ".ibd")) { |
339 | /* The name ends in .ibd; try opening |
340 | the file */ |
341 | @@ -569,7 +559,7 @@ |
342 | } |
343 | next_file_item: |
344 | ret = fil_file_readdir_next_file(&err, |
345 | -@@ -3724,15 +3878,97 @@ |
346 | +@@ -3744,15 +3898,97 @@ |
347 | "InnoDB: in InnoDB data dictionary" |
348 | " has tablespace id %lu,\n" |
349 | "InnoDB: but tablespace with that id" |
350 | @@ -675,7 +665,7 @@ |
351 | } else { |
352 | ut_print_timestamp(stderr); |
353 | fputs(" InnoDB: Error: table ", stderr); |
354 | -@@ -4121,7 +4357,7 @@ |
355 | +@@ -4141,7 +4377,7 @@ |
356 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
357 | mutex. */ |
358 | static |
359 | @@ -684,7 +674,7 @@ |
360 | fil_node_prepare_for_io( |
361 | /*====================*/ |
362 | fil_node_t* node, /*!< in: file node */ |
363 | -@@ -4141,10 +4377,13 @@ |
364 | +@@ -4161,10 +4397,13 @@ |
365 | } |
366 | |
367 | if (node->open == FALSE) { |
368 | @@ -699,7 +689,7 @@ |
369 | } |
370 | |
371 | if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE |
372 | -@@ -4157,6 +4396,8 @@ |
373 | +@@ -4177,6 +4416,8 @@ |
374 | } |
375 | |
376 | node->n_pending++; |
377 | @@ -708,7 +698,7 @@ |
378 | } |
379 | |
380 | /********************************************************************//** |
381 | -@@ -4292,7 +4533,9 @@ |
382 | +@@ -4312,7 +4553,9 @@ |
383 | ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE) |
384 | || !ibuf_bitmap_page(zip_size, block_offset) |
385 | || sync || is_log); |
386 | @@ -719,7 +709,7 @@ |
387 | || ibuf_page(space_id, zip_size, block_offset, NULL)); |
388 | # endif /* UNIV_LOG_DEBUG */ |
389 | if (sync) { |
390 | -@@ -4341,6 +4584,16 @@ |
391 | +@@ -4361,6 +4604,16 @@ |
392 | |
393 | ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE)); |
394 | |
395 | @@ -736,6 +726,26 @@ |
396 | node = UT_LIST_GET_FIRST(space->chain); |
397 | |
398 | for (;;) { |
399 | +@@ -4869,6 +5122,12 @@ |
400 | + const char* tmp_name) /*!< in: temp table name used while |
401 | + swapping */ |
402 | + { |
403 | ++ (void)old_space_id; |
404 | ++ (void)old_name; |
405 | ++ (void)new_space_id; |
406 | ++ (void)new_name; |
407 | ++ (void)tmp_name; |
408 | ++#ifdef UNDEFINED |
409 | + mtr_t mtr; |
410 | + mtr_start(&mtr); |
411 | + fil_op_write_log(MLOG_FILE_RENAME, old_space_id, |
412 | +@@ -4876,5 +5135,6 @@ |
413 | + fil_op_write_log(MLOG_FILE_RENAME, new_space_id, |
414 | + 0, 0, new_name, old_name, &mtr); |
415 | + mtr_commit(&mtr); |
416 | ++#endif |
417 | + } |
418 | + |
419 | --- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c |
420 | +++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c |
421 | @@ -1061,6 +1061,9 @@ |
422 | @@ -748,7 +758,7 @@ |
423 | if (ibuf_fixed_addr_page(space, zip_size, page_no)) { |
424 | |
425 | return(TRUE); |
426 | -@@ -2277,6 +2280,9 @@ |
427 | +@@ -2275,6 +2278,9 @@ |
428 | ulint n_bytes; |
429 | ulint n_pag2; |
430 | |
431 | @@ -760,7 +770,7 @@ |
432 | |
433 | --- a/storage/innodb_plugin/include/fil0fil.h |
434 | +++ b/storage/innodb_plugin/include/fil0fil.h |
435 | -@@ -504,7 +504,7 @@ |
436 | +@@ -505,7 +505,7 @@ |
437 | @return DB_SUCCESS or error number */ |
438 | UNIV_INTERN |
439 | ulint |
440 | @@ -771,7 +781,7 @@ |
441 | Returns TRUE if a single-table tablespace does not exist in the memory cache, |
442 | --- a/storage/innodb_plugin/include/mem0mem.ic |
443 | +++ b/storage/innodb_plugin/include/mem0mem.ic |
444 | -@@ -367,7 +367,7 @@ |
445 | +@@ -363,7 +363,7 @@ |
446 | buf = (byte*)buf + MEM_FIELD_HEADER_SIZE; |
447 | |
448 | /* Check that the field lengths agree */ |
449 | @@ -782,7 +792,7 @@ |
450 | return(buf); |
451 | --- a/storage/innodb_plugin/include/mtr0mtr.ic |
452 | +++ b/storage/innodb_plugin/include/mtr0mtr.ic |
453 | -@@ -160,7 +160,7 @@ |
454 | +@@ -161,7 +161,7 @@ |
455 | while (offset > 0) { |
456 | offset -= sizeof(mtr_memo_slot_t); |
457 | |
458 | @@ -989,7 +999,7 @@ |
459 | ibool |
460 | log_block_checksum_is_ok_or_old_format( |
461 | /*===================================*/ |
462 | -@@ -1486,6 +1487,7 @@ |
463 | +@@ -1492,6 +1493,7 @@ |
464 | buf_block_get_page_no(block)); |
465 | |
466 | if ((recv_addr == NULL) |
467 | @@ -997,7 +1007,7 @@ |
468 | || (recv_addr->state == RECV_BEING_PROCESSED) |
469 | || (recv_addr->state == RECV_PROCESSED)) { |
470 | |
471 | -@@ -1575,9 +1577,16 @@ |
472 | +@@ -1581,9 +1583,16 @@ |
473 | if (page_zip) { |
474 | memset(FIL_PAGE_LSN + page_zip->data, 0, 8); |
475 | } |
476 | @@ -1015,7 +1025,7 @@ |
477 | |
478 | ib_uint64_t end_lsn; |
479 | |
480 | -@@ -1762,6 +1771,18 @@ |
481 | +@@ -1769,6 +1778,18 @@ |
482 | ulint zip_size = fil_space_get_zip_size(space); |
483 | ulint page_no = recv_addr->page_no; |
484 | |
485 | @@ -1034,7 +1044,7 @@ |
486 | if (recv_addr->state == RECV_NOT_PROCESSED) { |
487 | if (!has_printed) { |
488 | ut_print_timestamp(stderr); |
489 | -@@ -1795,7 +1816,7 @@ |
490 | +@@ -1802,7 +1823,7 @@ |
491 | |
492 | mutex_enter(&(recv_sys->mutex)); |
493 | } |
494 | @@ -1043,7 +1053,7 @@ |
495 | recv_addr = HASH_GET_NEXT(addr_hash, recv_addr); |
496 | } |
497 | |
498 | -@@ -2297,7 +2318,7 @@ |
499 | +@@ -2304,7 +2325,7 @@ |
500 | || type == MLOG_FILE_RENAME |
501 | || type == MLOG_FILE_DELETE) { |
502 | ut_a(space); |
503 | @@ -1052,7 +1062,7 @@ |
504 | if (recv_replay_file_ops) { |
505 | |
506 | /* In ibbackup --apply-log, replay an .ibd file |
507 | -@@ -2320,7 +2341,7 @@ |
508 | +@@ -2327,7 +2348,7 @@ |
509 | ut_error; |
510 | } |
511 | } |
512 | @@ -1061,7 +1071,7 @@ |
513 | /* In normal mysqld crash recovery we do not try to |
514 | replay file operations */ |
515 | #ifdef UNIV_LOG_LSN_DEBUG |
516 | -@@ -2737,8 +2758,11 @@ |
517 | +@@ -2744,8 +2765,11 @@ |
518 | |
519 | fprintf(stderr, |
520 | "InnoDB: Doing recovery: scanned up to" |
521 | @@ -1075,7 +1085,7 @@ |
522 | } |
523 | } |
524 | |
525 | -@@ -2841,7 +2865,7 @@ |
526 | +@@ -2848,7 +2872,7 @@ |
527 | "InnoDB: Reading tablespace information" |
528 | " from the .ibd files...\n"); |
529 | |
530 | @@ -1084,7 +1094,7 @@ |
531 | |
532 | /* If we are using the doublewrite method, we will |
533 | check if there are half-written pages in data files, |
534 | -@@ -2850,12 +2874,14 @@ |
535 | +@@ -2857,12 +2881,14 @@ |
536 | |
537 | if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) { |
538 | |
539 | @@ -1100,7 +1110,7 @@ |
540 | } |
541 | } |
542 | |
543 | -@@ -3005,6 +3031,7 @@ |
544 | +@@ -3012,6 +3038,7 @@ |
545 | recv_sys->recovered_lsn = checkpoint_lsn; |
546 | |
547 | srv_start_lsn = checkpoint_lsn; |
548 | @@ -1108,7 +1118,7 @@ |
549 | } |
550 | |
551 | contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn, |
552 | -@@ -3286,6 +3313,7 @@ |
553 | +@@ -3293,6 +3320,7 @@ |
554 | that the data dictionary tables will be free of any locks. |
555 | The data dictionary latch should guarantee that there is at |
556 | most one data dictionary transaction active at a time. */ |
557 | @@ -1127,7 +1137,7 @@ |
558 | #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__) |
559 | /* InnoDB Hot Backup does not lock the data files. |
560 | * On Windows, mandatory locking is used. |
561 | -@@ -1316,8 +1316,9 @@ |
562 | +@@ -1324,8 +1324,9 @@ |
563 | attributes = 0; |
564 | ut_error; |
565 | } |
566 | @@ -1138,7 +1148,7 @@ |
567 | GENERIC_READ | GENERIC_WRITE, /* read and write |
568 | access */ |
569 | share_mode, /* File can be read also by other |
570 | -@@ -1376,7 +1377,11 @@ |
571 | +@@ -1391,7 +1392,11 @@ |
572 | if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW |
573 | || create_mode == OS_FILE_OPEN_RETRY) { |
574 | mode_str = "OPEN"; |
575 | @@ -1151,7 +1161,7 @@ |
576 | } else if (create_mode == OS_FILE_CREATE) { |
577 | mode_str = "CREATE"; |
578 | create_flag = O_RDWR | O_CREAT | O_EXCL; |
579 | -@@ -2545,6 +2550,9 @@ |
580 | +@@ -2560,6 +2565,9 @@ |
581 | ut_a((offset & 0xFFFFFFFFUL) == offset); |
582 | ut_a((n & 0xFFFFFFFFUL) == n); |
583 | |
584 | @@ -1161,7 +1171,7 @@ |
585 | os_n_file_writes++; |
586 | |
587 | ut_ad(file); |
588 | -@@ -2669,6 +2677,9 @@ |
589 | +@@ -2684,6 +2692,9 @@ |
590 | #else |
591 | ssize_t ret; |
592 | |
593 | @@ -1193,7 +1203,7 @@ |
594 | |
595 | --- a/storage/innodb_plugin/srv/srv0srv.c |
596 | +++ b/storage/innodb_plugin/srv/srv0srv.c |
597 | -@@ -374,6 +374,10 @@ |
598 | +@@ -383,6 +383,10 @@ |
599 | |
600 | UNIV_INTERN ulong srv_replication_delay = 0; |
601 | |
602 | @@ -1204,7 +1214,7 @@ |
603 | /*-------------------------------------------*/ |
604 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; |
605 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; |
606 | -@@ -1002,7 +1006,7 @@ |
607 | +@@ -1011,7 +1015,7 @@ |
608 | } |
609 | |
610 | /* Initialize some INFORMATION SCHEMA internal structures */ |
611 | @@ -1213,7 +1223,7 @@ |
612 | } |
613 | |
614 | /*********************************************************************//** |
615 | -@@ -1013,6 +1017,7 @@ |
616 | +@@ -1022,6 +1026,7 @@ |
617 | /*==========*/ |
618 | { |
619 | os_fast_mutex_free(&srv_conc_mutex); |
620 | @@ -1221,7 +1231,7 @@ |
621 | mem_free(srv_conc_slots); |
622 | srv_conc_slots = NULL; |
623 | |
624 | -@@ -1026,6 +1031,7 @@ |
625 | +@@ -1035,6 +1040,7 @@ |
626 | srv_mysql_table = NULL; |
627 | |
628 | trx_i_s_cache_free(trx_i_s_cache); |
629 | @@ -1334,9 +1344,9 @@ |
630 | srv_was_started = TRUE; |
631 | --- a/storage/innodb_plugin/trx/trx0purge.c |
632 | +++ b/storage/innodb_plugin/trx/trx0purge.c |
633 | -@@ -1087,6 +1087,9 @@ |
634 | +@@ -1093,6 +1093,9 @@ |
635 | /* que_thr_t* thr2; */ |
636 | - ulint old_pages_handled; |
637 | + ulonglong old_pages_handled; |
638 | |
639 | + if (srv_fake_write) |
640 | + return(0); |
641 | @@ -1360,7 +1370,7 @@ |
642 | |
643 | --- a/storage/innodb_plugin/trx/trx0sys.c |
644 | +++ b/storage/innodb_plugin/trx/trx0sys.c |
645 | -@@ -1586,12 +1586,14 @@ |
646 | +@@ -1583,12 +1583,14 @@ |
647 | mem_free(trx_doublewrite); |
648 | trx_doublewrite = NULL; |
649 | |
650 | @@ -1375,7 +1385,7 @@ |
651 | |
652 | /* There can't be any active transactions. */ |
653 | rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list); |
654 | -@@ -1617,10 +1619,12 @@ |
655 | +@@ -1614,10 +1616,12 @@ |
656 | UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view); |
657 | } |
658 | |
659 | @@ -1425,9 +1435,9 @@ |
660 | |
661 | /* |
662 | WAIT ARRAY |
663 | -@@ -927,6 +928,13 @@ |
664 | - ibool fatal = FALSE; |
665 | - double longest_diff = 0; |
666 | +@@ -932,6 +933,13 @@ |
667 | + return(FALSE); |
668 | + } |
669 | |
670 | + if (srv_rebuild_indexes) { |
671 | + |
672 | @@ -1436,12 +1446,12 @@ |
673 | + return(FALSE); |
674 | + } |
675 | + |
676 | + sync_array_enter(sync_primary_wait_array); |
677 | + |
678 | for (i = 0; i < sync_primary_wait_array->n_cells; i++) { |
679 | - |
680 | - double diff; |
681 | --- a/storage/innodb_plugin/include/buf0buf.h |
682 | +++ b/storage/innodb_plugin/include/buf0buf.h |
683 | -@@ -1191,6 +1191,8 @@ |
684 | +@@ -1270,6 +1270,8 @@ |
685 | frees a page in buffer pool */ |
686 | # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ |
687 | #endif /* !UNIV_HOTBACKUP */ |
688 | @@ -1493,14 +1503,3 @@ |
689 | |
690 | UNIV_MEM_FREE(buf, n); |
691 | } |
692 | ---- a/configure.in |
693 | -+++ b/configure.in |
694 | -@@ -22,7 +22,7 @@ |
695 | - AM_INIT_AUTOMAKE([1.9 tar-ustar]) |
696 | - AC_PROG_LIBTOOL |
697 | - |
698 | --AM_CONFIG_HEADER([include/config.h]) |
699 | -+AC_CONFIG_HEADERS([include/config.h]) |
700 | - |
701 | - # Request support for automake silent-rules if available. |
702 | - # Default to verbose output. One can use the configure-time |
703 | |
704 | === modified file 'patches/innodb55.patch' |
705 | --- patches/innodb55.patch 2013-05-07 13:32:47 +0000 |
706 | +++ patches/innodb55.patch 2013-07-22 14:01:36 +0000 |
707 | @@ -1,6 +1,6 @@ |
708 | --- a/storage/innobase/btr/btr0btr.c |
709 | +++ b/storage/innobase/btr/btr0btr.c |
710 | -@@ -674,7 +674,7 @@ |
711 | +@@ -698,7 +698,7 @@ |
712 | /**************************************************************//** |
713 | Gets the root node of a tree and x-latches it. |
714 | @return root page, x-latched */ |
715 | @@ -9,7 +9,7 @@ |
716 | buf_block_t* |
717 | btr_root_block_get( |
718 | /*===============*/ |
719 | -@@ -1123,7 +1123,7 @@ |
720 | +@@ -1183,7 +1183,7 @@ |
721 | /************************************************************//** |
722 | Returns the child page of a node pointer and x-latches it. |
723 | @return child page, x-latched */ |
724 | @@ -28,7 +28,7 @@ |
725 | |
726 | /* |
727 | IMPLEMENTATION OF THE BUFFER POOL |
728 | -@@ -518,7 +519,7 @@ |
729 | +@@ -538,7 +539,7 @@ |
730 | return(TRUE); |
731 | } |
732 | |
733 | @@ -37,7 +37,7 @@ |
734 | if (recv_lsn_checks_on) { |
735 | ib_uint64_t current_lsn; |
736 | |
737 | -@@ -881,6 +882,7 @@ |
738 | +@@ -918,6 +919,7 @@ |
739 | block->page.in_flush_list = FALSE; |
740 | block->page.in_free_list = FALSE; |
741 | block->page.in_LRU_list = FALSE; |
742 | @@ -45,7 +45,7 @@ |
743 | block->in_unzip_LRU_list = FALSE; |
744 | #endif /* UNIV_DEBUG */ |
745 | #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG |
746 | -@@ -2299,7 +2301,8 @@ |
747 | +@@ -2256,7 +2258,8 @@ |
748 | ut_ad(zip_size == fil_space_get_zip_size(space)); |
749 | ut_ad(ut_is_2pow(zip_size)); |
750 | #ifndef UNIV_LOG_DEBUG |
751 | @@ -55,7 +55,7 @@ |
752 | || ibuf_page_low(space, zip_size, offset, |
753 | FALSE, file, line, NULL)); |
754 | #endif |
755 | -@@ -3567,6 +3570,13 @@ |
756 | +@@ -3535,6 +3538,13 @@ |
757 | frame = ((buf_block_t*) bpage)->frame; |
758 | } |
759 | |
760 | @@ -69,7 +69,7 @@ |
761 | /* If this page is not uninitialized and not in the |
762 | doublewrite buffer, then the page number and space id |
763 | should be the same as in block. */ |
764 | -@@ -3668,7 +3678,8 @@ |
765 | +@@ -3637,7 +3647,8 @@ |
766 | recv_recover_page(TRUE, (buf_block_t*) bpage); |
767 | } |
768 | |
769 | @@ -81,7 +81,7 @@ |
770 | bpage->offset, buf_page_get_zip_size(bpage), |
771 | --- a/storage/innobase/buf/buf0rea.c |
772 | +++ b/storage/innobase/buf/buf0rea.c |
773 | -@@ -124,6 +124,45 @@ |
774 | +@@ -162,6 +162,45 @@ |
775 | bpage = buf_page_init_for_read(err, mode, space, zip_size, unzip, |
776 | tablespace_version, offset); |
777 | if (bpage == NULL) { |
778 | @@ -127,7 +127,7 @@ |
779 | |
780 | return(0); |
781 | } |
782 | -@@ -768,6 +807,50 @@ |
783 | +@@ -820,6 +859,50 @@ |
784 | /* It is a single table tablespace and the .ibd file is |
785 | missing: do nothing */ |
786 | |
787 | @@ -189,7 +189,7 @@ |
788 | #ifndef UNIV_HOTBACKUP |
789 | # include "buf0lru.h" |
790 | # include "ibuf0ibuf.h" |
791 | -@@ -297,7 +299,7 @@ |
792 | +@@ -300,7 +302,7 @@ |
793 | |
794 | /** The tablespace memory cache. This variable is NULL before the module is |
795 | initialized. */ |
796 | @@ -198,7 +198,7 @@ |
797 | |
798 | #ifdef UNIV_DEBUG |
799 | /** Try fil_validate() every this many times */ |
800 | -@@ -336,7 +338,7 @@ |
801 | +@@ -339,7 +341,7 @@ |
802 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
803 | mutex. */ |
804 | static |
805 | @@ -207,7 +207,7 @@ |
806 | fil_node_prepare_for_io( |
807 | /*====================*/ |
808 | fil_node_t* node, /*!< in: file node */ |
809 | -@@ -661,7 +663,7 @@ |
810 | +@@ -664,7 +666,7 @@ |
811 | Opens a the file of a node of a tablespace. The caller must own the fil_system |
812 | mutex. */ |
813 | static |
814 | @@ -216,7 +216,7 @@ |
815 | fil_node_open_file( |
816 | /*===============*/ |
817 | fil_node_t* node, /*!< in: file node */ |
818 | -@@ -696,7 +698,17 @@ |
819 | +@@ -699,7 +701,17 @@ |
820 | OS_FILE_READ_ONLY, &success); |
821 | if (!success) { |
822 | /* The following call prints an error message */ |
823 | @@ -235,7 +235,7 @@ |
824 | |
825 | ut_print_timestamp(stderr); |
826 | |
827 | -@@ -757,12 +769,15 @@ |
828 | +@@ -760,12 +772,15 @@ |
829 | |
830 | if (UNIV_UNLIKELY(space_id != space->id)) { |
831 | fprintf(stderr, |
832 | @@ -254,7 +254,7 @@ |
833 | } |
834 | |
835 | if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED |
836 | -@@ -786,8 +801,8 @@ |
837 | +@@ -789,8 +804,8 @@ |
838 | } |
839 | |
840 | if (size_bytes >= 1024 * 1024) { |
841 | @@ -265,7 +265,7 @@ |
842 | } |
843 | |
844 | if (!(flags & DICT_TF_ZSSIZE_MASK)) { |
845 | -@@ -838,6 +853,8 @@ |
846 | +@@ -841,6 +856,8 @@ |
847 | /* Put the node to the LRU list */ |
848 | UT_LIST_ADD_FIRST(LRU, system->LRU, node); |
849 | } |
850 | @@ -274,7 +274,7 @@ |
851 | } |
852 | |
853 | /**********************************************************************//** |
854 | -@@ -1464,7 +1481,12 @@ |
855 | +@@ -1504,7 +1521,12 @@ |
856 | the file yet; the following calls will open it and update the |
857 | size fields */ |
858 | |
859 | @@ -288,7 +288,7 @@ |
860 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
861 | } |
862 | |
863 | -@@ -1516,7 +1538,12 @@ |
864 | +@@ -1573,7 +1595,12 @@ |
865 | the file yet; the following calls will open it and update the |
866 | size fields */ |
867 | |
868 | @@ -302,7 +302,7 @@ |
869 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
870 | } |
871 | |
872 | -@@ -1957,7 +1984,7 @@ |
873 | +@@ -2021,7 +2048,7 @@ |
874 | mem_free(path); |
875 | } |
876 | |
877 | @@ -311,7 +311,7 @@ |
878 | /********************************************************//** |
879 | Writes a log record about an .ibd file create/rename/delete. */ |
880 | static |
881 | -@@ -2181,7 +2208,7 @@ |
882 | +@@ -2245,7 +2272,7 @@ |
883 | if (fil_create_new_single_table_tablespace( |
884 | space_id, name, FALSE, flags, |
885 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { |
886 | @@ -320,7 +320,7 @@ |
887 | } |
888 | } |
889 | |
890 | -@@ -2344,7 +2371,7 @@ |
891 | +@@ -2434,7 +2461,7 @@ |
892 | } |
893 | |
894 | if (success) { |
895 | @@ -329,16 +329,16 @@ |
896 | /* Write a log record about the deletion of the .ibd |
897 | file, so that ibbackup can replay it in the |
898 | --apply-log phase. We use a dummy mtr and the familiar |
899 | -@@ -2645,7 +2672,7 @@ |
900 | +@@ -2735,7 +2762,7 @@ |
901 | |
902 | mutex_exit(&fil_system->mutex); |
903 | |
904 | -#ifndef UNIV_HOTBACKUP |
905 | +#ifdef UNDEFINED |
906 | - if (success) { |
907 | + if (success && !recv_recovery_on) { |
908 | mtr_t mtr; |
909 | |
910 | -@@ -2836,7 +2863,7 @@ |
911 | +@@ -2926,7 +2953,7 @@ |
912 | |
913 | fil_node_create(path, size, space_id, FALSE); |
914 | |
915 | @@ -347,7 +347,7 @@ |
916 | { |
917 | mtr_t mtr; |
918 | |
919 | -@@ -3091,19 +3118,97 @@ |
920 | +@@ -3181,19 +3208,97 @@ |
921 | "InnoDB: open the tablespace file ", stderr); |
922 | ut_print_filename(stderr, filepath); |
923 | fputs("!\n" |
924 | @@ -455,7 +455,7 @@ |
925 | return(FALSE); |
926 | } |
927 | |
928 | -@@ -3335,7 +3440,7 @@ |
929 | +@@ -3425,7 +3530,7 @@ |
930 | cannot be ok. */ |
931 | |
932 | size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low; |
933 | @@ -464,7 +464,7 @@ |
934 | if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) { |
935 | fprintf(stderr, |
936 | "InnoDB: Error: the size of single-table tablespace" |
937 | -@@ -3465,7 +3570,51 @@ |
938 | +@@ -3555,7 +3660,51 @@ |
939 | |
940 | fil_node_create(filepath, 0, space_id, FALSE); |
941 | func_exit: |
942 | @@ -517,7 +517,7 @@ |
943 | ut_free(buf2); |
944 | mem_free(filepath); |
945 | } |
946 | -@@ -3476,7 +3625,7 @@ |
947 | +@@ -3566,7 +3715,7 @@ |
948 | idea is to read as much good data as we can and jump over bad data. |
949 | @return 0 if ok, -1 if error even after the retries, 1 if at the end |
950 | of the directory */ |
951 | @@ -526,7 +526,7 @@ |
952 | int |
953 | fil_file_readdir_next_file( |
954 | /*=======================*/ |
955 | -@@ -3520,7 +3669,7 @@ |
956 | +@@ -3610,7 +3759,7 @@ |
957 | @return DB_SUCCESS or error number */ |
958 | UNIV_INTERN |
959 | ulint |
960 | @@ -535,7 +535,7 @@ |
961 | /*===================================*/ |
962 | { |
963 | int ret; |
964 | -@@ -3576,7 +3725,9 @@ |
965 | +@@ -3666,7 +3815,9 @@ |
966 | dbinfo.name); |
967 | srv_normalize_path_for_win(dbpath); |
968 | |
969 | @@ -546,7 +546,7 @@ |
970 | |
971 | if (dbdir != NULL) { |
972 | /* printf("Opened dir %s\n", dbinfo.name); */ |
973 | -@@ -3602,8 +3753,11 @@ |
974 | +@@ -3692,8 +3843,11 @@ |
975 | ".ibd")) { |
976 | /* The name ends in .ibd; try opening |
977 | the file */ |
978 | @@ -559,7 +559,7 @@ |
979 | } |
980 | next_file_item: |
981 | ret = fil_file_readdir_next_file(&err, |
982 | -@@ -3775,15 +3929,97 @@ |
983 | +@@ -3865,15 +4019,97 @@ |
984 | "InnoDB: in InnoDB data dictionary" |
985 | " has tablespace id %lu,\n" |
986 | "InnoDB: but tablespace with that id" |
987 | @@ -665,7 +665,7 @@ |
988 | } else { |
989 | ut_print_timestamp(stderr); |
990 | fputs(" InnoDB: Error: table ", stderr); |
991 | -@@ -4172,7 +4408,7 @@ |
992 | +@@ -4262,7 +4498,7 @@ |
993 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
994 | mutex. */ |
995 | static |
996 | @@ -674,7 +674,7 @@ |
997 | fil_node_prepare_for_io( |
998 | /*====================*/ |
999 | fil_node_t* node, /*!< in: file node */ |
1000 | -@@ -4192,10 +4428,13 @@ |
1001 | +@@ -4282,10 +4518,13 @@ |
1002 | } |
1003 | |
1004 | if (node->open == FALSE) { |
1005 | @@ -689,7 +689,7 @@ |
1006 | } |
1007 | |
1008 | if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE |
1009 | -@@ -4208,6 +4447,8 @@ |
1010 | +@@ -4298,6 +4537,8 @@ |
1011 | } |
1012 | |
1013 | node->n_pending++; |
1014 | @@ -698,7 +698,7 @@ |
1015 | } |
1016 | |
1017 | /********************************************************************//** |
1018 | -@@ -4390,6 +4631,16 @@ |
1019 | +@@ -4482,6 +4723,16 @@ |
1020 | |
1021 | ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE)); |
1022 | |
1023 | @@ -715,9 +715,29 @@ |
1024 | node = UT_LIST_GET_FIRST(space->chain); |
1025 | |
1026 | for (;;) { |
1027 | +@@ -4997,6 +5248,12 @@ |
1028 | + const char* tmp_name) /*!< in: temp table name used while |
1029 | + swapping */ |
1030 | + { |
1031 | ++ (void)old_space_id; |
1032 | ++ (void)old_name; |
1033 | ++ (void)new_space_id; |
1034 | ++ (void)new_name; |
1035 | ++ (void)tmp_name; |
1036 | ++#ifdef UNDEFINED |
1037 | + mtr_t mtr; |
1038 | + mtr_start(&mtr); |
1039 | + fil_op_write_log(MLOG_FILE_RENAME, old_space_id, |
1040 | +@@ -5004,5 +5261,6 @@ |
1041 | + fil_op_write_log(MLOG_FILE_RENAME, new_space_id, |
1042 | + 0, 0, new_name, old_name, &mtr); |
1043 | + mtr_commit(&mtr); |
1044 | ++#endif |
1045 | + } |
1046 | + |
1047 | --- a/storage/innobase/ibuf/ibuf0ibuf.c |
1048 | +++ b/storage/innobase/ibuf/ibuf0ibuf.c |
1049 | -@@ -1148,6 +1148,9 @@ |
1050 | +@@ -1157,6 +1157,9 @@ |
1051 | ut_ad(!recv_no_ibuf_operations); |
1052 | ut_ad(x_latch || mtr == NULL); |
1053 | |
1054 | @@ -727,7 +747,7 @@ |
1055 | if (ibuf_fixed_addr_page(space, zip_size, page_no)) { |
1056 | |
1057 | return(TRUE); |
1058 | -@@ -2715,6 +2718,9 @@ |
1059 | +@@ -2729,6 +2732,9 @@ |
1060 | ulint n_bytes; |
1061 | ulint n_pag2; |
1062 | |
1063 | @@ -739,7 +759,7 @@ |
1064 | |
1065 | --- a/storage/innobase/include/fil0fil.h |
1066 | +++ b/storage/innobase/include/fil0fil.h |
1067 | -@@ -505,7 +505,7 @@ |
1068 | +@@ -513,7 +513,7 @@ |
1069 | @return DB_SUCCESS or error number */ |
1070 | UNIV_INTERN |
1071 | ulint |
1072 | @@ -803,16 +823,16 @@ |
1073 | |
1074 | if (log_sys->n_pending_checkpoint_writes > 0) { |
1075 | /* A checkpoint write is running */ |
1076 | -@@ -3114,6 +3116,7 @@ |
1077 | +@@ -3141,6 +3143,7 @@ |
1078 | shutdown, because the InnoDB layer may have committed or |
1079 | prepared transactions and we don't want to lose them. */ |
1080 | |
1081 | + if (!srv_apply_log_only) { |
1082 | server_busy = trx_n_mysql_transactions > 0 |
1083 | || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared; |
1084 | - mutex_exit(&kernel_mutex); |
1085 | -@@ -3121,6 +3124,10 @@ |
1086 | - if (server_busy || srv_is_any_background_thread_active()) { |
1087 | + |
1088 | +@@ -3193,6 +3196,10 @@ |
1089 | + |
1090 | goto loop; |
1091 | } |
1092 | + } |
1093 | @@ -902,7 +922,7 @@ |
1094 | ibool |
1095 | log_block_checksum_is_ok_or_old_format( |
1096 | /*===================================*/ |
1097 | -@@ -1496,6 +1497,7 @@ |
1098 | +@@ -1502,6 +1503,7 @@ |
1099 | buf_block_get_page_no(block)); |
1100 | |
1101 | if ((recv_addr == NULL) |
1102 | @@ -910,7 +930,7 @@ |
1103 | || (recv_addr->state == RECV_BEING_PROCESSED) |
1104 | || (recv_addr->state == RECV_PROCESSED)) { |
1105 | |
1106 | -@@ -1585,9 +1587,16 @@ |
1107 | +@@ -1591,9 +1593,16 @@ |
1108 | if (page_zip) { |
1109 | memset(FIL_PAGE_LSN + page_zip->data, 0, 8); |
1110 | } |
1111 | @@ -928,7 +948,7 @@ |
1112 | |
1113 | ib_uint64_t end_lsn; |
1114 | |
1115 | -@@ -1774,6 +1783,18 @@ |
1116 | +@@ -1780,6 +1789,18 @@ |
1117 | ulint zip_size = fil_space_get_zip_size(space); |
1118 | ulint page_no = recv_addr->page_no; |
1119 | |
1120 | @@ -947,7 +967,7 @@ |
1121 | if (recv_addr->state == RECV_NOT_PROCESSED) { |
1122 | if (!has_printed) { |
1123 | ut_print_timestamp(stderr); |
1124 | -@@ -1807,7 +1828,7 @@ |
1125 | +@@ -1813,7 +1834,7 @@ |
1126 | |
1127 | mutex_enter(&(recv_sys->mutex)); |
1128 | } |
1129 | @@ -956,7 +976,7 @@ |
1130 | recv_addr = HASH_GET_NEXT(addr_hash, recv_addr); |
1131 | } |
1132 | |
1133 | -@@ -2308,7 +2329,7 @@ |
1134 | +@@ -2314,7 +2335,7 @@ |
1135 | || type == MLOG_FILE_RENAME |
1136 | || type == MLOG_FILE_DELETE) { |
1137 | ut_a(space); |
1138 | @@ -965,7 +985,7 @@ |
1139 | if (recv_replay_file_ops) { |
1140 | |
1141 | /* In ibbackup --apply-log, replay an .ibd file |
1142 | -@@ -2331,7 +2352,7 @@ |
1143 | +@@ -2337,7 +2358,7 @@ |
1144 | ut_error; |
1145 | } |
1146 | } |
1147 | @@ -974,7 +994,7 @@ |
1148 | /* In normal mysqld crash recovery we do not try to |
1149 | replay file operations */ |
1150 | #ifdef UNIV_LOG_LSN_DEBUG |
1151 | -@@ -2748,8 +2769,11 @@ |
1152 | +@@ -2754,8 +2775,11 @@ |
1153 | |
1154 | fprintf(stderr, |
1155 | "InnoDB: Doing recovery: scanned up to" |
1156 | @@ -988,7 +1008,7 @@ |
1157 | } |
1158 | } |
1159 | |
1160 | -@@ -2854,7 +2878,7 @@ |
1161 | +@@ -2860,7 +2884,7 @@ |
1162 | "InnoDB: Reading tablespace information" |
1163 | " from the .ibd files...\n"); |
1164 | |
1165 | @@ -997,7 +1017,7 @@ |
1166 | |
1167 | /* If we are using the doublewrite method, we will |
1168 | check if there are half-written pages in data files, |
1169 | -@@ -2863,12 +2887,14 @@ |
1170 | +@@ -2869,12 +2893,14 @@ |
1171 | |
1172 | if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) { |
1173 | |
1174 | @@ -1013,7 +1033,7 @@ |
1175 | } |
1176 | } |
1177 | |
1178 | -@@ -3018,6 +3044,7 @@ |
1179 | +@@ -3024,6 +3050,7 @@ |
1180 | recv_sys->recovered_lsn = checkpoint_lsn; |
1181 | |
1182 | srv_start_lsn = checkpoint_lsn; |
1183 | @@ -1021,7 +1041,7 @@ |
1184 | } |
1185 | |
1186 | contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn, |
1187 | -@@ -3299,6 +3326,7 @@ |
1188 | +@@ -3305,6 +3332,7 @@ |
1189 | that the data dictionary tables will be free of any locks. |
1190 | The data dictionary latch should guarantee that there is at |
1191 | most one data dictionary transaction active at a time. */ |
1192 | @@ -1031,7 +1051,7 @@ |
1193 | |
1194 | --- a/storage/innobase/os/os0file.c |
1195 | +++ b/storage/innobase/os/os0file.c |
1196 | -@@ -656,7 +656,7 @@ |
1197 | +@@ -658,7 +658,7 @@ |
1198 | } |
1199 | |
1200 | #undef USE_FILE_LOCK |
1201 | @@ -1040,7 +1060,7 @@ |
1202 | #if defined(UNIV_HOTBACKUP) || defined(__WIN__) |
1203 | /* InnoDB Hot Backup does not lock the data files. |
1204 | * On Windows, mandatory locking is used. |
1205 | -@@ -1456,8 +1456,9 @@ |
1206 | +@@ -1465,8 +1465,9 @@ |
1207 | attributes = 0; |
1208 | ut_error; |
1209 | } |
1210 | @@ -1051,7 +1071,7 @@ |
1211 | GENERIC_READ | GENERIC_WRITE, /* read and write |
1212 | access */ |
1213 | share_mode, /* File can be read also by other |
1214 | -@@ -1516,7 +1517,11 @@ |
1215 | +@@ -1531,7 +1532,11 @@ |
1216 | if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW |
1217 | || create_mode == OS_FILE_OPEN_RETRY) { |
1218 | mode_str = "OPEN"; |
1219 | @@ -1064,7 +1084,7 @@ |
1220 | } else if (create_mode == OS_FILE_CREATE) { |
1221 | mode_str = "CREATE"; |
1222 | create_flag = O_RDWR | O_CREAT | O_EXCL; |
1223 | -@@ -2694,6 +2699,9 @@ |
1224 | +@@ -2709,6 +2714,9 @@ |
1225 | ut_a((offset & 0xFFFFFFFFUL) == offset); |
1226 | ut_a((n & 0xFFFFFFFFUL) == n); |
1227 | |
1228 | @@ -1074,7 +1094,7 @@ |
1229 | os_n_file_writes++; |
1230 | |
1231 | ut_ad(file); |
1232 | -@@ -2818,6 +2826,9 @@ |
1233 | +@@ -2833,6 +2841,9 @@ |
1234 | #else |
1235 | ssize_t ret; |
1236 | |
1237 | @@ -1105,7 +1125,7 @@ |
1238 | } |
1239 | --- a/storage/innobase/srv/srv0srv.c |
1240 | +++ b/storage/innobase/srv/srv0srv.c |
1241 | -@@ -399,6 +399,10 @@ |
1242 | +@@ -405,6 +405,10 @@ |
1243 | |
1244 | UNIV_INTERN ulong srv_replication_delay = 0; |
1245 | |
1246 | @@ -1116,7 +1136,7 @@ |
1247 | /*-------------------------------------------*/ |
1248 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; |
1249 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; |
1250 | -@@ -1078,7 +1082,7 @@ |
1251 | +@@ -1084,7 +1088,7 @@ |
1252 | } |
1253 | |
1254 | /* Initialize some INFORMATION SCHEMA internal structures */ |
1255 | @@ -1125,7 +1145,7 @@ |
1256 | } |
1257 | |
1258 | /*********************************************************************//** |
1259 | -@@ -1089,6 +1093,7 @@ |
1260 | +@@ -1095,6 +1099,7 @@ |
1261 | /*==========*/ |
1262 | { |
1263 | os_fast_mutex_free(&srv_conc_mutex); |
1264 | @@ -1133,7 +1153,7 @@ |
1265 | mem_free(srv_conc_slots); |
1266 | srv_conc_slots = NULL; |
1267 | |
1268 | -@@ -1102,6 +1107,7 @@ |
1269 | +@@ -1108,6 +1113,7 @@ |
1270 | srv_mysql_table = NULL; |
1271 | |
1272 | trx_i_s_cache_free(trx_i_s_cache); |
1273 | @@ -1141,7 +1161,7 @@ |
1274 | } |
1275 | |
1276 | /*********************************************************************//** |
1277 | -@@ -1717,7 +1723,7 @@ |
1278 | +@@ -1727,7 +1733,7 @@ |
1279 | } |
1280 | |
1281 | /* Record the lock wait time for this thread */ |
1282 | @@ -1187,7 +1207,7 @@ |
1283 | ulint |
1284 | open_or_create_data_files( |
1285 | /*======================*/ |
1286 | -@@ -1419,7 +1422,7 @@ |
1287 | +@@ -1448,7 +1451,7 @@ |
1288 | } |
1289 | #endif /* UNIV_LOG_ARCHIVE */ |
1290 | |
1291 | @@ -1196,7 +1216,7 @@ |
1292 | ut_print_timestamp(stderr); |
1293 | fprintf(stderr, |
1294 | " InnoDB: Error: combined size of log files" |
1295 | -@@ -1714,6 +1717,10 @@ |
1296 | +@@ -1743,6 +1746,10 @@ |
1297 | are initialized in trx_sys_init_at_db_start(). */ |
1298 | |
1299 | recv_recovery_from_checkpoint_finish(); |
1300 | @@ -1207,7 +1227,7 @@ |
1301 | if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { |
1302 | /* The following call is necessary for the insert |
1303 | buffer to work with multiple tablespaces. We must |
1304 | -@@ -1873,6 +1880,17 @@ |
1305 | +@@ -1902,6 +1909,17 @@ |
1306 | if (!srv_auto_extend_last_data_file |
1307 | && sum_of_data_file_sizes != tablespace_size_in_header) { |
1308 | |
1309 | @@ -1225,7 +1245,7 @@ |
1310 | ut_print_timestamp(stderr); |
1311 | fprintf(stderr, |
1312 | " InnoDB: Error: tablespace size" |
1313 | -@@ -1952,6 +1970,7 @@ |
1314 | +@@ -1981,6 +1999,7 @@ |
1315 | |
1316 | return(DB_ERROR); |
1317 | } |
1318 | @@ -1233,7 +1253,7 @@ |
1319 | } |
1320 | |
1321 | /* Check that os_fast_mutexes work as expected */ |
1322 | -@@ -1976,6 +1995,10 @@ |
1323 | +@@ -2005,6 +2024,10 @@ |
1324 | |
1325 | os_fast_mutex_free(&srv_os_test_mutex); |
1326 | |
1327 | @@ -1244,7 +1264,7 @@ |
1328 | if (srv_print_verbose_log) { |
1329 | ut_print_timestamp(stderr); |
1330 | fprintf(stderr, |
1331 | -@@ -2064,6 +2087,7 @@ |
1332 | +@@ -2093,6 +2116,7 @@ |
1333 | ibuf_update_max_tablespace_id(); |
1334 | } |
1335 | |
1336 | @@ -1268,7 +1288,7 @@ |
1337 | |
1338 | --- a/storage/innobase/trx/trx0sys.c |
1339 | +++ b/storage/innobase/trx/trx0sys.c |
1340 | -@@ -1655,12 +1655,14 @@ |
1341 | +@@ -1656,12 +1656,14 @@ |
1342 | mem_free(trx_doublewrite); |
1343 | trx_doublewrite = NULL; |
1344 | |
1345 | @@ -1283,7 +1303,7 @@ |
1346 | |
1347 | /* There can't be any active transactions. */ |
1348 | rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list); |
1349 | -@@ -1686,10 +1688,12 @@ |
1350 | +@@ -1687,10 +1689,12 @@ |
1351 | UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view); |
1352 | } |
1353 | |
1354 | @@ -1325,7 +1345,7 @@ |
1355 | "InnoDB: Since" |
1356 | --- a/storage/innobase/trx/trx0purge.c |
1357 | +++ b/storage/innobase/trx/trx0purge.c |
1358 | -@@ -1129,6 +1129,9 @@ |
1359 | +@@ -1141,6 +1141,9 @@ |
1360 | que_thr_t* thr; |
1361 | ulint old_pages_handled; |
1362 | |
1363 | @@ -1335,19 +1355,6 @@ |
1364 | ut_a(purge_sys->trx->n_active_thrs == 0); |
1365 | |
1366 | rw_lock_x_lock(&purge_sys->latch); |
1367 | ---- a/configure.cmake |
1368 | -+++ b/configure.cmake |
1369 | -@@ -149,7 +149,9 @@ |
1370 | - SET(CMAKE_REQUIRED_LIBRARIES |
1371 | - ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT}) |
1372 | - |
1373 | -- LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES) |
1374 | -+ IF(CMAKE_REQUIRED_LIBRARIES) |
1375 | -+ LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES) |
1376 | -+ ENDIF() |
1377 | - LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT}) |
1378 | - |
1379 | - OPTION(WITH_LIBWRAP "Compile with tcp wrappers support" OFF) |
1380 | --- a/storage/innobase/sync/sync0arr.c |
1381 | +++ b/storage/innobase/sync/sync0arr.c |
1382 | @@ -41,6 +41,7 @@ |
1383 | @@ -1358,9 +1365,9 @@ |
1384 | |
1385 | /* |
1386 | WAIT ARRAY |
1387 | -@@ -928,6 +929,13 @@ |
1388 | - ibool fatal = FALSE; |
1389 | - double longest_diff = 0; |
1390 | +@@ -929,6 +930,13 @@ |
1391 | + return(FALSE); |
1392 | + } |
1393 | |
1394 | + if (srv_rebuild_indexes) { |
1395 | + |
1396 | @@ -1374,7 +1381,7 @@ |
1397 | extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that |
1398 | --- a/storage/innobase/include/buf0buf.h |
1399 | +++ b/storage/innobase/include/buf0buf.h |
1400 | -@@ -1441,6 +1441,8 @@ |
1401 | +@@ -1531,6 +1531,8 @@ |
1402 | frees a page in buffer pool */ |
1403 | # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ |
1404 | #endif /* !UNIV_HOTBACKUP */ |
1405 | @@ -1385,7 +1392,7 @@ |
1406 | /** The buffer control block structure */ |
1407 | --- a/storage/innobase/mem/mem0dbg.c |
1408 | +++ b/storage/innobase/mem/mem0dbg.c |
1409 | -@@ -280,18 +280,10 @@ |
1410 | +@@ -282,18 +282,10 @@ |
1411 | byte* buf, /*!< in: pointer to buffer */ |
1412 | ulint n) /*!< in: length of buffer */ |
1413 | { |
1414 | @@ -1406,7 +1413,7 @@ |
1415 | |
1416 | UNIV_MEM_INVALID(buf, n); |
1417 | } |
1418 | -@@ -306,17 +298,10 @@ |
1419 | +@@ -308,17 +300,10 @@ |
1420 | byte* buf, /*!< in: pointer to buffer */ |
1421 | ulint n) /*!< in: length of buffer */ |
1422 | { |
1423 | |
1424 | === modified file 'patches/innodb56.patch' |
1425 | --- patches/innodb56.patch 2013-07-10 12:29:40 +0000 |
1426 | +++ patches/innodb56.patch 2013-07-22 14:01:36 +0000 |
1427 | @@ -52,7 +52,7 @@ |
1428 | block->in_unzip_LRU_list = FALSE; |
1429 | #endif /* UNIV_DEBUG */ |
1430 | #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG |
1431 | -@@ -3951,6 +3959,13 @@ |
1432 | +@@ -3963,6 +3971,13 @@ |
1433 | frame = ((buf_block_t*) bpage)->frame; |
1434 | } |
1435 | |
1436 | @@ -66,7 +66,7 @@ |
1437 | /* If this page is not uninitialized and not in the |
1438 | doublewrite buffer, then the page number and space id |
1439 | should be the same as in block. */ |
1440 | -@@ -4068,7 +4083,7 @@ |
1441 | +@@ -4080,7 +4095,7 @@ |
1442 | recv_recover_page(TRUE, (buf_block_t*) bpage); |
1443 | } |
1444 | |
1445 | @@ -177,7 +177,7 @@ |
1446 | } |
1447 | |
1448 | /**********************************************************************//** |
1449 | -@@ -1491,7 +1510,12 @@ |
1450 | +@@ -1506,7 +1525,12 @@ |
1451 | the file yet; the following calls will open it and update the |
1452 | size fields */ |
1453 | |
1454 | @@ -191,7 +191,7 @@ |
1455 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
1456 | } |
1457 | |
1458 | -@@ -2095,7 +2119,7 @@ |
1459 | +@@ -2109,7 +2133,7 @@ |
1460 | mem_free(path); |
1461 | } |
1462 | |
1463 | @@ -200,7 +200,7 @@ |
1464 | /********************************************************//** |
1465 | Writes a log record about an .ibd file create/rename/delete. */ |
1466 | static |
1467 | -@@ -2329,7 +2353,7 @@ |
1468 | +@@ -2343,7 +2367,7 @@ |
1469 | space_id, name, path, flags, |
1470 | DICT_TF2_USE_TABLESPACE, |
1471 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { |
1472 | @@ -209,7 +209,7 @@ |
1473 | } |
1474 | } |
1475 | |
1476 | -@@ -2687,7 +2711,7 @@ |
1477 | +@@ -2702,7 +2726,7 @@ |
1478 | } |
1479 | |
1480 | if (err == DB_SUCCESS) { |
1481 | @@ -218,7 +218,7 @@ |
1482 | /* Write a log record about the deletion of the .ibd |
1483 | file, so that ibbackup can replay it in the |
1484 | --apply-log phase. We use a dummy mtr and the familiar |
1485 | -@@ -3042,7 +3066,7 @@ |
1486 | +@@ -3057,7 +3081,7 @@ |
1487 | |
1488 | mutex_exit(&fil_system->mutex); |
1489 | |
1490 | @@ -227,7 +227,7 @@ |
1491 | if (success && !recv_recovery_on) { |
1492 | mtr_t mtr; |
1493 | |
1494 | -@@ -3426,7 +3450,7 @@ |
1495 | +@@ -3441,7 +3465,7 @@ |
1496 | goto error_exit_1; |
1497 | } |
1498 | |
1499 | @@ -236,7 +236,7 @@ |
1500 | { |
1501 | mtr_t mtr; |
1502 | ulint mlog_file_flag = 0; |
1503 | -@@ -3504,6 +3528,97 @@ |
1504 | +@@ -3519,6 +3543,97 @@ |
1505 | #endif /* UNIV_LOG_ARCHIVE */ |
1506 | }; |
1507 | |
1508 | @@ -334,7 +334,7 @@ |
1509 | /********************************************************************//** |
1510 | Tries to open a single-table tablespace and optionally checks that the |
1511 | space id in it is correct. If this does not succeed, print an error message |
1512 | -@@ -3569,6 +3684,9 @@ |
1513 | +@@ -3584,6 +3699,9 @@ |
1514 | in the default location. If it is remote, it should not be here. */ |
1515 | def.filepath = fil_make_ibd_name(tablename, false); |
1516 | |
1517 | @@ -344,7 +344,7 @@ |
1518 | /* The path_in was read from SYS_DATAFILES. */ |
1519 | if (path_in) { |
1520 | if (strcmp(def.filepath, path_in)) { |
1521 | -@@ -3616,6 +3734,7 @@ |
1522 | +@@ -3631,6 +3749,7 @@ |
1523 | tablespaces_found++; |
1524 | } |
1525 | } |
1526 | @@ -352,7 +352,7 @@ |
1527 | |
1528 | /* Always look for a file at the default location. */ |
1529 | ut_a(def.filepath); |
1530 | -@@ -3712,11 +3831,15 @@ |
1531 | +@@ -3727,11 +3846,15 @@ |
1532 | /* The following call prints an error message */ |
1533 | os_file_get_last_error(true); |
1534 | |
1535 | @@ -369,7 +369,7 @@ |
1536 | |
1537 | err = DB_CORRUPTION; |
1538 | |
1539 | -@@ -3974,6 +4097,9 @@ |
1540 | +@@ -3989,6 +4112,9 @@ |
1541 | #ifdef UNIV_HOTBACKUP |
1542 | fil_space_t* space; |
1543 | #endif |
1544 | @@ -379,7 +379,7 @@ |
1545 | |
1546 | memset(&def, 0, sizeof(def)); |
1547 | memset(&remote, 0, sizeof(remote)); |
1548 | -@@ -4018,6 +4144,9 @@ |
1549 | +@@ -4033,6 +4159,9 @@ |
1550 | # endif /* !UNIV_HOTBACKUP */ |
1551 | #endif |
1552 | |
1553 | @@ -389,7 +389,7 @@ |
1554 | /* Check for a link file which locates a remote tablespace. */ |
1555 | remote.success = fil_open_linked_file( |
1556 | tablename, &remote.filepath, &remote.file); |
1557 | -@@ -4028,8 +4157,20 @@ |
1558 | +@@ -4043,8 +4172,20 @@ |
1559 | if (!remote.success) { |
1560 | os_file_close(remote.file); |
1561 | mem_free(remote.filepath); |
1562 | @@ -410,7 +410,7 @@ |
1563 | |
1564 | |
1565 | /* Try to open the tablespace in the datadir. */ |
1566 | -@@ -4042,6 +4183,17 @@ |
1567 | +@@ -4057,6 +4198,17 @@ |
1568 | fil_validate_single_table_tablespace(tablename, &def); |
1569 | if (!def.success) { |
1570 | os_file_close(def.file); |
1571 | @@ -428,7 +428,7 @@ |
1572 | } |
1573 | } |
1574 | |
1575 | -@@ -4114,7 +4266,7 @@ |
1576 | +@@ -4129,7 +4281,7 @@ |
1577 | /* At this point, only one tablespace is open */ |
1578 | ut_a(def.success == !remote.success); |
1579 | |
1580 | @@ -437,7 +437,7 @@ |
1581 | |
1582 | /* Get and test the file size. */ |
1583 | size = os_file_get_size(fsp->file); |
1584 | -@@ -4133,9 +4285,9 @@ |
1585 | +@@ -4148,9 +4300,9 @@ |
1586 | |
1587 | /* Every .ibd file is created >= 4 pages in size. Smaller files |
1588 | cannot be ok. */ |
1589 | @@ -449,7 +449,7 @@ |
1590 | ib_logf(IB_LOG_LEVEL_ERROR, |
1591 | "The size of single-table tablespace file %s " |
1592 | "is only " UINT64PF ", should be at least %lu!", |
1593 | -@@ -4216,7 +4368,7 @@ |
1594 | +@@ -4231,7 +4383,7 @@ |
1595 | } |
1596 | mutex_exit(&fil_system->mutex); |
1597 | #endif /* UNIV_HOTBACKUP */ |
1598 | @@ -458,7 +458,7 @@ |
1599 | tablename, fsp->id, fsp->flags, FIL_TABLESPACE); |
1600 | |
1601 | if (!file_space_create_success) { |
1602 | -@@ -4243,13 +4395,55 @@ |
1603 | +@@ -4258,13 +4410,55 @@ |
1604 | } |
1605 | |
1606 | func_exit: |
1607 | @@ -518,7 +518,7 @@ |
1608 | mem_free(tablename); |
1609 | if (remote.success) { |
1610 | mem_free(remote.filepath); |
1611 | -@@ -4263,7 +4457,7 @@ |
1612 | +@@ -4278,7 +4472,7 @@ |
1613 | idea is to read as much good data as we can and jump over bad data. |
1614 | @return 0 if ok, -1 if error even after the retries, 1 if at the end |
1615 | of the directory */ |
1616 | @@ -527,7 +527,7 @@ |
1617 | int |
1618 | fil_file_readdir_next_file( |
1619 | /*=======================*/ |
1620 | -@@ -4303,7 +4497,7 @@ |
1621 | +@@ -4318,7 +4512,7 @@ |
1622 | @return DB_SUCCESS or error number */ |
1623 | UNIV_INTERN |
1624 | dberr_t |
1625 | @@ -536,7 +536,7 @@ |
1626 | /*===================================*/ |
1627 | { |
1628 | int ret; |
1629 | -@@ -4359,7 +4553,9 @@ |
1630 | +@@ -4374,7 +4568,9 @@ |
1631 | "%s/%s", fil_path_to_mysql_datadir, dbinfo.name); |
1632 | srv_normalize_path_for_win(dbpath); |
1633 | |
1634 | @@ -547,7 +547,7 @@ |
1635 | |
1636 | if (dbdir != NULL) { |
1637 | |
1638 | -@@ -4380,9 +4576,15 @@ |
1639 | +@@ -4395,9 +4591,15 @@ |
1640 | && (0 == strcmp(fileinfo.name |
1641 | + strlen(fileinfo.name) - 4, |
1642 | ".ibd") |
1643 | @@ -565,7 +565,7 @@ |
1644 | /* The name ends in .ibd or .isl; |
1645 | try opening the file */ |
1646 | fil_load_single_table_tablespace( |
1647 | -@@ -4538,6 +4740,7 @@ |
1648 | +@@ -4553,6 +4755,7 @@ |
1649 | { |
1650 | fil_space_t* fnamespace; |
1651 | fil_space_t* space; |
1652 | @@ -573,7 +573,7 @@ |
1653 | |
1654 | ut_ad(fil_system); |
1655 | |
1656 | -@@ -4615,6 +4818,10 @@ |
1657 | +@@ -4630,6 +4833,10 @@ |
1658 | if (fnamespace == NULL) { |
1659 | if (print_error_if_does_not_exist) { |
1660 | fil_report_missing_tablespace(name, id); |
1661 | @@ -584,7 +584,7 @@ |
1662 | } |
1663 | } else { |
1664 | ut_print_timestamp(stderr); |
1665 | -@@ -4638,6 +4845,10 @@ |
1666 | +@@ -4653,6 +4860,10 @@ |
1667 | |
1668 | mutex_exit(&fil_system->mutex); |
1669 | |
1670 | @@ -595,7 +595,7 @@ |
1671 | return(FALSE); |
1672 | } |
1673 | |
1674 | -@@ -4728,6 +4939,7 @@ |
1675 | +@@ -4743,6 +4954,7 @@ |
1676 | ulint page_size; |
1677 | ulint pages_added; |
1678 | ibool success; |
1679 | @@ -603,7 +603,7 @@ |
1680 | |
1681 | ut_ad(!srv_read_only_mode); |
1682 | |
1683 | -@@ -4772,13 +4984,17 @@ |
1684 | +@@ -4787,13 +4999,17 @@ |
1685 | goto retry; |
1686 | } |
1687 | |
1688 | @@ -622,7 +622,7 @@ |
1689 | start_page_no = space->size; |
1690 | file_start_page_no = space->size - node->size; |
1691 | |
1692 | -@@ -5024,7 +5240,7 @@ |
1693 | +@@ -5039,7 +5255,7 @@ |
1694 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
1695 | mutex. */ |
1696 | static |
1697 | @@ -631,7 +631,7 @@ |
1698 | fil_node_prepare_for_io( |
1699 | /*====================*/ |
1700 | fil_node_t* node, /*!< in: file node */ |
1701 | -@@ -5044,9 +5260,12 @@ |
1702 | +@@ -5059,9 +5275,12 @@ |
1703 | } |
1704 | |
1705 | if (node->open == FALSE) { |
1706 | @@ -645,7 +645,7 @@ |
1707 | } |
1708 | |
1709 | if (node->n_pending == 0 && fil_space_belongs_in_lru(space)) { |
1710 | -@@ -5058,6 +5277,8 @@ |
1711 | +@@ -5073,6 +5292,8 @@ |
1712 | } |
1713 | |
1714 | node->n_pending++; |
1715 | @@ -654,7 +654,7 @@ |
1716 | } |
1717 | |
1718 | /********************************************************************//** |
1719 | -@@ -5259,6 +5480,16 @@ |
1720 | +@@ -5274,6 +5495,16 @@ |
1721 | |
1722 | ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE); |
1723 | |
1724 | @@ -671,7 +671,7 @@ |
1725 | node = UT_LIST_GET_FIRST(space->chain); |
1726 | |
1727 | for (;;) { |
1728 | -@@ -5290,7 +5521,11 @@ |
1729 | +@@ -5305,7 +5536,11 @@ |
1730 | } |
1731 | |
1732 | /* Open file if closed */ |
1733 | @@ -684,7 +684,7 @@ |
1734 | |
1735 | /* Check that at least the start offset is within the bounds of a |
1736 | single-table tablespace, including rollback tablespaces. */ |
1737 | -@@ -6164,6 +6399,7 @@ |
1738 | +@@ -6179,6 +6414,7 @@ |
1739 | return(err); |
1740 | } |
1741 | |
1742 | @@ -692,11 +692,10 @@ |
1743 | /****************************************************************//** |
1744 | Generate redo logs for swapping two .ibd files */ |
1745 | UNIV_INTERN |
1746 | -@@ -6187,4 +6423,4 @@ |
1747 | - 0, 0, new_name, old_name, &mtr); |
1748 | - mtr_commit(&mtr); |
1749 | +@@ -6205,3 +6441,4 @@ |
1750 | + 0, 0, new_name, old_name, mtr); |
1751 | + } |
1752 | } |
1753 | -- |
1754 | +#endif |
1755 | --- a/storage/innobase/handler/ha_innodb.cc |
1756 | +++ b/storage/innobase/handler/ha_innodb.cc |
1757 | @@ -709,7 +708,7 @@ |
1758 | |
1759 | if (thd && thd_sql_command(thd) == SQLCOM_DROP_TABLE) { |
1760 | |
1761 | -@@ -2423,43 +2423,19 @@ |
1762 | +@@ -2459,43 +2459,19 @@ |
1763 | ulint buflen, /*!< in: length of buf, in bytes */ |
1764 | const char* id, /*!< in: identifier to convert */ |
1765 | ulint idlen, /*!< in: length of id, in bytes */ |
1766 | @@ -758,7 +757,7 @@ |
1767 | if (UNIV_UNLIKELY(idlen > buflen)) { |
1768 | idlen = buflen; |
1769 | } |
1770 | -@@ -16642,45 +16618,24 @@ |
1771 | +@@ -16774,45 +16750,24 @@ |
1772 | void |
1773 | ib_logf( |
1774 | /*====*/ |
1775 | @@ -1022,20 +1021,6 @@ |
1776 | #if defined(UNIV_HOTBACKUP) || defined(__WIN__) |
1777 | /* InnoDB Hot Backup does not lock the data files. |
1778 | * On Windows, mandatory locking is used. |
1779 | ---- a/storage/innobase/row/row0merge.cc |
1780 | -+++ b/storage/innobase/row/row0merge.cc |
1781 | -@@ -3227,9 +3227,11 @@ |
1782 | - goto err_exit; |
1783 | - } |
1784 | - |
1785 | -+#if 0 |
1786 | - /* Generate the redo logs for file operations */ |
1787 | - fil_mtr_rename_log(old_table->space, old_name, |
1788 | - new_table->space, new_table->name, tmp_name); |
1789 | -+#endif |
1790 | - |
1791 | - /* What if the redo logs are flushed to disk here? This is |
1792 | - tested with following crash point */ |
1793 | --- a/storage/innobase/srv/srv0srv.cc |
1794 | +++ b/storage/innobase/srv/srv0srv.cc |
1795 | @@ -349,6 +349,10 @@ |
1796 | @@ -1049,7 +1034,7 @@ |
1797 | /*-------------------------------------------*/ |
1798 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; |
1799 | UNIV_INTERN ulong srv_spin_wait_delay = 6; |
1800 | -@@ -1808,7 +1812,8 @@ |
1801 | +@@ -1814,7 +1818,8 @@ |
1802 | if (ret == SRV_NONE |
1803 | && srv_shutdown_state != SRV_SHUTDOWN_NONE |
1804 | && trx_purge_state() != PURGE_STATE_DISABLED |
1805 | @@ -1173,7 +1158,7 @@ |
1806 | if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { |
1807 | /* The following call is necessary for the insert |
1808 | buffer to work with multiple tablespaces. We must |
1809 | -@@ -2439,7 +2452,9 @@ |
1810 | +@@ -2439,7 +2453,9 @@ |
1811 | value. Important to note that we can do it ONLY after |
1812 | we have finished the recovery process so that the |
1813 | image of TRX_SYS_PAGE_NO is not stale. */ |
1814 | @@ -1184,7 +1169,7 @@ |
1815 | } |
1816 | |
1817 | if (!create_new_db && sum_of_new_sizes > 0) { |
1818 | -@@ -2647,6 +2662,7 @@ |
1819 | +@@ -2647,6 +2663,7 @@ |
1820 | && srv_auto_extend_last_data_file |
1821 | && sum_of_data_file_sizes < tablespace_size_in_header) { |
1822 | |
1823 | @@ -1192,7 +1177,7 @@ |
1824 | ut_print_timestamp(stderr); |
1825 | fprintf(stderr, |
1826 | " InnoDB: Error: tablespace size stored in header" |
1827 | -@@ -2683,6 +2698,7 @@ |
1828 | +@@ -2683,6 +2700,7 @@ |
1829 | |
1830 | return(DB_ERROR); |
1831 | } |
1832 | @@ -1200,7 +1185,7 @@ |
1833 | } |
1834 | |
1835 | /* Check that os_fast_mutexes work as expected */ |
1836 | -@@ -2707,6 +2723,10 @@ |
1837 | +@@ -2707,6 +2725,10 @@ |
1838 | |
1839 | os_fast_mutex_free(&srv_os_test_mutex); |
1840 | |
1841 | @@ -1211,7 +1196,7 @@ |
1842 | if (srv_print_verbose_log) { |
1843 | ib_logf(IB_LOG_LEVEL_INFO, |
1844 | "%s started; log sequence number " LSN_PF "", |
1845 | -@@ -2739,6 +2759,7 @@ |
1846 | +@@ -2739,6 +2761,7 @@ |
1847 | fts_optimize_init(); |
1848 | } |
1849 | |
1850 | @@ -1219,7 +1204,7 @@ |
1851 | srv_was_started = TRUE; |
1852 | |
1853 | return(DB_SUCCESS); |
1854 | -@@ -2794,7 +2815,7 @@ |
1855 | +@@ -2794,7 +2817,7 @@ |
1856 | return(DB_SUCCESS); |
1857 | } |
1858 | |
1859 | @@ -1285,7 +1270,7 @@ |
1860 | total_trx = UT_LIST_GET_LEN(trx_sys->rw_trx_list) |
1861 | --- a/storage/innobase/trx/trx0trx.cc |
1862 | +++ b/storage/innobase/trx/trx0trx.cc |
1863 | -@@ -2053,7 +2053,8 @@ |
1864 | +@@ -2084,7 +2084,8 @@ |
1865 | scenario where some undo generated by a transaction, |
1866 | has XA stuff, and other undo, generated by the same |
1867 | transaction, doesn't. */ |
1868 | @@ -1320,7 +1305,7 @@ |
1869 | |
1870 | /* |
1871 | WAIT ARRAY |
1872 | -@@ -903,6 +904,13 @@ |
1873 | +@@ -899,6 +900,13 @@ |
1874 | ibool fatal = FALSE; |
1875 | double longest_diff = 0; |
1876 | |
1877 | @@ -1336,7 +1321,7 @@ |
1878 | return(FALSE); |
1879 | --- a/storage/innobase/include/buf0buf.h |
1880 | +++ b/storage/innobase/include/buf0buf.h |
1881 | -@@ -1583,6 +1583,8 @@ |
1882 | +@@ -1580,6 +1580,8 @@ |
1883 | or buf_block_t::mutex. */ |
1884 | # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ |
1885 | #endif /* !UNIV_HOTBACKUP */ |
1886 | @@ -1390,7 +1375,7 @@ |
1887 | } |
1888 | --- a/storage/innobase/include/srv0start.h |
1889 | +++ b/storage/innobase/include/srv0start.h |
1890 | -@@ -77,6 +77,23 @@ |
1891 | +@@ -68,6 +68,23 @@ |
1892 | srv_add_path_separator_if_needed( |
1893 | /*=============================*/ |
1894 | char* str); /*!< in: null-terminated character string */ |
1895 | @@ -1416,7 +1401,7 @@ |
1896 | Starts Innobase and creates a new database if database files |
1897 | --- a/configure.cmake |
1898 | +++ b/configure.cmake |
1899 | -@@ -965,14 +965,6 @@ |
1900 | +@@ -979,14 +979,6 @@ |
1901 | ENDIF() |
1902 | |
1903 | CHECK_C_SOURCE_COMPILES(" |
1904 | @@ -1448,3 +1433,21 @@ |
1905 | return tmp && tmp->init ? &tmp->dbug : 0; |
1906 | } |
1907 | #endif /* DBUG_OFF */ |
1908 | +--- a/storage/innobase/handler/handler0alter.cc |
1909 | ++++ b/storage/innobase/handler/handler0alter.cc |
1910 | +@@ -5434,6 +5434,7 @@ |
1911 | + = static_cast<ha_innobase_inplace_ctx*>(*pctx); |
1912 | + |
1913 | + DBUG_ASSERT(ctx->need_rebuild()); |
1914 | ++#if 0 |
1915 | + /* Generate the redo log for the file |
1916 | + operations that will be performed in |
1917 | + commit_cache_rebuild(). */ |
1918 | +@@ -5442,6 +5443,7 @@ |
1919 | + ctx->new_table->space, |
1920 | + ctx->new_table->name, |
1921 | + ctx->tmp_name, &mtr); |
1922 | ++#endif |
1923 | + DBUG_INJECT_CRASH("ib_commit_inplace_crash", |
1924 | + crash_inject_count++); |
1925 | + } |
1926 | |
1927 | === modified file 'patches/xtradb51.patch' |
1928 | --- patches/xtradb51.patch 2013-05-07 13:32:47 +0000 |
1929 | +++ patches/xtradb51.patch 2013-07-22 14:01:36 +0000 |
1930 | @@ -1,6 +1,6 @@ |
1931 | --- a/storage/innodb_plugin/btr/btr0btr.c |
1932 | +++ b/storage/innodb_plugin/btr/btr0btr.c |
1933 | -@@ -674,7 +674,7 @@ |
1934 | +@@ -680,7 +680,7 @@ |
1935 | /**************************************************************//** |
1936 | Gets the root node of a tree and x-latches it. |
1937 | @return root page, x-latched */ |
1938 | @@ -9,7 +9,7 @@ |
1939 | buf_block_t* |
1940 | btr_root_block_get( |
1941 | /*===============*/ |
1942 | -@@ -1134,7 +1134,7 @@ |
1943 | +@@ -1198,7 +1198,7 @@ |
1944 | /************************************************************//** |
1945 | Returns the child page of a node pointer and x-latches it. |
1946 | @return child page, x-latched */ |
1947 | @@ -28,7 +28,7 @@ |
1948 | |
1949 | /* prototypes for new functions added to ha_innodb.cc */ |
1950 | trx_t* innobase_get_trx(); |
1951 | -@@ -412,7 +413,7 @@ |
1952 | +@@ -414,7 +415,7 @@ |
1953 | return(TRUE); |
1954 | } |
1955 | |
1956 | @@ -37,7 +37,7 @@ |
1957 | if (recv_lsn_checks_on) { |
1958 | ib_uint64_t current_lsn; |
1959 | |
1960 | -@@ -744,6 +745,7 @@ |
1961 | +@@ -746,6 +747,7 @@ |
1962 | block->page.zip_list.prev = NULL; |
1963 | block->page.zip_list.next = NULL; |
1964 | block->page.in_LRU_list = FALSE; |
1965 | @@ -45,7 +45,7 @@ |
1966 | block->in_unzip_LRU_list = FALSE; |
1967 | #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG |
1968 | block->n_pointers = 0; |
1969 | -@@ -1888,7 +1890,9 @@ |
1970 | +@@ -1787,7 +1789,9 @@ |
1971 | ut_ad(zip_size == fil_space_get_zip_size(space)); |
1972 | ut_ad(ut_is_2pow(zip_size)); |
1973 | #ifndef UNIV_LOG_DEBUG |
1974 | @@ -56,7 +56,7 @@ |
1975 | #endif |
1976 | if (innobase_get_slow_log()) { |
1977 | trx = innobase_get_trx(); |
1978 | -@@ -3190,6 +3194,13 @@ |
1979 | +@@ -3096,6 +3100,13 @@ |
1980 | frame = ((buf_block_t*) bpage)->frame; |
1981 | } |
1982 | |
1983 | @@ -70,7 +70,7 @@ |
1984 | /* If this page is not uninitialized and not in the |
1985 | doublewrite buffer, then the page number and space id |
1986 | should be the same as in block. */ |
1987 | -@@ -3302,7 +3313,8 @@ |
1988 | +@@ -3208,7 +3219,8 @@ |
1989 | recv_recover_page(TRUE, (buf_block_t*) bpage); |
1990 | } |
1991 | |
1992 | @@ -82,7 +82,7 @@ |
1993 | (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL : |
1994 | --- a/storage/innodb_plugin/fil/fil0fil.c |
1995 | +++ b/storage/innodb_plugin/fil/fil0fil.c |
1996 | -@@ -297,7 +297,7 @@ |
1997 | +@@ -298,7 +298,7 @@ |
1998 | |
1999 | /** The tablespace memory cache. This variable is NULL before the module is |
2000 | initialized. */ |
2001 | @@ -91,7 +91,7 @@ |
2002 | |
2003 | |
2004 | /********************************************************************//** |
2005 | -@@ -308,7 +308,7 @@ |
2006 | +@@ -309,7 +309,7 @@ |
2007 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
2008 | mutex. */ |
2009 | static |
2010 | @@ -100,7 +100,7 @@ |
2011 | fil_node_prepare_for_io( |
2012 | /*====================*/ |
2013 | fil_node_t* node, /*!< in: file node */ |
2014 | -@@ -633,7 +633,7 @@ |
2015 | +@@ -634,7 +634,7 @@ |
2016 | Opens a the file of a node of a tablespace. The caller must own the fil_system |
2017 | mutex. */ |
2018 | static |
2019 | @@ -109,7 +109,7 @@ |
2020 | fil_node_open_file( |
2021 | /*===============*/ |
2022 | fil_node_t* node, /*!< in: file node */ |
2023 | -@@ -667,7 +667,17 @@ |
2024 | +@@ -668,7 +668,17 @@ |
2025 | node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success); |
2026 | if (!success) { |
2027 | /* The following call prints an error message */ |
2028 | @@ -128,7 +128,7 @@ |
2029 | |
2030 | ut_print_timestamp(stderr); |
2031 | |
2032 | -@@ -728,12 +738,14 @@ |
2033 | +@@ -729,12 +739,14 @@ |
2034 | |
2035 | if (UNIV_UNLIKELY(space_id != space->id)) { |
2036 | fprintf(stderr, |
2037 | @@ -147,7 +147,7 @@ |
2038 | } |
2039 | |
2040 | if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED |
2041 | -@@ -757,8 +769,8 @@ |
2042 | +@@ -758,8 +770,8 @@ |
2043 | } |
2044 | |
2045 | if (size_bytes >= 1024 * 1024) { |
2046 | @@ -158,7 +158,7 @@ |
2047 | } |
2048 | |
2049 | if (!(flags & DICT_TF_ZSSIZE_MASK)) { |
2050 | -@@ -803,6 +815,8 @@ |
2051 | +@@ -804,6 +816,8 @@ |
2052 | /* Put the node to the LRU list */ |
2053 | UT_LIST_ADD_FIRST(LRU, system->LRU, node); |
2054 | } |
2055 | @@ -167,7 +167,7 @@ |
2056 | } |
2057 | |
2058 | /**********************************************************************//** |
2059 | -@@ -1431,7 +1445,12 @@ |
2060 | +@@ -1451,7 +1465,12 @@ |
2061 | the file yet; the following calls will open it and update the |
2062 | size fields */ |
2063 | |
2064 | @@ -181,7 +181,7 @@ |
2065 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
2066 | } |
2067 | |
2068 | -@@ -1483,7 +1502,12 @@ |
2069 | +@@ -1503,7 +1522,12 @@ |
2070 | the file yet; the following calls will open it and update the |
2071 | size fields */ |
2072 | |
2073 | @@ -195,7 +195,7 @@ |
2074 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
2075 | } |
2076 | |
2077 | -@@ -1933,7 +1957,7 @@ |
2078 | +@@ -1952,7 +1976,7 @@ |
2079 | mem_free(path); |
2080 | } |
2081 | |
2082 | @@ -204,7 +204,7 @@ |
2083 | /********************************************************//** |
2084 | Writes a log record about an .ibd file create/rename/delete. */ |
2085 | static |
2086 | -@@ -2157,7 +2181,7 @@ |
2087 | +@@ -2176,7 +2200,7 @@ |
2088 | if (fil_create_new_single_table_tablespace( |
2089 | space_id, name, FALSE, flags, |
2090 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { |
2091 | @@ -213,7 +213,7 @@ |
2092 | } |
2093 | } |
2094 | |
2095 | -@@ -2324,7 +2348,7 @@ |
2096 | +@@ -2344,7 +2368,7 @@ |
2097 | } |
2098 | |
2099 | if (success) { |
2100 | @@ -222,16 +222,16 @@ |
2101 | /* Write a log record about the deletion of the .ibd |
2102 | file, so that ibbackup can replay it in the |
2103 | --apply-log phase. We use a dummy mtr and the familiar |
2104 | -@@ -2625,7 +2649,7 @@ |
2105 | +@@ -2645,7 +2669,7 @@ |
2106 | |
2107 | mutex_exit(&fil_system->mutex); |
2108 | |
2109 | -#ifndef UNIV_HOTBACKUP |
2110 | +#ifdef UNDEFINED |
2111 | - if (success) { |
2112 | + if (success && !recv_recovery_on) { |
2113 | mtr_t mtr; |
2114 | |
2115 | -@@ -2815,7 +2839,7 @@ |
2116 | +@@ -2835,7 +2859,7 @@ |
2117 | |
2118 | fil_node_create(path, size, space_id, FALSE); |
2119 | |
2120 | @@ -240,7 +240,7 @@ |
2121 | { |
2122 | mtr_t mtr; |
2123 | |
2124 | -@@ -3159,19 +3183,97 @@ |
2125 | +@@ -3182,19 +3206,97 @@ |
2126 | "InnoDB: open the tablespace file ", stderr); |
2127 | ut_print_filename(stderr, filepath); |
2128 | fputs("!\n" |
2129 | @@ -348,7 +348,7 @@ |
2130 | return(FALSE); |
2131 | } |
2132 | |
2133 | -@@ -4106,7 +4208,7 @@ |
2134 | +@@ -4138,7 +4240,7 @@ |
2135 | cannot be ok. */ |
2136 | |
2137 | size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low; |
2138 | @@ -357,7 +357,7 @@ |
2139 | if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) { |
2140 | fprintf(stderr, |
2141 | "InnoDB: Error: the size of single-table tablespace" |
2142 | -@@ -4236,7 +4338,51 @@ |
2143 | +@@ -4268,7 +4370,51 @@ |
2144 | |
2145 | fil_node_create(filepath, 0, space_id, FALSE); |
2146 | func_exit: |
2147 | @@ -410,7 +410,7 @@ |
2148 | ut_free(buf2); |
2149 | mem_free(filepath); |
2150 | } |
2151 | -@@ -4247,7 +4393,7 @@ |
2152 | +@@ -4279,7 +4425,7 @@ |
2153 | idea is to read as much good data as we can and jump over bad data. |
2154 | @return 0 if ok, -1 if error even after the retries, 1 if at the end |
2155 | of the directory */ |
2156 | @@ -419,7 +419,7 @@ |
2157 | int |
2158 | fil_file_readdir_next_file( |
2159 | /*=======================*/ |
2160 | -@@ -4291,7 +4437,7 @@ |
2161 | +@@ -4323,7 +4469,7 @@ |
2162 | @return DB_SUCCESS or error number */ |
2163 | UNIV_INTERN |
2164 | ulint |
2165 | @@ -428,7 +428,7 @@ |
2166 | /*===================================*/ |
2167 | { |
2168 | int ret; |
2169 | -@@ -4347,7 +4493,9 @@ |
2170 | +@@ -4379,7 +4525,9 @@ |
2171 | dbinfo.name); |
2172 | srv_normalize_path_for_win(dbpath); |
2173 | |
2174 | @@ -439,7 +439,7 @@ |
2175 | |
2176 | if (dbdir != NULL) { |
2177 | /* printf("Opened dir %s\n", dbinfo.name); */ |
2178 | -@@ -4373,8 +4521,11 @@ |
2179 | +@@ -4405,8 +4553,11 @@ |
2180 | ".ibd")) { |
2181 | /* The name ends in .ibd; try opening |
2182 | the file */ |
2183 | @@ -452,7 +452,7 @@ |
2184 | } |
2185 | next_file_item: |
2186 | ret = fil_file_readdir_next_file(&err, |
2187 | -@@ -4546,15 +4697,97 @@ |
2188 | +@@ -4578,15 +4729,97 @@ |
2189 | "InnoDB: in InnoDB data dictionary" |
2190 | " has tablespace id %lu,\n" |
2191 | "InnoDB: but tablespace with that id" |
2192 | @@ -558,7 +558,7 @@ |
2193 | } else { |
2194 | ut_print_timestamp(stderr); |
2195 | fputs(" InnoDB: Error: table ", stderr); |
2196 | -@@ -4953,7 +5186,7 @@ |
2197 | +@@ -4985,7 +5218,7 @@ |
2198 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
2199 | mutex. */ |
2200 | static |
2201 | @@ -567,7 +567,7 @@ |
2202 | fil_node_prepare_for_io( |
2203 | /*====================*/ |
2204 | fil_node_t* node, /*!< in: file node */ |
2205 | -@@ -4973,10 +5206,13 @@ |
2206 | +@@ -5005,10 +5238,13 @@ |
2207 | } |
2208 | |
2209 | if (node->open == FALSE) { |
2210 | @@ -582,7 +582,7 @@ |
2211 | } |
2212 | |
2213 | if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE |
2214 | -@@ -4989,6 +5225,8 @@ |
2215 | +@@ -5021,6 +5257,8 @@ |
2216 | } |
2217 | |
2218 | node->n_pending++; |
2219 | @@ -591,7 +591,7 @@ |
2220 | } |
2221 | |
2222 | /********************************************************************//** |
2223 | -@@ -5125,7 +5363,9 @@ |
2224 | +@@ -5157,7 +5395,9 @@ |
2225 | ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE) |
2226 | || !ibuf_bitmap_page(zip_size, block_offset) |
2227 | || sync || is_log); |
2228 | @@ -602,7 +602,7 @@ |
2229 | || ibuf_page(space_id, zip_size, block_offset, NULL)); |
2230 | # endif /* UNIV_LOG_DEBUG */ |
2231 | if (sync) { |
2232 | -@@ -5190,6 +5430,16 @@ |
2233 | +@@ -5222,6 +5462,16 @@ |
2234 | |
2235 | ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE)); |
2236 | |
2237 | @@ -619,9 +619,24 @@ |
2238 | node = UT_LIST_GET_FIRST(space->chain); |
2239 | |
2240 | for (;;) { |
2241 | +@@ -5924,6 +6174,7 @@ |
2242 | + const char* tmp_name) /*!< in: temp table name used while |
2243 | + swapping */ |
2244 | + { |
2245 | ++#ifdef UNDEFINED |
2246 | + mtr_t mtr; |
2247 | + mtr_start(&mtr); |
2248 | + fil_op_write_log(MLOG_FILE_RENAME, old_space_id, |
2249 | +@@ -5931,5 +6182,6 @@ |
2250 | + fil_op_write_log(MLOG_FILE_RENAME, new_space_id, |
2251 | + 0, 0, new_name, old_name, &mtr); |
2252 | + mtr_commit(&mtr); |
2253 | ++#endif |
2254 | + } |
2255 | + |
2256 | --- a/storage/innodb_plugin/handler/ha_innodb.cc |
2257 | +++ b/storage/innodb_plugin/handler/ha_innodb.cc |
2258 | -@@ -365,12 +365,6 @@ |
2259 | +@@ -388,12 +388,6 @@ |
2260 | "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.", |
2261 | NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0); |
2262 | |
2263 | @@ -634,7 +649,7 @@ |
2264 | static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG, |
2265 | "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records " |
2266 | "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. " |
2267 | -@@ -760,17 +754,6 @@ |
2268 | +@@ -789,17 +783,6 @@ |
2269 | } |
2270 | |
2271 | /******************************************************************//** |
2272 | @@ -652,7 +667,7 @@ |
2273 | Returns true if expand_fast_index_creation is enabled for the current |
2274 | session. |
2275 | @return the value of the server's expand_fast_index_creation variable */ |
2276 | -@@ -11966,7 +11949,6 @@ |
2277 | +@@ -12551,7 +12534,6 @@ |
2278 | MYSQL_SYSVAR(flush_neighbor_pages), |
2279 | MYSQL_SYSVAR(read_ahead), |
2280 | MYSQL_SYSVAR(adaptive_checkpoint), |
2281 | @@ -672,7 +687,7 @@ |
2282 | if (ibuf_fixed_addr_page(space, zip_size, page_no)) { |
2283 | |
2284 | return(TRUE); |
2285 | -@@ -2280,6 +2283,9 @@ |
2286 | +@@ -2278,6 +2281,9 @@ |
2287 | ulint n_bytes; |
2288 | ulint n_pag2; |
2289 | |
2290 | @@ -684,7 +699,7 @@ |
2291 | |
2292 | --- a/storage/innodb_plugin/include/fil0fil.h |
2293 | +++ b/storage/innodb_plugin/include/fil0fil.h |
2294 | -@@ -505,7 +505,7 @@ |
2295 | +@@ -509,7 +509,7 @@ |
2296 | @return DB_SUCCESS or error number */ |
2297 | UNIV_INTERN |
2298 | ulint |
2299 | @@ -712,7 +727,7 @@ |
2300 | @return the value of the server's innodb_expand_fast_index_creation variable */ |
2301 | --- a/storage/innodb_plugin/include/log0recv.h |
2302 | +++ b/storage/innodb_plugin/include/log0recv.h |
2303 | -@@ -444,7 +444,7 @@ |
2304 | +@@ -481,7 +481,7 @@ |
2305 | /* defined in os0file.c */ |
2306 | #define OS_AIO_MERGE_N_CONSECUTIVE 64 |
2307 | /* defined in log0recv.c */ |
2308 | @@ -723,7 +738,7 @@ |
2309 | |
2310 | --- a/storage/innodb_plugin/include/mem0mem.ic |
2311 | +++ b/storage/innodb_plugin/include/mem0mem.ic |
2312 | -@@ -367,7 +367,7 @@ |
2313 | +@@ -363,7 +363,7 @@ |
2314 | buf = (byte*)buf + MEM_FIELD_HEADER_SIZE; |
2315 | |
2316 | /* Check that the field lengths agree */ |
2317 | @@ -734,7 +749,7 @@ |
2318 | return(buf); |
2319 | --- a/storage/innodb_plugin/include/srv0srv.h |
2320 | +++ b/storage/innodb_plugin/include/srv0srv.h |
2321 | -@@ -226,6 +226,11 @@ |
2322 | +@@ -243,6 +243,11 @@ |
2323 | |
2324 | extern ulong srv_replication_delay; |
2325 | |
2326 | @@ -816,7 +831,7 @@ |
2327 | |
2328 | --- a/storage/innodb_plugin/log/log0log.c |
2329 | +++ b/storage/innodb_plugin/log/log0log.c |
2330 | -@@ -1370,7 +1370,7 @@ |
2331 | +@@ -1449,7 +1449,7 @@ |
2332 | #endif /* UNIV_DEBUG */ |
2333 | ulint unlock; |
2334 | |
2335 | @@ -825,7 +840,7 @@ |
2336 | /* Recovery is running and no operations on the log files are |
2337 | allowed yet (the variable name .._no_ibuf_.. is misleading) */ |
2338 | |
2339 | -@@ -2032,7 +2032,7 @@ |
2340 | +@@ -2117,7 +2117,7 @@ |
2341 | return(TRUE); |
2342 | } |
2343 | |
2344 | @@ -834,7 +849,7 @@ |
2345 | |
2346 | if (log_sys->n_pending_checkpoint_writes > 0) { |
2347 | /* A checkpoint write is running */ |
2348 | -@@ -3127,6 +3127,7 @@ |
2349 | +@@ -3232,6 +3232,7 @@ |
2350 | shutdown, because the InnoDB layer may have committed or |
2351 | prepared transactions and we don't want to lose them. */ |
2352 | |
2353 | @@ -842,7 +857,7 @@ |
2354 | if (trx_n_mysql_transactions > 0 |
2355 | || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared) { |
2356 | |
2357 | -@@ -3134,6 +3135,7 @@ |
2358 | +@@ -3239,6 +3240,7 @@ |
2359 | |
2360 | goto loop; |
2361 | } |
2362 | @@ -885,7 +900,7 @@ |
2363 | |
2364 | /** The recovery system */ |
2365 | UNIV_INTERN recv_sys_t* recv_sys = NULL; |
2366 | -@@ -621,7 +622,7 @@ |
2367 | +@@ -622,7 +623,7 @@ |
2368 | /***********************************************************************//** |
2369 | Checks the consistency of the checkpoint info |
2370 | @return TRUE if ok */ |
2371 | @@ -894,7 +909,7 @@ |
2372 | ibool |
2373 | recv_check_cp_is_consistent( |
2374 | /*========================*/ |
2375 | -@@ -651,7 +652,7 @@ |
2376 | +@@ -652,7 +653,7 @@ |
2377 | /********************************************************//** |
2378 | Looks for the maximum consistent checkpoint from the log groups. |
2379 | @return error code or DB_SUCCESS */ |
2380 | @@ -903,16 +918,7 @@ |
2381 | ulint |
2382 | recv_find_max_checkpoint( |
2383 | /*=====================*/ |
2384 | -@@ -840,7 +841,7 @@ |
2385 | - InnoDB-3.23.52 where the checksum field contains the log block number. |
2386 | - @return TRUE if ok, or if the log block may be in the format of InnoDB |
2387 | - version predating 3.23.52 */ |
2388 | --static |
2389 | -+//static |
2390 | - ibool |
2391 | - log_block_checksum_is_ok_or_old_format( |
2392 | - /*===================================*/ |
2393 | -@@ -1629,9 +1630,16 @@ |
2394 | +@@ -1636,9 +1637,16 @@ |
2395 | if (page_zip) { |
2396 | memset(FIL_PAGE_LSN + page_zip->data, 0, 8); |
2397 | } |
2398 | @@ -930,7 +936,7 @@ |
2399 | |
2400 | ib_uint64_t end_lsn; |
2401 | |
2402 | -@@ -1830,6 +1838,18 @@ |
2403 | +@@ -1838,6 +1846,18 @@ |
2404 | ulint zip_size = fil_space_get_zip_size(space); |
2405 | ulint page_no = recv_addr->page_no; |
2406 | |
2407 | @@ -949,7 +955,7 @@ |
2408 | if (recv_addr->state == RECV_NOT_PROCESSED) { |
2409 | if (!has_printed) { |
2410 | ut_print_timestamp(stderr); |
2411 | -@@ -1863,7 +1883,7 @@ |
2412 | +@@ -1871,7 +1891,7 @@ |
2413 | |
2414 | mutex_enter(&(recv_sys->mutex)); |
2415 | } |
2416 | @@ -958,7 +964,7 @@ |
2417 | recv_addr = HASH_GET_NEXT(addr_hash, recv_addr); |
2418 | } |
2419 | |
2420 | -@@ -2369,7 +2389,7 @@ |
2421 | +@@ -2377,7 +2397,7 @@ |
2422 | || type == MLOG_FILE_RENAME |
2423 | || type == MLOG_FILE_DELETE) { |
2424 | ut_a(space); |
2425 | @@ -967,7 +973,7 @@ |
2426 | if (recv_replay_file_ops) { |
2427 | |
2428 | /* In ibbackup --apply-log, replay an .ibd file |
2429 | -@@ -2392,7 +2412,7 @@ |
2430 | +@@ -2400,7 +2420,7 @@ |
2431 | ut_error; |
2432 | } |
2433 | } |
2434 | @@ -976,7 +982,7 @@ |
2435 | /* In normal mysqld crash recovery we do not try to |
2436 | replay file operations */ |
2437 | #ifdef UNIV_LOG_LSN_DEBUG |
2438 | -@@ -2809,8 +2829,11 @@ |
2439 | +@@ -2817,8 +2837,11 @@ |
2440 | |
2441 | fprintf(stderr, |
2442 | "InnoDB: Doing recovery: scanned up to" |
2443 | @@ -990,7 +996,7 @@ |
2444 | } |
2445 | } |
2446 | |
2447 | -@@ -2913,7 +2936,7 @@ |
2448 | +@@ -2921,7 +2944,7 @@ |
2449 | "InnoDB: Reading tablespace information" |
2450 | " from the .ibd files...\n"); |
2451 | |
2452 | @@ -999,7 +1005,7 @@ |
2453 | |
2454 | /* If we are using the doublewrite method, we will |
2455 | check if there are half-written pages in data files, |
2456 | -@@ -2922,12 +2945,14 @@ |
2457 | +@@ -2930,12 +2953,14 @@ |
2458 | |
2459 | if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) { |
2460 | |
2461 | @@ -1015,7 +1021,7 @@ |
2462 | } |
2463 | } |
2464 | |
2465 | -@@ -3095,6 +3120,7 @@ |
2466 | +@@ -3103,6 +3128,7 @@ |
2467 | recv_sys->recovered_lsn = checkpoint_lsn; |
2468 | |
2469 | srv_start_lsn = checkpoint_lsn; |
2470 | @@ -1023,7 +1029,7 @@ |
2471 | } |
2472 | |
2473 | contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn, |
2474 | -@@ -3453,6 +3479,7 @@ |
2475 | +@@ -3461,6 +3487,7 @@ |
2476 | that the data dictionary tables will be free of any locks. |
2477 | The data dictionary latch should guarantee that there is at |
2478 | most one data dictionary transaction active at a time. */ |
2479 | @@ -1042,7 +1048,7 @@ |
2480 | #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__) |
2481 | /* InnoDB Hot Backup does not lock the data files. |
2482 | * On Windows, mandatory locking is used. |
2483 | -@@ -1357,8 +1357,9 @@ |
2484 | +@@ -1365,8 +1365,9 @@ |
2485 | attributes = 0; |
2486 | ut_error; |
2487 | } |
2488 | @@ -1053,7 +1059,7 @@ |
2489 | GENERIC_READ | GENERIC_WRITE, /* read and write |
2490 | access */ |
2491 | share_mode, /* File can be read also by other |
2492 | -@@ -1417,7 +1418,11 @@ |
2493 | +@@ -1432,7 +1433,11 @@ |
2494 | if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW |
2495 | || create_mode == OS_FILE_OPEN_RETRY) { |
2496 | mode_str = "OPEN"; |
2497 | @@ -1066,7 +1072,7 @@ |
2498 | } else if (create_mode == OS_FILE_CREATE) { |
2499 | mode_str = "CREATE"; |
2500 | create_flag = O_RDWR | O_CREAT | O_EXCL; |
2501 | -@@ -2682,6 +2687,9 @@ |
2502 | +@@ -2716,6 +2721,9 @@ |
2503 | ut_a((offset & 0xFFFFFFFFUL) == offset); |
2504 | ut_a((n & 0xFFFFFFFFUL) == n); |
2505 | |
2506 | @@ -1076,7 +1082,7 @@ |
2507 | os_n_file_writes++; |
2508 | |
2509 | ut_ad(file); |
2510 | -@@ -2806,6 +2814,9 @@ |
2511 | +@@ -2840,6 +2848,9 @@ |
2512 | #else |
2513 | ssize_t ret; |
2514 | |
2515 | @@ -1108,9 +1114,9 @@ |
2516 | |
2517 | --- a/storage/innodb_plugin/srv/srv0srv.c |
2518 | +++ b/storage/innodb_plugin/srv/srv0srv.c |
2519 | -@@ -86,11 +86,6 @@ |
2520 | - #include "trx0i_s.h" |
2521 | - #include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */ |
2522 | +@@ -96,11 +96,6 @@ |
2523 | + # include "my_sys.h" /* DEBUG_SYNC_C */ |
2524 | + #endif |
2525 | |
2526 | -/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */ |
2527 | -ibool innobase_thd_is_idle(const void* thd); |
2528 | @@ -1120,7 +1126,7 @@ |
2529 | /* prototypes for new functions added to ha_innodb.cc */ |
2530 | ibool innobase_get_slow_log(); |
2531 | |
2532 | -@@ -415,6 +410,11 @@ |
2533 | +@@ -438,6 +433,11 @@ |
2534 | |
2535 | UNIV_INTERN ulong srv_replication_delay = 0; |
2536 | |
2537 | @@ -1132,7 +1138,7 @@ |
2538 | UNIV_INTERN long long srv_ibuf_max_size = 0; |
2539 | UNIV_INTERN ulint srv_ibuf_active_contract = 0; /* 0:disable 1:enable */ |
2540 | UNIV_INTERN ulint srv_ibuf_accel_rate = 100; |
2541 | -@@ -1065,7 +1065,7 @@ |
2542 | +@@ -1095,7 +1095,7 @@ |
2543 | } |
2544 | |
2545 | /* Initialize some INFORMATION SCHEMA internal structures */ |
2546 | @@ -1141,7 +1147,7 @@ |
2547 | } |
2548 | |
2549 | /*********************************************************************//** |
2550 | -@@ -1076,6 +1076,7 @@ |
2551 | +@@ -1106,6 +1106,7 @@ |
2552 | /*==========*/ |
2553 | { |
2554 | os_fast_mutex_free(&srv_conc_mutex); |
2555 | @@ -1149,7 +1155,7 @@ |
2556 | mem_free(srv_conc_slots); |
2557 | srv_conc_slots = NULL; |
2558 | |
2559 | -@@ -1089,6 +1090,7 @@ |
2560 | +@@ -1119,6 +1120,7 @@ |
2561 | srv_mysql_table = NULL; |
2562 | |
2563 | trx_i_s_cache_free(trx_i_s_cache); |
2564 | @@ -1157,7 +1163,7 @@ |
2565 | } |
2566 | |
2567 | /*********************************************************************//** |
2568 | -@@ -2570,36 +2572,6 @@ |
2569 | +@@ -2634,36 +2636,6 @@ |
2570 | old_sema = sema; |
2571 | } |
2572 | |
2573 | @@ -1196,7 +1202,7 @@ |
2574 | |
2575 | --- a/storage/innodb_plugin/srv/srv0start.c |
2576 | +++ b/storage/innodb_plugin/srv/srv0start.c |
2577 | -@@ -62,6 +62,7 @@ |
2578 | +@@ -63,6 +63,7 @@ |
2579 | #include "ibuf0ibuf.h" |
2580 | #include "srv0start.h" |
2581 | #include "srv0srv.h" |
2582 | @@ -1204,7 +1210,7 @@ |
2583 | #ifndef UNIV_HOTBACKUP |
2584 | # include "os0proc.h" |
2585 | # include "sync0sync.h" |
2586 | -@@ -95,6 +96,8 @@ |
2587 | +@@ -96,6 +97,8 @@ |
2588 | /** Log sequence number at shutdown */ |
2589 | UNIV_INTERN ib_uint64_t srv_shutdown_lsn; |
2590 | |
2591 | @@ -1213,7 +1219,7 @@ |
2592 | #ifdef HAVE_DARWIN_THREADS |
2593 | # include <sys/utsname.h> |
2594 | /** TRUE if the F_FULLFSYNC option is available */ |
2595 | -@@ -545,7 +548,7 @@ |
2596 | +@@ -540,7 +543,7 @@ |
2597 | /*********************************************************************//** |
2598 | Creates or opens the log files and closes them. |
2599 | @return DB_SUCCESS or error code */ |
2600 | @@ -1222,7 +1228,7 @@ |
2601 | ulint |
2602 | open_or_create_log_file( |
2603 | /*====================*/ |
2604 | -@@ -703,7 +706,7 @@ |
2605 | +@@ -698,7 +701,7 @@ |
2606 | /*********************************************************************//** |
2607 | Creates or opens database data files and closes them. |
2608 | @return DB_SUCCESS or error code */ |
2609 | @@ -1231,7 +1237,7 @@ |
2610 | ulint |
2611 | open_or_create_data_files( |
2612 | /*======================*/ |
2613 | -@@ -1782,6 +1785,10 @@ |
2614 | +@@ -1804,6 +1807,10 @@ |
2615 | are initialized in trx_sys_init_at_db_start(). */ |
2616 | |
2617 | recv_recovery_from_checkpoint_finish(); |
2618 | @@ -1242,7 +1248,7 @@ |
2619 | if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { |
2620 | /* The following call is necessary for the insert |
2621 | buffer to work with multiple tablespaces. We must |
2622 | -@@ -1962,7 +1969,18 @@ |
2623 | +@@ -1990,7 +1997,18 @@ |
2624 | |
2625 | if (srv_auto_extend_last_data_file |
2626 | && sum_of_data_file_sizes < tablespace_size_in_header) { |
2627 | @@ -1261,7 +1267,7 @@ |
2628 | fprintf(stderr, |
2629 | "InnoDB: Error: tablespace size stored in header" |
2630 | " is %lu pages, but\n" |
2631 | -@@ -1987,6 +2005,7 @@ |
2632 | +@@ -2015,6 +2033,7 @@ |
2633 | |
2634 | return(DB_ERROR); |
2635 | } |
2636 | @@ -1269,7 +1275,7 @@ |
2637 | } |
2638 | |
2639 | /* Check that os_fast_mutexes work as expected */ |
2640 | -@@ -2008,6 +2027,10 @@ |
2641 | +@@ -2036,6 +2055,10 @@ |
2642 | |
2643 | os_fast_mutex_free(&srv_os_test_mutex); |
2644 | |
2645 | @@ -1280,7 +1286,7 @@ |
2646 | if (!srv_file_per_table_original_value |
2647 | && srv_pass_corrupt_table) { |
2648 | fprintf(stderr, "InnoDB: Warning:" |
2649 | -@@ -2089,6 +2112,7 @@ |
2650 | +@@ -2117,6 +2140,7 @@ |
2651 | ibuf_update_max_tablespace_id(); |
2652 | } |
2653 | |
2654 | @@ -1290,9 +1296,9 @@ |
2655 | srv_was_started = TRUE; |
2656 | --- a/storage/innodb_plugin/trx/trx0purge.c |
2657 | +++ b/storage/innodb_plugin/trx/trx0purge.c |
2658 | -@@ -1113,6 +1113,9 @@ |
2659 | +@@ -1119,6 +1119,9 @@ |
2660 | /* que_thr_t* thr2; */ |
2661 | - ulint old_pages_handled; |
2662 | + ulonglong old_pages_handled; |
2663 | |
2664 | + if (srv_fake_write) |
2665 | + return(0); |
2666 | @@ -1316,7 +1322,7 @@ |
2667 | |
2668 | --- a/storage/innodb_plugin/trx/trx0sys.c |
2669 | +++ b/storage/innodb_plugin/trx/trx0sys.c |
2670 | -@@ -1910,12 +1910,14 @@ |
2671 | +@@ -1944,12 +1944,14 @@ |
2672 | mem_free(trx_doublewrite); |
2673 | trx_doublewrite = NULL; |
2674 | |
2675 | @@ -1331,7 +1337,7 @@ |
2676 | |
2677 | /* There can't be any active transactions. */ |
2678 | rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list); |
2679 | -@@ -1941,10 +1943,12 @@ |
2680 | +@@ -1975,10 +1977,12 @@ |
2681 | UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view); |
2682 | } |
2683 | |
2684 | @@ -1389,7 +1395,7 @@ |
2685 | mutex_enter(&kernel_mutex); |
2686 | |
2687 | ret = trx_start_low(trx, rseg_id); |
2688 | -@@ -990,7 +984,6 @@ |
2689 | +@@ -1000,7 +994,6 @@ |
2690 | trx->read_view = NULL; |
2691 | |
2692 | if (lsn) { |
2693 | @@ -1397,7 +1403,7 @@ |
2694 | |
2695 | mutex_exit(&kernel_mutex); |
2696 | |
2697 | -@@ -999,11 +992,6 @@ |
2698 | +@@ -1009,11 +1002,6 @@ |
2699 | trx_undo_insert_cleanup(trx); |
2700 | } |
2701 | |
2702 | @@ -1409,7 +1415,7 @@ |
2703 | |
2704 | /* NOTE that we could possibly make a group commit more |
2705 | efficient here: call os_thread_yield here to allow also other |
2706 | -@@ -1036,9 +1024,9 @@ |
2707 | +@@ -1046,9 +1034,9 @@ |
2708 | if (trx->flush_log_later) { |
2709 | /* Do nothing yet */ |
2710 | trx->must_flush_log_later = TRUE; |
2711 | @@ -1421,7 +1427,7 @@ |
2712 | if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) { |
2713 | /* Write the log but do not flush it to disk */ |
2714 | |
2715 | -@@ -1050,7 +1038,7 @@ |
2716 | +@@ -1060,7 +1048,7 @@ |
2717 | |
2718 | log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE); |
2719 | } |
2720 | @@ -1430,7 +1436,7 @@ |
2721 | |
2722 | /* Write the log but do not flush it to disk */ |
2723 | |
2724 | -@@ -1730,23 +1718,16 @@ |
2725 | +@@ -1742,23 +1730,16 @@ |
2726 | trx_t* trx) /*!< in: trx handle */ |
2727 | { |
2728 | ib_uint64_t lsn = trx->commit_lsn; |
2729 | @@ -1456,7 +1462,7 @@ |
2730 | if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) { |
2731 | /* Write the log but do not flush it to disk */ |
2732 | |
2733 | -@@ -1757,7 +1738,7 @@ |
2734 | +@@ -1769,7 +1750,7 @@ |
2735 | |
2736 | log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE); |
2737 | } |
2738 | @@ -1465,7 +1471,7 @@ |
2739 | |
2740 | /* Write the log but do not flush it to disk */ |
2741 | |
2742 | -@@ -2018,8 +1999,6 @@ |
2743 | +@@ -2047,8 +2028,6 @@ |
2744 | /*--------------------------------------*/ |
2745 | |
2746 | if (lsn) { |
2747 | @@ -1474,7 +1480,7 @@ |
2748 | /* Depending on the my.cnf options, we may now write the log |
2749 | buffer to the log files, making the prepared state of the |
2750 | transaction durable if the OS does not crash. We may also |
2751 | -@@ -2039,15 +2018,9 @@ |
2752 | +@@ -2068,15 +2047,9 @@ |
2753 | |
2754 | mutex_exit(&kernel_mutex); |
2755 | |
2756 | @@ -1492,7 +1498,7 @@ |
2757 | if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) { |
2758 | /* Write the log but do not flush it to disk */ |
2759 | |
2760 | -@@ -2059,7 +2032,7 @@ |
2761 | +@@ -2088,7 +2061,7 @@ |
2762 | |
2763 | log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE); |
2764 | } |
2765 | @@ -1511,9 +1517,9 @@ |
2766 | |
2767 | /* |
2768 | WAIT ARRAY |
2769 | -@@ -926,6 +927,13 @@ |
2770 | - ibool fatal = FALSE; |
2771 | - double longest_diff = 0; |
2772 | +@@ -931,6 +932,13 @@ |
2773 | + return(FALSE); |
2774 | + } |
2775 | |
2776 | + if (srv_rebuild_indexes) { |
2777 | + |
2778 | @@ -1522,12 +1528,12 @@ |
2779 | + return(FALSE); |
2780 | + } |
2781 | + |
2782 | + sync_array_enter(sync_primary_wait_array); |
2783 | + |
2784 | for (i = 0; i < sync_primary_wait_array->n_cells; i++) { |
2785 | - |
2786 | - double diff; |
2787 | --- a/storage/innodb_plugin/include/buf0buf.h |
2788 | +++ b/storage/innodb_plugin/include/buf0buf.h |
2789 | -@@ -1211,6 +1211,8 @@ |
2790 | +@@ -1295,6 +1295,8 @@ |
2791 | frees a page in buffer pool */ |
2792 | # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ |
2793 | #endif /* !UNIV_HOTBACKUP */ |
2794 | @@ -1579,14 +1585,3 @@ |
2795 | |
2796 | UNIV_MEM_FREE(buf, n); |
2797 | } |
2798 | ---- a/configure.in |
2799 | -+++ b/configure.in |
2800 | -@@ -22,7 +22,7 @@ |
2801 | - AM_INIT_AUTOMAKE([1.9 tar-ustar]) |
2802 | - AC_PROG_LIBTOOL |
2803 | - |
2804 | --AM_CONFIG_HEADER([include/config.h]) |
2805 | -+AC_CONFIG_HEADERS([include/config.h]) |
2806 | - |
2807 | - # Request support for automake silent-rules if available. |
2808 | - # Default to verbose output. One can use the configure-time |
2809 | |
2810 | === modified file 'patches/xtradb55.patch' |
2811 | --- patches/xtradb55.patch 2013-05-07 13:32:47 +0000 |
2812 | +++ patches/xtradb55.patch 2013-07-22 14:01:36 +0000 |
2813 | @@ -1,6 +1,7 @@ |
2814 | +=== modified file 'Percona-Server/storage/innobase/btr/btr0btr.c' |
2815 | --- a/storage/innobase/btr/btr0btr.c |
2816 | +++ b/storage/innobase/btr/btr0btr.c |
2817 | -@@ -674,7 +674,7 @@ |
2818 | +@@ -704,7 +704,7 @@ |
2819 | /**************************************************************//** |
2820 | Gets the root node of a tree and x-latches it. |
2821 | @return root page, x-latched */ |
2822 | @@ -9,7 +10,7 @@ |
2823 | buf_block_t* |
2824 | btr_root_block_get( |
2825 | /*===============*/ |
2826 | -@@ -1134,7 +1134,7 @@ |
2827 | +@@ -1209,7 +1209,7 @@ |
2828 | /************************************************************//** |
2829 | Returns the child page of a node pointer and x-latches it. |
2830 | @return child page, x-latched */ |
2831 | @@ -28,7 +29,7 @@ |
2832 | |
2833 | /* prototypes for new functions added to ha_innodb.cc */ |
2834 | trx_t* innobase_get_trx(); |
2835 | -@@ -581,7 +582,7 @@ |
2836 | +@@ -599,7 +600,7 @@ |
2837 | return(TRUE); |
2838 | } |
2839 | |
2840 | @@ -37,7 +38,7 @@ |
2841 | if (recv_lsn_checks_on) { |
2842 | ib_uint64_t current_lsn; |
2843 | |
2844 | -@@ -965,6 +966,7 @@ |
2845 | +@@ -1000,6 +1001,7 @@ |
2846 | block->page.zip_list.prev = NULL; |
2847 | block->page.zip_list.next = NULL; |
2848 | block->page.in_LRU_list = FALSE; |
2849 | @@ -45,7 +46,7 @@ |
2850 | block->in_unzip_LRU_list = FALSE; |
2851 | #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG |
2852 | block->n_pointers = 0; |
2853 | -@@ -2542,7 +2544,8 @@ |
2854 | +@@ -2471,7 +2473,8 @@ |
2855 | ut_ad(zip_size == fil_space_get_zip_size(space)); |
2856 | ut_ad(ut_is_2pow(zip_size)); |
2857 | #ifndef UNIV_LOG_DEBUG |
2858 | @@ -55,7 +56,7 @@ |
2859 | || ibuf_page_low(space, zip_size, offset, |
2860 | FALSE, file, line, NULL)); |
2861 | #endif |
2862 | -@@ -3952,6 +3955,13 @@ |
2863 | +@@ -3902,6 +3905,13 @@ |
2864 | frame = ((buf_block_t*) bpage)->frame; |
2865 | } |
2866 | |
2867 | @@ -69,19 +70,19 @@ |
2868 | /* If this page is not uninitialized and not in the |
2869 | doublewrite buffer, then the page number and space id |
2870 | should be the same as in block. */ |
2871 | -@@ -4064,7 +4074,8 @@ |
2872 | +@@ -4025,7 +4035,8 @@ |
2873 | recv_recover_page(TRUE, (buf_block_t*) bpage); |
2874 | } |
2875 | |
2876 | - if (uncompressed && !recv_no_ibuf_operations) { |
2877 | + if (uncompressed && !recv_no_ibuf_operations && |
2878 | + !srv_fake_write && !bpage->is_compacted) { |
2879 | - ibuf_merge_or_delete_for_page( |
2880 | - /* Delete possible entries, if bpage is_corrupt */ |
2881 | - (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL : |
2882 | + |
2883 | + buf_block_t* block; |
2884 | + ibool update_ibuf_bitmap; |
2885 | --- a/storage/innobase/fil/fil0fil.c |
2886 | +++ b/storage/innobase/fil/fil0fil.c |
2887 | -@@ -307,7 +307,7 @@ |
2888 | +@@ -310,7 +310,7 @@ |
2889 | |
2890 | /** The tablespace memory cache. This variable is NULL before the module is |
2891 | initialized. */ |
2892 | @@ -90,7 +91,7 @@ |
2893 | |
2894 | #ifdef UNIV_DEBUG |
2895 | /** Try fil_validate() every this many times */ |
2896 | -@@ -346,7 +346,7 @@ |
2897 | +@@ -349,7 +349,7 @@ |
2898 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
2899 | mutex. */ |
2900 | static |
2901 | @@ -99,7 +100,7 @@ |
2902 | fil_node_prepare_for_io( |
2903 | /*====================*/ |
2904 | fil_node_t* node, /*!< in: file node */ |
2905 | -@@ -671,7 +671,7 @@ |
2906 | +@@ -674,7 +674,7 @@ |
2907 | Opens a the file of a node of a tablespace. The caller must own the fil_system |
2908 | mutex. */ |
2909 | static |
2910 | @@ -108,7 +109,7 @@ |
2911 | fil_node_open_file( |
2912 | /*===============*/ |
2913 | fil_node_t* node, /*!< in: file node */ |
2914 | -@@ -706,7 +706,17 @@ |
2915 | +@@ -709,7 +709,17 @@ |
2916 | OS_FILE_READ_ONLY, &success); |
2917 | if (!success) { |
2918 | /* The following call prints an error message */ |
2919 | @@ -127,7 +128,7 @@ |
2920 | |
2921 | ut_print_timestamp(stderr); |
2922 | |
2923 | -@@ -767,12 +777,15 @@ |
2924 | +@@ -770,12 +780,15 @@ |
2925 | |
2926 | if (UNIV_UNLIKELY(space_id != space->id)) { |
2927 | fprintf(stderr, |
2928 | @@ -146,7 +147,7 @@ |
2929 | } |
2930 | |
2931 | if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED |
2932 | -@@ -796,8 +809,8 @@ |
2933 | +@@ -799,8 +812,8 @@ |
2934 | } |
2935 | |
2936 | if (size_bytes >= 1024 * 1024) { |
2937 | @@ -157,7 +158,7 @@ |
2938 | } |
2939 | |
2940 | if (!(flags & DICT_TF_ZSSIZE_MASK)) { |
2941 | -@@ -848,6 +861,8 @@ |
2942 | +@@ -851,6 +864,8 @@ |
2943 | /* Put the node to the LRU list */ |
2944 | UT_LIST_ADD_FIRST(LRU, system->LRU, node); |
2945 | } |
2946 | @@ -166,7 +167,7 @@ |
2947 | } |
2948 | |
2949 | /**********************************************************************//** |
2950 | -@@ -1477,7 +1492,12 @@ |
2951 | +@@ -1517,7 +1532,12 @@ |
2952 | the file yet; the following calls will open it and update the |
2953 | size fields */ |
2954 | |
2955 | @@ -180,7 +181,7 @@ |
2956 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
2957 | } |
2958 | |
2959 | -@@ -1529,7 +1549,12 @@ |
2960 | +@@ -1586,7 +1606,12 @@ |
2961 | the file yet; the following calls will open it and update the |
2962 | size fields */ |
2963 | |
2964 | @@ -194,7 +195,7 @@ |
2965 | fil_node_complete_io(node, fil_system, OS_FILE_READ); |
2966 | } |
2967 | |
2968 | -@@ -1981,7 +2006,7 @@ |
2969 | +@@ -2045,7 +2070,7 @@ |
2970 | mem_free(path); |
2971 | } |
2972 | |
2973 | @@ -203,7 +204,7 @@ |
2974 | /********************************************************//** |
2975 | Writes a log record about an .ibd file create/rename/delete. */ |
2976 | static |
2977 | -@@ -2205,7 +2230,7 @@ |
2978 | +@@ -2269,7 +2294,7 @@ |
2979 | if (fil_create_new_single_table_tablespace( |
2980 | space_id, name, FALSE, flags, |
2981 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { |
2982 | @@ -212,7 +213,7 @@ |
2983 | } |
2984 | } |
2985 | |
2986 | -@@ -2372,7 +2397,7 @@ |
2987 | +@@ -2460,7 +2485,7 @@ |
2988 | } |
2989 | |
2990 | if (success) { |
2991 | @@ -221,16 +222,16 @@ |
2992 | /* Write a log record about the deletion of the .ibd |
2993 | file, so that ibbackup can replay it in the |
2994 | --apply-log phase. We use a dummy mtr and the familiar |
2995 | -@@ -2673,7 +2698,7 @@ |
2996 | +@@ -2761,7 +2786,7 @@ |
2997 | |
2998 | mutex_exit(&fil_system->mutex); |
2999 | |
3000 | -#ifndef UNIV_HOTBACKUP |
3001 | +#ifdef UNDEFINED |
3002 | - if (success) { |
3003 | + if (success && !recv_recovery_on) { |
3004 | mtr_t mtr; |
3005 | |
3006 | -@@ -2864,7 +2889,7 @@ |
3007 | +@@ -2952,7 +2977,7 @@ |
3008 | |
3009 | fil_node_create(path, size, space_id, FALSE); |
3010 | |
3011 | @@ -239,7 +240,7 @@ |
3012 | { |
3013 | mtr_t mtr; |
3014 | |
3015 | -@@ -3210,19 +3235,97 @@ |
3016 | +@@ -3301,19 +3326,97 @@ |
3017 | "InnoDB: open the tablespace file ", stderr); |
3018 | ut_print_filename(stderr, filepath); |
3019 | fputs("!\n" |
3020 | @@ -347,7 +348,7 @@ |
3021 | return(FALSE); |
3022 | } |
3023 | |
3024 | -@@ -4158,7 +4261,7 @@ |
3025 | +@@ -4258,7 +4361,7 @@ |
3026 | cannot be ok. */ |
3027 | |
3028 | size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low; |
3029 | @@ -356,7 +357,7 @@ |
3030 | if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) { |
3031 | fprintf(stderr, |
3032 | "InnoDB: Error: the size of single-table tablespace" |
3033 | -@@ -4288,7 +4391,51 @@ |
3034 | +@@ -4388,7 +4491,51 @@ |
3035 | |
3036 | fil_node_create(filepath, 0, space_id, FALSE); |
3037 | func_exit: |
3038 | @@ -409,7 +410,7 @@ |
3039 | ut_free(buf2); |
3040 | mem_free(filepath); |
3041 | } |
3042 | -@@ -4299,7 +4446,7 @@ |
3043 | +@@ -4399,7 +4546,7 @@ |
3044 | idea is to read as much good data as we can and jump over bad data. |
3045 | @return 0 if ok, -1 if error even after the retries, 1 if at the end |
3046 | of the directory */ |
3047 | @@ -418,7 +419,7 @@ |
3048 | int |
3049 | fil_file_readdir_next_file( |
3050 | /*=======================*/ |
3051 | -@@ -4343,7 +4490,7 @@ |
3052 | +@@ -4443,7 +4590,7 @@ |
3053 | @return DB_SUCCESS or error number */ |
3054 | UNIV_INTERN |
3055 | ulint |
3056 | @@ -427,7 +428,7 @@ |
3057 | /*===================================*/ |
3058 | { |
3059 | int ret; |
3060 | -@@ -4399,7 +4546,9 @@ |
3061 | +@@ -4499,7 +4646,9 @@ |
3062 | dbinfo.name); |
3063 | srv_normalize_path_for_win(dbpath); |
3064 | |
3065 | @@ -438,7 +439,7 @@ |
3066 | |
3067 | if (dbdir != NULL) { |
3068 | /* printf("Opened dir %s\n", dbinfo.name); */ |
3069 | -@@ -4425,8 +4574,11 @@ |
3070 | +@@ -4525,8 +4674,11 @@ |
3071 | ".ibd")) { |
3072 | /* The name ends in .ibd; try opening |
3073 | the file */ |
3074 | @@ -451,7 +452,7 @@ |
3075 | } |
3076 | next_file_item: |
3077 | ret = fil_file_readdir_next_file(&err, |
3078 | -@@ -4598,15 +4750,97 @@ |
3079 | +@@ -4698,15 +4850,97 @@ |
3080 | "InnoDB: in InnoDB data dictionary" |
3081 | " has tablespace id %lu,\n" |
3082 | "InnoDB: but tablespace with that id" |
3083 | @@ -557,7 +558,7 @@ |
3084 | } else { |
3085 | ut_print_timestamp(stderr); |
3086 | fputs(" InnoDB: Error: table ", stderr); |
3087 | -@@ -5005,7 +5239,7 @@ |
3088 | +@@ -5129,7 +5363,7 @@ |
3089 | off the LRU list if it is in the LRU list. The caller must hold the fil_sys |
3090 | mutex. */ |
3091 | static |
3092 | @@ -566,7 +567,7 @@ |
3093 | fil_node_prepare_for_io( |
3094 | /*====================*/ |
3095 | fil_node_t* node, /*!< in: file node */ |
3096 | -@@ -5025,10 +5259,13 @@ |
3097 | +@@ -5149,10 +5383,13 @@ |
3098 | } |
3099 | |
3100 | if (node->open == FALSE) { |
3101 | @@ -581,7 +582,7 @@ |
3102 | } |
3103 | |
3104 | if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE |
3105 | -@@ -5041,6 +5278,8 @@ |
3106 | +@@ -5165,6 +5402,8 @@ |
3107 | } |
3108 | |
3109 | node->n_pending++; |
3110 | @@ -590,7 +591,7 @@ |
3111 | } |
3112 | |
3113 | /********************************************************************//** |
3114 | -@@ -5240,6 +5479,16 @@ |
3115 | +@@ -5350,6 +5589,16 @@ |
3116 | |
3117 | ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE)); |
3118 | |
3119 | @@ -607,9 +608,28 @@ |
3120 | node = UT_LIST_GET_FIRST(space->chain); |
3121 | |
3122 | for (;;) { |
3123 | +@@ -6028,6 +6277,12 @@ |
3124 | + const char* tmp_name) /*!< in: temp table name used while |
3125 | + swapping */ |
3126 | + { |
3127 | ++ (void)old_space_id; |
3128 | ++ (void)old_name; |
3129 | ++ (void)new_space_id; |
3130 | ++ (void)new_name; |
3131 | ++ (void)tmp_name; |
3132 | ++#ifdef UNDEFINED |
3133 | + mtr_t mtr; |
3134 | + mtr_start(&mtr); |
3135 | + fil_op_write_log(MLOG_FILE_RENAME, old_space_id, |
3136 | +@@ -6035,4 +6290,5 @@ |
3137 | + fil_op_write_log(MLOG_FILE_RENAME, new_space_id, |
3138 | + 0, 0, new_name, old_name, &mtr); |
3139 | + mtr_commit(&mtr); |
3140 | ++#endif |
3141 | + } |
3142 | --- a/storage/innobase/handler/ha_innodb.cc |
3143 | +++ b/storage/innobase/handler/ha_innodb.cc |
3144 | -@@ -482,12 +482,6 @@ |
3145 | +@@ -514,12 +514,6 @@ |
3146 | "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.", |
3147 | NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0); |
3148 | |
3149 | @@ -622,7 +642,7 @@ |
3150 | static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG, |
3151 | "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records " |
3152 | "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. " |
3153 | -@@ -989,17 +983,6 @@ |
3154 | +@@ -1038,17 +1032,6 @@ |
3155 | } |
3156 | |
3157 | /******************************************************************//** |
3158 | @@ -640,7 +660,7 @@ |
3159 | Returns true if expand_fast_index_creation is enabled for the current |
3160 | session. |
3161 | @return the value of the server's expand_fast_index_creation variable */ |
3162 | -@@ -11806,17 +11789,12 @@ |
3163 | +@@ -12637,17 +12620,12 @@ |
3164 | innodb_file_format_max_update, "Antelope"); |
3165 | |
3166 | /* Changed to the THDVAR */ |
3167 | @@ -664,7 +684,7 @@ |
3168 | |
3169 | static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method, |
3170 | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, |
3171 | -@@ -12294,7 +12272,6 @@ |
3172 | +@@ -13234,7 +13212,6 @@ |
3173 | MYSQL_SYSVAR(file_format_check), |
3174 | MYSQL_SYSVAR(file_format_max), |
3175 | MYSQL_SYSVAR(flush_log_at_trx_commit), |
3176 | @@ -674,7 +694,7 @@ |
3177 | MYSQL_SYSVAR(large_prefix), |
3178 | --- a/storage/innobase/ibuf/ibuf0ibuf.c |
3179 | +++ b/storage/innobase/ibuf/ibuf0ibuf.c |
3180 | -@@ -1190,6 +1190,9 @@ |
3181 | +@@ -1199,6 +1199,9 @@ |
3182 | ut_ad(!recv_no_ibuf_operations); |
3183 | ut_ad(x_latch || mtr == NULL); |
3184 | |
3185 | @@ -684,7 +704,7 @@ |
3186 | if (ibuf_fixed_addr_page(space, zip_size, page_no)) { |
3187 | |
3188 | return(TRUE); |
3189 | -@@ -2757,6 +2760,9 @@ |
3190 | +@@ -2771,6 +2774,9 @@ |
3191 | ulint n_bytes; |
3192 | ulint n_pag2; |
3193 | |
3194 | @@ -694,9 +714,20 @@ |
3195 | while (sum_pages < n_pages) { |
3196 | n_bytes = ibuf_contract_ext(&n_pag2, sync); |
3197 | |
3198 | +--- a/storage/innobase/include/buf0buf.h |
3199 | ++++ b/storage/innobase/include/buf0buf.h |
3200 | +@@ -1594,6 +1594,8 @@ |
3201 | + frees a page in buffer pool */ |
3202 | + # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ |
3203 | + #endif /* !UNIV_HOTBACKUP */ |
3204 | ++ ibool is_compacted; /*!< TRUE if the page was skipped in |
3205 | ++ compact backups */ |
3206 | + }; |
3207 | + |
3208 | + /** The buffer control block structure */ |
3209 | --- a/storage/innobase/include/fil0fil.h |
3210 | +++ b/storage/innobase/include/fil0fil.h |
3211 | -@@ -506,7 +506,7 @@ |
3212 | +@@ -518,7 +518,7 @@ |
3213 | @return DB_SUCCESS or error number */ |
3214 | UNIV_INTERN |
3215 | ulint |
3216 | @@ -723,7 +754,7 @@ |
3217 | Get the current setting of the lower_case_table_names global parameter from |
3218 | --- a/storage/innobase/include/log0recv.h |
3219 | +++ b/storage/innobase/include/log0recv.h |
3220 | -@@ -444,7 +444,7 @@ |
3221 | +@@ -481,7 +481,7 @@ |
3222 | /* defined in os0file.c */ |
3223 | #define OS_AIO_MERGE_N_CONSECUTIVE 64 |
3224 | /* defined in log0recv.c */ |
3225 | @@ -734,7 +765,7 @@ |
3226 | |
3227 | --- a/storage/innobase/include/srv0srv.h |
3228 | +++ b/storage/innobase/include/srv0srv.h |
3229 | -@@ -145,8 +145,7 @@ |
3230 | +@@ -159,8 +159,7 @@ |
3231 | extern ulint srv_n_log_files; |
3232 | extern ulint srv_log_file_size; |
3233 | extern ulint srv_log_buffer_size; |
3234 | @@ -743,19 +774,19 @@ |
3235 | +extern ulong srv_flush_log_at_trx_commit; |
3236 | extern char srv_adaptive_flushing; |
3237 | |
3238 | - |
3239 | -@@ -247,6 +246,11 @@ |
3240 | - extern ulint srv_dict_size_limit; |
3241 | - |
3242 | - extern ulint srv_lazy_drop_table; |
3243 | -+ |
3244 | + /* If this flag is TRUE, then we will load the indexes' (and tables') metadata |
3245 | +@@ -271,6 +270,11 @@ |
3246 | + extern ulint srv_expand_import; |
3247 | + extern ulint srv_pass_corrupt_table; |
3248 | + |
3249 | +extern ibool srv_read_only; |
3250 | +extern ibool srv_fake_write; |
3251 | +extern ibool srv_apply_log_only; |
3252 | +extern ibool srv_backup_mode; |
3253 | - /*-------------------------------------------*/ |
3254 | - |
3255 | - extern ulint srv_n_rows_inserted; |
3256 | ++ |
3257 | + /* Helper macro to support srv_pass_corrupt_table checks. If 'cond' is FALSE, |
3258 | + execute 'code' if srv_pass_corrupt_table is non-zero, or trigger a fatal error |
3259 | + otherwise. The break statement in 'code' will obviously not work as expected. */ |
3260 | --- a/storage/innobase/include/srv0start.h |
3261 | +++ b/storage/innobase/include/srv0start.h |
3262 | @@ -91,6 +91,8 @@ |
3263 | @@ -769,7 +800,7 @@ |
3264 | extern ibool srv_have_fullfsync; |
3265 | --- a/storage/innobase/log/log0log.c |
3266 | +++ b/storage/innobase/log/log0log.c |
3267 | -@@ -1154,7 +1154,7 @@ |
3268 | +@@ -1237,7 +1237,7 @@ |
3269 | if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC |
3270 | && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT |
3271 | && srv_unix_file_flush_method != SRV_UNIX_NOSYNC |
3272 | @@ -778,7 +809,7 @@ |
3273 | |
3274 | fil_flush(group->space_id, FALSE); |
3275 | } |
3276 | -@@ -1389,7 +1389,7 @@ |
3277 | +@@ -1472,7 +1472,7 @@ |
3278 | #endif /* UNIV_DEBUG */ |
3279 | ulint unlock; |
3280 | |
3281 | @@ -787,7 +818,7 @@ |
3282 | /* Recovery is running and no operations on the log files are |
3283 | allowed yet (the variable name .._no_ibuf_.. is misleading) */ |
3284 | |
3285 | -@@ -2051,7 +2051,7 @@ |
3286 | +@@ -2140,7 +2140,7 @@ |
3287 | return(TRUE); |
3288 | } |
3289 | |
3290 | @@ -796,16 +827,16 @@ |
3291 | |
3292 | if (log_sys->n_pending_checkpoint_writes > 0) { |
3293 | /* A checkpoint write is running */ |
3294 | -@@ -3151,6 +3151,7 @@ |
3295 | +@@ -3277,6 +3277,7 @@ |
3296 | shutdown, because the InnoDB layer may have committed or |
3297 | prepared transactions and we don't want to lose them. */ |
3298 | |
3299 | + if (!srv_apply_log_only) { |
3300 | server_busy = trx_n_mysql_transactions > 0 |
3301 | || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared; |
3302 | - mutex_exit(&kernel_mutex); |
3303 | -@@ -3158,6 +3159,9 @@ |
3304 | - if (server_busy || srv_is_any_background_thread_active()) { |
3305 | + |
3306 | +@@ -3329,6 +3330,9 @@ |
3307 | + |
3308 | goto loop; |
3309 | } |
3310 | + } else { |
3311 | @@ -867,16 +898,7 @@ |
3312 | ulint |
3313 | recv_find_max_checkpoint( |
3314 | /*=====================*/ |
3315 | -@@ -850,7 +851,7 @@ |
3316 | - InnoDB-3.23.52 where the checksum field contains the log block number. |
3317 | - @return TRUE if ok, or if the log block may be in the format of InnoDB |
3318 | - version predating 3.23.52 */ |
3319 | --static |
3320 | -+//static |
3321 | - ibool |
3322 | - log_block_checksum_is_ok_or_old_format( |
3323 | - /*===================================*/ |
3324 | -@@ -1639,9 +1640,16 @@ |
3325 | +@@ -1645,9 +1646,16 @@ |
3326 | if (page_zip) { |
3327 | memset(FIL_PAGE_LSN + page_zip->data, 0, 8); |
3328 | } |
3329 | @@ -894,7 +916,7 @@ |
3330 | |
3331 | ib_uint64_t end_lsn; |
3332 | |
3333 | -@@ -1842,6 +1850,18 @@ |
3334 | +@@ -1848,6 +1856,18 @@ |
3335 | ulint zip_size = fil_space_get_zip_size(space); |
3336 | ulint page_no = recv_addr->page_no; |
3337 | |
3338 | @@ -913,7 +935,7 @@ |
3339 | if (recv_addr->state == RECV_NOT_PROCESSED) { |
3340 | if (!has_printed) { |
3341 | ut_print_timestamp(stderr); |
3342 | -@@ -1875,7 +1895,7 @@ |
3343 | +@@ -1881,7 +1901,7 @@ |
3344 | |
3345 | mutex_enter(&(recv_sys->mutex)); |
3346 | } |
3347 | @@ -922,7 +944,7 @@ |
3348 | recv_addr = HASH_GET_NEXT(addr_hash, recv_addr); |
3349 | } |
3350 | |
3351 | -@@ -2380,7 +2400,7 @@ |
3352 | +@@ -2386,7 +2406,7 @@ |
3353 | || type == MLOG_FILE_RENAME |
3354 | || type == MLOG_FILE_DELETE) { |
3355 | ut_a(space); |
3356 | @@ -931,7 +953,7 @@ |
3357 | if (recv_replay_file_ops) { |
3358 | |
3359 | /* In ibbackup --apply-log, replay an .ibd file |
3360 | -@@ -2403,7 +2423,7 @@ |
3361 | +@@ -2409,7 +2429,7 @@ |
3362 | ut_error; |
3363 | } |
3364 | } |
3365 | @@ -940,7 +962,7 @@ |
3366 | /* In normal mysqld crash recovery we do not try to |
3367 | replay file operations */ |
3368 | #ifdef UNIV_LOG_LSN_DEBUG |
3369 | -@@ -2820,8 +2840,11 @@ |
3370 | +@@ -2826,8 +2846,11 @@ |
3371 | |
3372 | fprintf(stderr, |
3373 | "InnoDB: Doing recovery: scanned up to" |
3374 | @@ -954,7 +976,7 @@ |
3375 | } |
3376 | } |
3377 | |
3378 | -@@ -2926,7 +2949,7 @@ |
3379 | +@@ -2932,7 +2955,7 @@ |
3380 | "InnoDB: Reading tablespace information" |
3381 | " from the .ibd files...\n"); |
3382 | |
3383 | @@ -963,7 +985,7 @@ |
3384 | |
3385 | /* If we are using the doublewrite method, we will |
3386 | check if there are half-written pages in data files, |
3387 | -@@ -2935,12 +2958,14 @@ |
3388 | +@@ -2941,12 +2964,14 @@ |
3389 | |
3390 | if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) { |
3391 | |
3392 | @@ -979,7 +1001,7 @@ |
3393 | } |
3394 | } |
3395 | |
3396 | -@@ -3109,6 +3134,7 @@ |
3397 | +@@ -3115,6 +3140,7 @@ |
3398 | recv_sys->recovered_lsn = checkpoint_lsn; |
3399 | |
3400 | srv_start_lsn = checkpoint_lsn; |
3401 | @@ -987,7 +1009,7 @@ |
3402 | } |
3403 | |
3404 | contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn, |
3405 | -@@ -3474,6 +3500,7 @@ |
3406 | +@@ -3480,6 +3506,7 @@ |
3407 | that the data dictionary tables will be free of any locks. |
3408 | The data dictionary latch should guarantee that there is at |
3409 | most one data dictionary transaction active at a time. */ |
3410 | @@ -995,9 +1017,52 @@ |
3411 | trx_rollback_or_clean_recovered(FALSE); |
3412 | } |
3413 | |
3414 | +--- a/storage/innobase/mem/mem0dbg.c |
3415 | ++++ b/storage/innobase/mem/mem0dbg.c |
3416 | +@@ -282,18 +282,10 @@ |
3417 | + byte* buf, /*!< in: pointer to buffer */ |
3418 | + ulint n) /*!< in: length of buffer */ |
3419 | + { |
3420 | +- byte* ptr; |
3421 | +- |
3422 | + UNIV_MEM_ASSERT_W(buf, n); |
3423 | + |
3424 | +- for (ptr = buf; ptr < buf + n; ptr++) { |
3425 | +- |
3426 | +- if (ut_rnd_gen_ibool()) { |
3427 | +- *ptr = 0xBA; |
3428 | +- } else { |
3429 | +- *ptr = 0xBE; |
3430 | +- } |
3431 | +- } |
3432 | ++ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */ |
3433 | ++ memset(buf, 0xBA, n); |
3434 | + |
3435 | + UNIV_MEM_INVALID(buf, n); |
3436 | + } |
3437 | +@@ -308,17 +300,10 @@ |
3438 | + byte* buf, /*!< in: pointer to buffer */ |
3439 | + ulint n) /*!< in: length of buffer */ |
3440 | + { |
3441 | +- byte* ptr; |
3442 | +- |
3443 | + UNIV_MEM_ASSERT_W(buf, n); |
3444 | + |
3445 | +- for (ptr = buf; ptr < buf + n; ptr++) { |
3446 | +- if (ut_rnd_gen_ibool()) { |
3447 | +- *ptr = 0xDE; |
3448 | +- } else { |
3449 | +- *ptr = 0xAD; |
3450 | +- } |
3451 | +- } |
3452 | ++ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */ |
3453 | ++ memset(buf, 0xDE, n); |
3454 | + |
3455 | + UNIV_MEM_FREE(buf, n); |
3456 | + } |
3457 | --- a/storage/innobase/os/os0file.c |
3458 | +++ b/storage/innobase/os/os0file.c |
3459 | -@@ -660,7 +660,7 @@ |
3460 | +@@ -670,7 +670,7 @@ |
3461 | } |
3462 | |
3463 | #undef USE_FILE_LOCK |
3464 | @@ -1006,7 +1071,7 @@ |
3465 | #if defined(UNIV_HOTBACKUP) || defined(__WIN__) |
3466 | /* InnoDB Hot Backup does not lock the data files. |
3467 | * On Windows, mandatory locking is used. |
3468 | -@@ -1428,7 +1428,7 @@ |
3469 | +@@ -1474,7 +1474,7 @@ |
3470 | #endif |
3471 | #ifdef UNIV_NON_BUFFERED_IO |
3472 | # ifndef UNIV_HOTBACKUP |
3473 | @@ -1015,7 +1080,7 @@ |
3474 | /* Do not use unbuffered i/o to log files because |
3475 | value 2 denotes that we do not flush the log at every |
3476 | commit, but only once per second */ |
3477 | -@@ -1444,7 +1444,7 @@ |
3478 | +@@ -1490,7 +1490,7 @@ |
3479 | attributes = 0; |
3480 | #ifdef UNIV_NON_BUFFERED_IO |
3481 | # ifndef UNIV_HOTBACKUP |
3482 | @@ -1024,7 +1089,7 @@ |
3483 | /* Do not use unbuffered i/o to log files because |
3484 | value 2 denotes that we do not flush the log at every |
3485 | commit, but only once per second */ |
3486 | -@@ -1460,8 +1460,9 @@ |
3487 | +@@ -1506,8 +1506,9 @@ |
3488 | attributes = 0; |
3489 | ut_error; |
3490 | } |
3491 | @@ -1035,7 +1100,7 @@ |
3492 | GENERIC_READ | GENERIC_WRITE, /* read and write |
3493 | access */ |
3494 | share_mode, /* File can be read also by other |
3495 | -@@ -1520,7 +1521,11 @@ |
3496 | +@@ -1572,7 +1573,11 @@ |
3497 | if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW |
3498 | || create_mode == OS_FILE_OPEN_RETRY) { |
3499 | mode_str = "OPEN"; |
3500 | @@ -1048,7 +1113,7 @@ |
3501 | } else if (create_mode == OS_FILE_CREATE) { |
3502 | mode_str = "CREATE"; |
3503 | create_flag = O_RDWR | O_CREAT | O_EXCL; |
3504 | -@@ -2791,6 +2796,9 @@ |
3505 | +@@ -2888,6 +2893,9 @@ |
3506 | ut_a((offset & 0xFFFFFFFFUL) == offset); |
3507 | ut_a((n & 0xFFFFFFFFUL) == n); |
3508 | |
3509 | @@ -1058,7 +1123,7 @@ |
3510 | os_n_file_writes++; |
3511 | |
3512 | ut_ad(file); |
3513 | -@@ -2915,6 +2923,9 @@ |
3514 | +@@ -3012,6 +3020,9 @@ |
3515 | #else |
3516 | ssize_t ret; |
3517 | |
3518 | @@ -1089,19 +1154,20 @@ |
3519 | } |
3520 | --- a/storage/innobase/srv/srv0srv.c |
3521 | +++ b/storage/innobase/srv/srv0srv.c |
3522 | -@@ -87,11 +87,6 @@ |
3523 | +@@ -90,12 +90,6 @@ |
3524 | #include "mysql/plugin.h" |
3525 | #include "mysql/service_thd_wait.h" |
3526 | |
3527 | -/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */ |
3528 | -ibool innobase_thd_is_idle(const void* thd); |
3529 | -ib_int64_t innobase_thd_get_start_time(const void* thd); |
3530 | --void innobase_thd_kill(void* thd); |
3531 | +-void innobase_thd_kill(ulong thd_id); |
3532 | +-ulong innobase_thd_get_thread_id(const void* thd); |
3533 | - |
3534 | /* prototypes for new functions added to ha_innodb.cc */ |
3535 | ibool innobase_get_slow_log(); |
3536 | |
3537 | -@@ -198,8 +193,7 @@ |
3538 | +@@ -212,8 +206,7 @@ |
3539 | UNIV_INTERN ulint srv_log_file_size = ULINT_MAX; |
3540 | /* size in database pages */ |
3541 | UNIV_INTERN ulint srv_log_buffer_size = ULINT_MAX; |
3542 | @@ -1111,10 +1177,10 @@ |
3543 | |
3544 | /* Try to flush dirty pages so as to avoid IO bursts at |
3545 | the checkpoints. */ |
3546 | -@@ -457,6 +451,11 @@ |
3547 | +@@ -435,6 +428,11 @@ |
3548 | + UNIV_INTERN ulint srv_pass_corrupt_table = 0; /* 0:disable 1:enable */ |
3549 | + |
3550 | UNIV_INTERN ulint srv_dict_size_limit = 0; |
3551 | - |
3552 | - UNIV_INTERN ulint srv_lazy_drop_table = 0; |
3553 | + |
3554 | +UNIV_INTERN ibool srv_read_only = FALSE; |
3555 | +UNIV_INTERN ibool srv_fake_write = FALSE; |
3556 | @@ -1123,7 +1189,7 @@ |
3557 | /*-------------------------------------------*/ |
3558 | UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; |
3559 | UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; |
3560 | -@@ -1137,7 +1136,7 @@ |
3561 | +@@ -1185,7 +1183,7 @@ |
3562 | } |
3563 | |
3564 | /* Initialize some INFORMATION SCHEMA internal structures */ |
3565 | @@ -1132,7 +1198,7 @@ |
3566 | } |
3567 | |
3568 | /*********************************************************************//** |
3569 | -@@ -1148,6 +1147,7 @@ |
3570 | +@@ -1196,6 +1194,7 @@ |
3571 | /*==========*/ |
3572 | { |
3573 | os_fast_mutex_free(&srv_conc_mutex); |
3574 | @@ -1140,7 +1206,7 @@ |
3575 | mem_free(srv_conc_slots); |
3576 | srv_conc_slots = NULL; |
3577 | |
3578 | -@@ -1161,6 +1161,7 @@ |
3579 | +@@ -1209,6 +1208,7 @@ |
3580 | srv_mysql_table = NULL; |
3581 | |
3582 | trx_i_s_cache_free(trx_i_s_cache); |
3583 | @@ -1148,7 +1214,7 @@ |
3584 | } |
3585 | |
3586 | /*********************************************************************//** |
3587 | -@@ -1886,7 +1887,7 @@ |
3588 | +@@ -1938,7 +1938,7 @@ |
3589 | } |
3590 | |
3591 | /* Record the lock wait time for this thread */ |
3592 | @@ -1157,7 +1223,7 @@ |
3593 | } |
3594 | |
3595 | if (trx->was_chosen_as_deadlock_victim) { |
3596 | -@@ -2842,36 +2843,6 @@ |
3597 | +@@ -2946,36 +2946,6 @@ |
3598 | old_sema = sema; |
3599 | } |
3600 | |
3601 | @@ -1169,12 +1235,12 @@ |
3602 | - mutex_enter(&kernel_mutex); |
3603 | - trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list); |
3604 | - while (trx) { |
3605 | -- if (trx->conc_state == TRX_ACTIVE |
3606 | +- if (trx->state == TRX_ACTIVE |
3607 | - && trx->mysql_thd |
3608 | - && innobase_thd_is_idle(trx->mysql_thd)) { |
3609 | -- ib_int64_t start_time; /* as stmt ID */ |
3610 | +- ib_int64_t start_time = innobase_thd_get_start_time(trx->mysql_thd); |
3611 | +- ulong thd_id = innobase_thd_get_thread_id(trx->mysql_thd); |
3612 | - |
3613 | -- start_time = innobase_thd_get_start_time(trx->mysql_thd); |
3614 | - if (trx->last_stmt_start != start_time) { |
3615 | - trx->idle_start = now; |
3616 | - trx->last_stmt_start = start_time; |
3617 | @@ -1182,7 +1248,7 @@ |
3618 | - > srv_kill_idle_transaction) { |
3619 | - /* kill the session */ |
3620 | - mutex_exit(&kernel_mutex); |
3621 | -- innobase_thd_kill(trx->mysql_thd); |
3622 | +- innobase_thd_kill(thd_id); |
3623 | - goto rescan_idle; |
3624 | - } |
3625 | - } |
3626 | @@ -1196,7 +1262,7 @@ |
3627 | |
3628 | --- a/storage/innobase/srv/srv0start.c |
3629 | +++ b/storage/innobase/srv/srv0start.c |
3630 | -@@ -62,6 +62,7 @@ |
3631 | +@@ -63,6 +63,7 @@ |
3632 | #include "ibuf0ibuf.h" |
3633 | #include "srv0start.h" |
3634 | #include "srv0srv.h" |
3635 | @@ -1204,7 +1270,7 @@ |
3636 | #ifndef UNIV_HOTBACKUP |
3637 | # include "os0proc.h" |
3638 | # include "sync0sync.h" |
3639 | -@@ -94,6 +95,8 @@ |
3640 | +@@ -95,6 +96,8 @@ |
3641 | /** Log sequence number at shutdown */ |
3642 | UNIV_INTERN ib_uint64_t srv_shutdown_lsn; |
3643 | |
3644 | @@ -1213,7 +1279,7 @@ |
3645 | #ifdef HAVE_DARWIN_THREADS |
3646 | # include <sys/utsname.h> |
3647 | /** TRUE if the F_FULLFSYNC option is available */ |
3648 | -@@ -549,7 +552,7 @@ |
3649 | +@@ -551,7 +554,7 @@ |
3650 | /*********************************************************************//** |
3651 | Creates or opens the log files and closes them. |
3652 | @return DB_SUCCESS or error code */ |
3653 | @@ -1222,7 +1288,7 @@ |
3654 | ulint |
3655 | open_or_create_log_file( |
3656 | /*====================*/ |
3657 | -@@ -709,7 +712,7 @@ |
3658 | +@@ -711,7 +714,7 @@ |
3659 | /*********************************************************************//** |
3660 | Creates or opens database data files and closes them. |
3661 | @return DB_SUCCESS or error code */ |
3662 | @@ -1231,7 +1297,7 @@ |
3663 | ulint |
3664 | open_or_create_data_files( |
3665 | /*======================*/ |
3666 | -@@ -1875,6 +1878,10 @@ |
3667 | +@@ -1934,6 +1937,10 @@ |
3668 | are initialized in trx_sys_init_at_db_start(). */ |
3669 | |
3670 | recv_recovery_from_checkpoint_finish(); |
3671 | @@ -1242,7 +1308,7 @@ |
3672 | if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { |
3673 | /* The following call is necessary for the insert |
3674 | buffer to work with multiple tablespaces. We must |
3675 | -@@ -2054,6 +2061,17 @@ |
3676 | +@@ -2119,6 +2126,17 @@ |
3677 | if (!srv_auto_extend_last_data_file |
3678 | && sum_of_data_file_sizes != tablespace_size_in_header) { |
3679 | |
3680 | @@ -1260,7 +1326,7 @@ |
3681 | ut_print_timestamp(stderr); |
3682 | fprintf(stderr, |
3683 | " InnoDB: Error: tablespace size" |
3684 | -@@ -2133,6 +2151,7 @@ |
3685 | +@@ -2198,6 +2216,7 @@ |
3686 | |
3687 | return(DB_ERROR); |
3688 | } |
3689 | @@ -1268,7 +1334,7 @@ |
3690 | } |
3691 | |
3692 | /* Check that os_fast_mutexes work as expected */ |
3693 | -@@ -2157,6 +2176,10 @@ |
3694 | +@@ -2222,6 +2241,10 @@ |
3695 | |
3696 | os_fast_mutex_free(&srv_os_test_mutex); |
3697 | |
3698 | @@ -1279,7 +1345,7 @@ |
3699 | if (!srv_file_per_table_original_value |
3700 | && srv_pass_corrupt_table) { |
3701 | fprintf(stderr, "InnoDB: Warning:" |
3702 | -@@ -2252,6 +2275,7 @@ |
3703 | +@@ -2317,6 +2340,7 @@ |
3704 | ibuf_update_max_tablespace_id(); |
3705 | } |
3706 | |
3707 | @@ -1287,9 +1353,33 @@ |
3708 | srv_file_per_table = srv_file_per_table_original_value; |
3709 | |
3710 | srv_was_started = TRUE; |
3711 | +--- a/storage/innobase/sync/sync0arr.c |
3712 | ++++ b/storage/innobase/sync/sync0arr.c |
3713 | +@@ -41,6 +41,7 @@ |
3714 | + #include "os0file.h" |
3715 | + #include "srv0srv.h" |
3716 | + #include "ha_prototypes.h" |
3717 | ++#include "xb0xb.h" |
3718 | + |
3719 | + /* |
3720 | + WAIT ARRAY |
3721 | +@@ -927,6 +928,13 @@ |
3722 | + return(FALSE); |
3723 | + } |
3724 | + |
3725 | ++ if (srv_rebuild_indexes) { |
3726 | ++ |
3727 | ++ /* Avoid long semaphore warnings when rebuilding indexes */ |
3728 | ++ |
3729 | ++ return(FALSE); |
3730 | ++ } |
3731 | ++ |
3732 | + #ifdef UNIV_DEBUG_VALGRIND |
3733 | + /* Increase the timeouts if running under valgrind because it executes |
3734 | + extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that |
3735 | --- a/storage/innobase/trx/trx0purge.c |
3736 | +++ b/storage/innobase/trx/trx0purge.c |
3737 | -@@ -1129,6 +1129,9 @@ |
3738 | +@@ -1149,6 +1149,9 @@ |
3739 | que_thr_t* thr; |
3740 | ulint old_pages_handled; |
3741 | |
3742 | @@ -1315,7 +1405,7 @@ |
3743 | |
3744 | --- a/storage/innobase/trx/trx0sys.c |
3745 | +++ b/storage/innobase/trx/trx0sys.c |
3746 | -@@ -1952,12 +1952,14 @@ |
3747 | +@@ -2000,12 +2000,14 @@ |
3748 | mem_free(trx_doublewrite); |
3749 | trx_doublewrite = NULL; |
3750 | |
3751 | @@ -1330,7 +1420,7 @@ |
3752 | |
3753 | /* There can't be any active transactions. */ |
3754 | rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list); |
3755 | -@@ -1983,10 +1985,12 @@ |
3756 | +@@ -2031,10 +2033,12 @@ |
3757 | UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view); |
3758 | } |
3759 | |
3760 | @@ -1341,36 +1431,36 @@ |
3761 | ut_a(UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0); |
3762 | + } |
3763 | |
3764 | - mem_free(trx_sys); |
3765 | - |
3766 | + ut_ad(trx_sys->descr_n_used == 0); |
3767 | + ut_free(trx_sys->descriptors); |
3768 | --- a/storage/innobase/trx/trx0trx.c |
3769 | +++ b/storage/innobase/trx/trx0trx.c |
3770 | -@@ -563,9 +563,8 @@ |
3771 | - (ullint) trx->id); |
3772 | +@@ -692,8 +692,8 @@ |
3773 | |
3774 | if (srv_force_recovery == 0) { |
3775 | -- |
3776 | -- trx->conc_state = TRX_PREPARED; |
3777 | + |
3778 | +- trx->state = TRX_PREPARED; |
3779 | - trx_n_prepared++; |
3780 | -+ /* xtrabackup should rollback it */ |
3781 | -+ trx->conc_state = TRX_ACTIVE; |
3782 | ++ /* xtrabackup should rollback it */ |
3783 | ++ trx->state = TRX_ACTIVE; |
3784 | } else { |
3785 | fprintf(stderr, |
3786 | "InnoDB: Since" |
3787 | -@@ -639,10 +638,9 @@ |
3788 | - (ullint) trx->id); |
3789 | +@@ -772,9 +772,11 @@ |
3790 | |
3791 | if (srv_force_recovery == 0) { |
3792 | -- |
3793 | -+ /* xtrabackup should rollback it */ |
3794 | - trx->conc_state |
3795 | + |
3796 | ++ /* xtrabackup should |
3797 | ++ rollback it */ |
3798 | + trx->state |
3799 | - = TRX_PREPARED; |
3800 | - trx_n_prepared++; |
3801 | + = TRX_ACTIVE; |
3802 | ++ trx_reserve_descriptor(trx); |
3803 | } else { |
3804 | fprintf(stderr, |
3805 | "InnoDB: Since" |
3806 | -@@ -1051,7 +1049,6 @@ |
3807 | +@@ -1211,7 +1213,6 @@ |
3808 | trx->read_view = NULL; |
3809 | |
3810 | if (lsn) { |
3811 | @@ -1378,7 +1468,7 @@ |
3812 | |
3813 | mutex_exit(&kernel_mutex); |
3814 | |
3815 | -@@ -1060,12 +1057,6 @@ |
3816 | +@@ -1220,12 +1221,6 @@ |
3817 | trx_undo_insert_cleanup(trx); |
3818 | } |
3819 | |
3820 | @@ -1391,7 +1481,7 @@ |
3821 | /* NOTE that we could possibly make a group commit more |
3822 | efficient here: call os_thread_yield here to allow also other |
3823 | trxs to come to commit! */ |
3824 | -@@ -1097,9 +1088,9 @@ |
3825 | +@@ -1257,9 +1252,9 @@ |
3826 | if (trx->flush_log_later) { |
3827 | /* Do nothing yet */ |
3828 | trx->must_flush_log_later = TRUE; |
3829 | @@ -1403,7 +1493,7 @@ |
3830 | if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) { |
3831 | /* Write the log but do not flush it to disk */ |
3832 | |
3833 | -@@ -1111,7 +1102,7 @@ |
3834 | +@@ -1271,7 +1266,7 @@ |
3835 | |
3836 | log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE); |
3837 | } |
3838 | @@ -1412,7 +1502,7 @@ |
3839 | |
3840 | /* Write the log but do not flush it to disk */ |
3841 | |
3842 | -@@ -1791,23 +1782,16 @@ |
3843 | +@@ -1956,23 +1951,16 @@ |
3844 | trx_t* trx) /*!< in: trx handle */ |
3845 | { |
3846 | ib_uint64_t lsn = trx->commit_lsn; |
3847 | @@ -1438,7 +1528,7 @@ |
3848 | if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) { |
3849 | /* Write the log but do not flush it to disk */ |
3850 | |
3851 | -@@ -1818,7 +1802,7 @@ |
3852 | +@@ -1983,7 +1971,7 @@ |
3853 | |
3854 | log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE); |
3855 | } |
3856 | @@ -1447,7 +1537,7 @@ |
3857 | |
3858 | /* Write the log but do not flush it to disk */ |
3859 | |
3860 | -@@ -2066,7 +2050,6 @@ |
3861 | +@@ -2252,7 +2240,6 @@ |
3862 | /*--------------------------------------*/ |
3863 | |
3864 | if (lsn) { |
3865 | @@ -1455,7 +1545,7 @@ |
3866 | |
3867 | /* Depending on the my.cnf options, we may now write the log |
3868 | buffer to the log files, making the prepared state of the |
3869 | -@@ -2087,15 +2070,9 @@ |
3870 | +@@ -2273,15 +2260,9 @@ |
3871 | |
3872 | mutex_exit(&kernel_mutex); |
3873 | |
3874 | @@ -1473,7 +1563,7 @@ |
3875 | if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) { |
3876 | /* Write the log but do not flush it to disk */ |
3877 | |
3878 | -@@ -2107,7 +2084,7 @@ |
3879 | +@@ -2293,7 +2274,7 @@ |
3880 | |
3881 | log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE); |
3882 | } |
3883 | @@ -1482,94 +1572,14 @@ |
3884 | |
3885 | /* Write the log but do not flush it to disk */ |
3886 | |
3887 | ---- a/configure.cmake |
3888 | -+++ b/configure.cmake |
3889 | -@@ -149,7 +149,9 @@ |
3890 | - SET(CMAKE_REQUIRED_LIBRARIES |
3891 | - ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT}) |
3892 | - |
3893 | -- LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES) |
3894 | -+ IF(CMAKE_REQUIRED_LIBRARIES) |
3895 | -+ LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES) |
3896 | -+ ENDIF() |
3897 | - LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT}) |
3898 | - |
3899 | - OPTION(WITH_LIBWRAP "Compile with tcp wrappers support" OFF) |
3900 | ---- a/storage/innobase/sync/sync0arr.c |
3901 | -+++ b/storage/innobase/sync/sync0arr.c |
3902 | -@@ -41,6 +41,7 @@ |
3903 | - #include "os0file.h" |
3904 | - #include "srv0srv.h" |
3905 | - #include "ha_prototypes.h" |
3906 | -+#include "xb0xb.h" |
3907 | - |
3908 | - /* |
3909 | - WAIT ARRAY |
3910 | -@@ -926,6 +927,13 @@ |
3911 | - ibool fatal = FALSE; |
3912 | - double longest_diff = 0; |
3913 | - |
3914 | -+ if (srv_rebuild_indexes) { |
3915 | -+ |
3916 | -+ /* Avoid long semaphore warnings when rebuilding indexes */ |
3917 | -+ |
3918 | -+ return(FALSE); |
3919 | -+ } |
3920 | -+ |
3921 | - #ifdef UNIV_DEBUG_VALGRIND |
3922 | - /* Increase the timeouts if running under valgrind because it executes |
3923 | - extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that |
3924 | ---- a/storage/innobase/include/buf0buf.h |
3925 | -+++ b/storage/innobase/include/buf0buf.h |
3926 | -@@ -1509,6 +1509,8 @@ |
3927 | - frees a page in buffer pool */ |
3928 | - # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ |
3929 | - #endif /* !UNIV_HOTBACKUP */ |
3930 | -+ ibool is_compacted; /*!< TRUE if the page was skipped in |
3931 | -+ compact backups */ |
3932 | - }; |
3933 | - |
3934 | - /** The buffer control block structure */ |
3935 | ---- a/storage/innobase/mem/mem0dbg.c |
3936 | -+++ b/storage/innobase/mem/mem0dbg.c |
3937 | -@@ -280,18 +280,10 @@ |
3938 | - byte* buf, /*!< in: pointer to buffer */ |
3939 | - ulint n) /*!< in: length of buffer */ |
3940 | - { |
3941 | -- byte* ptr; |
3942 | -- |
3943 | - UNIV_MEM_ASSERT_W(buf, n); |
3944 | - |
3945 | -- for (ptr = buf; ptr < buf + n; ptr++) { |
3946 | -- |
3947 | -- if (ut_rnd_gen_ibool()) { |
3948 | -- *ptr = 0xBA; |
3949 | -- } else { |
3950 | -- *ptr = 0xBE; |
3951 | -- } |
3952 | -- } |
3953 | -+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */ |
3954 | -+ memset(buf, 0xBA, n); |
3955 | - |
3956 | - UNIV_MEM_INVALID(buf, n); |
3957 | - } |
3958 | -@@ -306,17 +298,10 @@ |
3959 | - byte* buf, /*!< in: pointer to buffer */ |
3960 | - ulint n) /*!< in: length of buffer */ |
3961 | - { |
3962 | -- byte* ptr; |
3963 | -- |
3964 | - UNIV_MEM_ASSERT_W(buf, n); |
3965 | - |
3966 | -- for (ptr = buf; ptr < buf + n; ptr++) { |
3967 | -- if (ut_rnd_gen_ibool()) { |
3968 | -- *ptr = 0xDE; |
3969 | -- } else { |
3970 | -- *ptr = 0xAD; |
3971 | -- } |
3972 | -- } |
3973 | -+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */ |
3974 | -+ memset(buf, 0xDE, n); |
3975 | - |
3976 | - UNIV_MEM_FREE(buf, n); |
3977 | - } |
3978 | +--- a/storage/innobase/row/row0merge.c |
3979 | ++++ b/storage/innobase/row/row0merge.c |
3980 | +@@ -2774,7 +2774,7 @@ |
3981 | + ut_ad(indexes); |
3982 | + ut_ad(n_indexes); |
3983 | + |
3984 | +- merge_sort_block_size = thd_merge_sort_block_size(trx->mysql_thd); |
3985 | ++ merge_sort_block_size = 1UL << 20; |
3986 | + |
3987 | + trx_start_if_not_started(trx); |
3988 | + |
3989 | |
3990 | === modified file 'src/Makefile' |
3991 | --- src/Makefile 2013-05-18 03:04:06 +0000 |
3992 | +++ src/Makefile 2013-07-22 14:01:36 +0000 |
3993 | @@ -183,7 +183,7 @@ |
3994 | usr0sess.o ut0byte.o ut0dbg.o \ |
3995 | ut0list.o ut0mem.o ut0rnd.o \ |
3996 | ut0ut.o ut0vec.o ut0wqueue.o \ |
3997 | - ut0rbt.o) |
3998 | + ut0rbt.o log0online.o) |
3999 | xtradb: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a \ |
4000 | strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a) |
4001 | xtradb: DEFS += -DXTRADB_BASED |
4002 | |
4003 | === modified file 'src/compact.cc' |
4004 | --- src/compact.cc 2013-05-03 05:17:03 +0000 |
4005 | +++ src/compact.cc 2013-07-22 14:01:36 +0000 |
4006 | @@ -815,7 +815,7 @@ |
4007 | index->to_be_dropped = 1; |
4008 | |
4009 | /* Patch up any FK referencing this index with NULL */ |
4010 | - dict_foreign_replace_index(table, index, trx); |
4011 | + dict_foreign_replace_index(table, NULL, index); |
4012 | |
4013 | dict_index_remove_from_cache(table, index); |
4014 | |
4015 | |
4016 | === modified file 'src/innodb_int.cc' |
4017 | --- src/innodb_int.cc 2013-04-27 12:08:11 +0000 |
4018 | +++ src/innodb_int.cc 2013-07-22 14:01:36 +0000 |
4019 | @@ -47,6 +47,25 @@ |
4020 | |
4021 | long innobase_mirrored_log_groups = 1; |
4022 | |
4023 | +/******************************************************//** |
4024 | +Reads a specified log segment to a buffer. */ |
4025 | +UNIV_INTERN |
4026 | +void |
4027 | +xb_log_group_read_log_seg( |
4028 | +/*===================*/ |
4029 | + ulint type, /*!< in: LOG_ARCHIVE or LOG_RECOVER */ |
4030 | + byte* buf, /*!< in: buffer where to read */ |
4031 | + log_group_t* group, /*!< in: log group */ |
4032 | + ib_uint64_t start_lsn, /*!< in: read area start */ |
4033 | + ib_uint64_t end_lsn) /*!< in: read area end */ |
4034 | +{ |
4035 | +#if defined(XTRADB_BASED) && !defined(XTRADB55) |
4036 | + log_group_read_log_seg(type, buf, group, start_lsn, end_lsn, FALSE); |
4037 | +#else |
4038 | + log_group_read_log_seg(type, buf, group, start_lsn, end_lsn); |
4039 | +#endif |
4040 | +} |
4041 | + |
4042 | /****************************************************************//** |
4043 | A simple function to open or create a file. |
4044 | @return own: handle to the file, not defined if error, error number |
4045 | @@ -244,7 +263,7 @@ |
4046 | if (!ret) { |
4047 | msg("xtrabackup: cannot set size for file %s\n", path); |
4048 | os_file_close(*file); |
4049 | - os_file_delete(path); |
4050 | + xb_file_delete(path); |
4051 | return ret; |
4052 | } |
4053 | |
4054 | @@ -289,7 +308,7 @@ |
4055 | msg("xtrabackup: could not write the first page to %s\n", |
4056 | path); |
4057 | os_file_close(*file); |
4058 | - os_file_delete(path); |
4059 | + xb_file_delete(path); |
4060 | return ret; |
4061 | } |
4062 | |
4063 | @@ -334,6 +353,43 @@ |
4064 | /* do nothing */ |
4065 | } |
4066 | |
4067 | +my_bool |
4068 | +innobase_check_identifier_length( |
4069 | +/*=============================*/ |
4070 | + const char* id __attribute__((unused))) |
4071 | +{ |
4072 | + msg("xtrabackup: innobase_check_identifier_length() called.\n"); |
4073 | + ut_a(0); |
4074 | + return(false); |
4075 | +} |
4076 | + |
4077 | +uint |
4078 | +innobase_convert_to_filename_charset( |
4079 | +/*=================================*/ |
4080 | + char* to __attribute__((unused)), |
4081 | + const char* from __attribute__((unused)), |
4082 | + ulint len __attribute__((unused))) |
4083 | +{ |
4084 | + msg("xtrabackup: innobase_convert_to_filename_charset() called.\n"); |
4085 | + ut_a(0); |
4086 | + |
4087 | + return(0); |
4088 | +} |
4089 | + |
4090 | +uint |
4091 | +innobase_convert_to_system_charset( |
4092 | +/*=================================*/ |
4093 | + char* to __attribute__((unused)), |
4094 | + const char* from __attribute__((unused)), |
4095 | + ulint len __attribute__((unused)), |
4096 | + uint* errors __attribute__((unused))) |
4097 | +{ |
4098 | + msg("xtrabackup: innobase_convert_to__charset() called.\n"); |
4099 | + ut_a(0); |
4100 | + |
4101 | + return(0); |
4102 | +} |
4103 | + |
4104 | #if MYSQL_VERSION_ID >= 50500 |
4105 | |
4106 | /**********************************************************************//** |
4107 | |
4108 | === modified file 'src/innodb_int.h' |
4109 | --- src/innodb_int.h 2013-05-04 05:26:19 +0000 |
4110 | +++ src/innodb_int.h 2013-07-22 14:01:36 +0000 |
4111 | @@ -144,6 +144,8 @@ |
4112 | fil_rename_tablespace(old_name_in, id, new_name, new_path) |
4113 | # define xb_btr_root_block_get(index, mode, mtr) \ |
4114 | btr_root_block_get(index, mode, mtr) |
4115 | +# define xb_file_delete(path) \ |
4116 | + os_file_delete_func(path) |
4117 | typedef ib_mutex_t mutex_t; |
4118 | # define INNODB_LOG_DIR srv_log_group_home_dir |
4119 | # define DEFAULT_LOG_FILE_SIZE 48*1024*1024 |
4120 | @@ -154,6 +156,7 @@ |
4121 | # define xb_os_event_create(name) os_event_create() |
4122 | #else /* MYSQL_VERSION_ID >= 50600 */ |
4123 | /* MySQL and Percona Server 5.1 and 5.5 */ |
4124 | +# define xb_file_delete(path) os_file_delete(path) |
4125 | # define xb_buf_page_is_corrupted(page, zip_size) \ |
4126 | buf_page_is_corrupted(page, zip_size) |
4127 | # define xb_os_event_create(name) os_event_create(name) |
4128 | @@ -360,6 +363,7 @@ |
4129 | .ibd file of tablespace and want to |
4130 | stop temporarily posting of new i/o |
4131 | requests on the file */ |
4132 | +#if MYSQL_VERSION_ID < 50500 |
4133 | ibool stop_ibuf_merges; |
4134 | /*!< we set this TRUE when we start |
4135 | deleting a single-table tablespace */ |
4136 | @@ -370,6 +374,20 @@ |
4137 | or flush requests can be placed on this space, |
4138 | though there may be such requests still being |
4139 | processed on this space */ |
4140 | +#else |
4141 | + ibool stop_new_ops; |
4142 | + /*!< we set this TRUE when we start |
4143 | + deleting a single-table tablespace. |
4144 | + When this is set following new ops |
4145 | + are not allowed: |
4146 | + * read IO request |
4147 | + * ibuf merge |
4148 | + * file flush |
4149 | + Note that we can still possibly have |
4150 | + new write operations because we don't |
4151 | + check this flag when doing flush |
4152 | + batches. */ |
4153 | +#endif |
4154 | ulint purpose;/*!< FIL_TABLESPACE, FIL_LOG, or |
4155 | FIL_ARCH_LOG */ |
4156 | UT_LIST_BASE_NODE_T(fil_node_t) chain; |
4157 | @@ -746,14 +764,14 @@ |
4158 | lsn_t* max_flushed_lsn,/* out: */ |
4159 | ulint* sum_of_new_sizes);/* out: sum of sizes of the new files added |
4160 | */ |
4161 | - |
4162 | +#ifndef XTRADB_BASED |
4163 | ibool |
4164 | log_block_checksum_is_ok_or_old_format( |
4165 | /*===================================*/ |
4166 | /* out: TRUE if ok, or if the log block may be in the |
4167 | format of InnoDB version < 3.23.52 */ |
4168 | byte* block); /* in: pointer to a log block */ |
4169 | - |
4170 | +#endif /* XTRADB_BASED */ |
4171 | #endif /* MYSQL_VERSION_ID >= 50600 */ |
4172 | |
4173 | buf_block_t* |
4174 | @@ -801,6 +819,18 @@ |
4175 | } /* extern "C" */ |
4176 | #endif |
4177 | |
4178 | +/******************************************************//** |
4179 | +Reads a specified log segment to a buffer. */ |
4180 | +UNIV_INTERN |
4181 | +void |
4182 | +xb_log_group_read_log_seg( |
4183 | +/*===================*/ |
4184 | + ulint type, /*!< in: LOG_ARCHIVE or LOG_RECOVER */ |
4185 | + byte* buf, /*!< in: buffer where to read */ |
4186 | + log_group_t* group, /*!< in: log group */ |
4187 | + ib_uint64_t start_lsn, /*!< in: read area start */ |
4188 | + ib_uint64_t end_lsn); /*!< in: read area end */ |
4189 | + |
4190 | /****************************************************************//** |
4191 | A simple function to open or create a file. |
4192 | @return own: handle to the file, not defined if error, error number |
4193 | @@ -967,6 +997,26 @@ |
4194 | |
4195 | #if MYSQL_VERSION_ID < 50600 |
4196 | |
4197 | +my_bool |
4198 | +innobase_check_identifier_length( |
4199 | +/*=============================*/ |
4200 | + const char* id); |
4201 | + |
4202 | +uint |
4203 | +innobase_convert_to_filename_charset( |
4204 | +/*=================================*/ |
4205 | + char* to, |
4206 | + const char* from, |
4207 | + ulint len); |
4208 | + |
4209 | +uint |
4210 | +innobase_convert_to_system_charset( |
4211 | +/*=================================*/ |
4212 | + char* to, |
4213 | + const char* from, |
4214 | + ulint len, |
4215 | + uint* errors); |
4216 | + |
4217 | void |
4218 | innobase_invalidate_query_cache( |
4219 | trx_t* trx, |
4220 | |
4221 | === modified file 'src/xtrabackup.cc' |
4222 | --- src/xtrabackup.cc 2013-07-10 12:29:40 +0000 |
4223 | +++ src/xtrabackup.cc 2013-07-22 14:01:36 +0000 |
4224 | @@ -1367,6 +1367,11 @@ |
4225 | } |
4226 | #endif |
4227 | |
4228 | +#ifdef XTRADB_BASED |
4229 | + /* Workaround for LP #1203308. */ |
4230 | + srv_track_changed_pages = FALSE; |
4231 | +#endif |
4232 | + |
4233 | return(FALSE); |
4234 | |
4235 | error: |
4236 | @@ -2056,8 +2061,8 @@ |
4237 | |
4238 | mutex_enter(&log_sys->mutex); |
4239 | |
4240 | - log_group_read_log_seg(LOG_RECOVER, log_sys->buf, |
4241 | - group, start_lsn, end_lsn); |
4242 | + xb_log_group_read_log_seg(LOG_RECOVER, log_sys->buf, |
4243 | + group, start_lsn, end_lsn); |
4244 | |
4245 | |
4246 | /* reference recv_scan_log_recs() */ |
4247 | @@ -3487,11 +3492,7 @@ |
4248 | for (;;) { |
4249 | mtr_start(&local_mtr); |
4250 | |
4251 | -#if (MYSQL_VERSION_ID < 50517) |
4252 | - local_block = btr_block_get(space_id, zip_size, page_no, RW_S_LATCH, &local_mtr); |
4253 | -#else |
4254 | local_block = btr_block_get(space_id, zip_size, page_no, RW_S_LATCH, index, &local_mtr); |
4255 | -#endif |
4256 | local_page = buf_block_get_frame(local_block); |
4257 | blob_header = local_page + offset; |
4258 | #define BTR_BLOB_HDR_PART_LEN 0 |
4259 | @@ -3532,13 +3533,8 @@ |
4260 | mtr_commit(&mtr); |
4261 | if (right_page_no != FIL_NULL) { |
4262 | mtr_start(&mtr); |
4263 | -#if (MYSQL_VERSION_ID < 50517) |
4264 | - block = btr_block_get(space, zip_size, right_page_no, |
4265 | - RW_X_LATCH, &mtr); |
4266 | -#else |
4267 | block = btr_block_get(space, zip_size, right_page_no, |
4268 | RW_X_LATCH, index, &mtr); |
4269 | -#endif |
4270 | page = buf_block_get_frame(block); |
4271 | goto loop; |
4272 | } |
4273 | @@ -4565,7 +4561,7 @@ |
4274 | if (!table) { |
4275 | snprintf(name, FN_REFLEN, "%s/%s/%s", data_home_dir, |
4276 | db_name, file_name); |
4277 | - return os_file_delete(name); |
4278 | + return xb_file_delete(name); |
4279 | } |
4280 | |
4281 | return(TRUE); |
4282 | |
4283 | === modified file 'utils/build.sh' |
4284 | --- utils/build.sh 2013-06-05 08:39:54 +0000 |
4285 | +++ utils/build.sh 2013-07-22 14:01:36 +0000 |
4286 | @@ -2,9 +2,9 @@ |
4287 | |
4288 | set -e |
4289 | |
4290 | -MYSQL_51_VERSION=5.1.59 |
4291 | -MYSQL_55_VERSION=5.5.17 |
4292 | -MYSQL_56_VERSION=5.6.10 |
4293 | +MYSQL_51_VERSION=5.1.70 |
4294 | +MYSQL_55_VERSION=5.5.31 |
4295 | +MYSQL_56_VERSION=5.6.11 |
4296 | PS_51_VERSION=5.1.59-13.0 |
4297 | PS_55_VERSION=5.5.16-22.0 |
4298 | |
4299 | @@ -125,10 +125,11 @@ |
4300 | ################################################################################ |
4301 | function unpack_and_patch() |
4302 | { |
4303 | + local dirname=`basename "$1" ".tar.gz"` |
4304 | tar xzf $top_dir/$1 |
4305 | - cd `basename "$1" ".tar.gz"` |
4306 | + cd $dirname |
4307 | patch -p1 < $top_dir/patches/$2 |
4308 | - cd .. |
4309 | + cd - |
4310 | } |
4311 | |
4312 | ################################################################################ |
4313 | @@ -215,8 +216,8 @@ |
4314 | { |
4315 | local type=$1 |
4316 | local mysql_version_short=${mysql_version:0:3} |
4317 | - server_dir=$top_dir/mysql-$mysql_version_short |
4318 | - server_tarball=mysql-$mysql_version.tar.gz |
4319 | + local dirname=`basename "$server_tarball" ".tar.gz"` |
4320 | + |
4321 | innodb_dir=$server_dir/storage/$innodb_name |
4322 | |
4323 | echo "Downloading sources" |
4324 | @@ -226,7 +227,7 @@ |
4325 | |
4326 | echo "Preparing sources" |
4327 | unpack_and_patch $server_tarball $server_patch |
4328 | - mv $top_dir/mysql-$mysql_version $server_dir |
4329 | + mv $top_dir/$dirname $server_dir |
4330 | |
4331 | build_server $type |
4332 | |
4333 | @@ -241,10 +242,12 @@ |
4334 | |
4335 | case "$type" in |
4336 | "innodb51") |
4337 | + server_dir=$top_dir/mysql-5.1 |
4338 | mysql_version=$MYSQL_51_VERSION |
4339 | server_patch=innodb51.patch |
4340 | innodb_name=innodb_plugin |
4341 | xtrabackup_target=plugin |
4342 | + server_tarball=mysql-5.1.70.tar.gz |
4343 | configure_cmd="./configure --enable-local-infile \ |
4344 | --enable-thread-safe-client \ |
4345 | --with-plugins=innodb_plugin \ |
4346 | @@ -255,10 +258,12 @@ |
4347 | build_all $type |
4348 | ;; |
4349 | "innodb55") |
4350 | + server_dir=$top_dir/mysql-5.5 |
4351 | mysql_version=$MYSQL_55_VERSION |
4352 | server_patch=innodb55.patch |
4353 | innodb_name=innobase |
4354 | xtrabackup_target=5.5 |
4355 | + server_tarball=mysql-5.5.31.tar.gz |
4356 | # We need to build with partitioning due to MySQL bug #58632 |
4357 | configure_cmd="cmake . \ |
4358 | -DENABLED_LOCAL_INFILE=ON \ |
4359 | @@ -272,10 +277,12 @@ |
4360 | ;; |
4361 | |
4362 | "innodb56" ) |
4363 | + server_dir=$top_dir/mysql-5.6 |
4364 | mysql_version=$MYSQL_56_VERSION |
4365 | server_patch=innodb56.patch |
4366 | innodb_name=innobase |
4367 | xtrabackup_target=5.6 |
4368 | + server_tarball=mysql-5.6.11.tar.gz |
4369 | configure_cmd="cmake . \ |
4370 | -DWITH_INNOBASE_STORAGE_ENGINE=ON \ |
4371 | -DWITH_ZLIB=bundled \ |
4372 | @@ -288,8 +295,10 @@ |
4373 | "xtradb51" ) |
4374 | server_dir=$top_dir/Percona-Server |
4375 | branch_dir=percona-server-5.1-xtrabackup |
4376 | - innodb_dir=$server_dir/storage/innodb_plugin |
4377 | - xtrabackup_target=xtradb |
4378 | + innodb_name=innodb_plugin |
4379 | + xtrabackup_target=xtradb |
4380 | + server_patch=xtradb51.patch |
4381 | + server_tarball=Percona-Server-5.1.70-rel14.8.tar.gz |
4382 | configure_cmd="./configure --enable-local-infile \ |
4383 | --enable-thread-safe-client \ |
4384 | --with-plugins=innodb_plugin \ |
4385 | @@ -301,42 +310,15 @@ |
4386 | configure_cmd="LIBS=-lrt $configure_cmd" |
4387 | fi |
4388 | |
4389 | - |
4390 | - echo "Downloading sources" |
4391 | - |
4392 | - # Get Percona Server |
4393 | - if [ -d $branch_dir ] |
4394 | - then |
4395 | - rm -rf $branch_dir |
4396 | - fi |
4397 | - |
4398 | - if [ ! -f Percona-Server-XtraBackup-$PS_51_VERSION.tar.gz ] |
4399 | - then |
4400 | - make ps51source |
4401 | - fi |
4402 | - |
4403 | - rm -rf $branch_dir |
4404 | - tar xfz Percona-Server-XtraBackup-$PS_51_VERSION.tar.gz |
4405 | - cd $branch_dir |
4406 | - $MAKE_CMD main |
4407 | - cd $top_dir |
4408 | - rm -rf $server_dir |
4409 | - ln -s $branch_dir/Percona-Server $server_dir |
4410 | - |
4411 | - # Patch Percona Server |
4412 | - cd $server_dir |
4413 | - patch -p1 < $top_dir/patches/xtradb51.patch |
4414 | - |
4415 | - build_server $type |
4416 | - |
4417 | - build_xtrabackup |
4418 | - |
4419 | + build_all $type |
4420 | ;; |
4421 | "xtradb55" ) |
4422 | server_dir=$top_dir/Percona-Server-5.5 |
4423 | branch_dir=percona-server-5.5-xtrabackup |
4424 | - innodb_dir=$server_dir/storage/innobase |
4425 | - xtrabackup_target=xtradb55 |
4426 | + innodb_name=innobase |
4427 | + xtrabackup_target=xtradb55 |
4428 | + server_patch=xtradb55.patch |
4429 | + server_tarball=Percona-Server-5.5.31-rel30.3.tar.gz |
4430 | # We need to build with partitioning due to MySQL bug #58632 |
4431 | configure_cmd="cmake . \ |
4432 | -DENABLED_LOCAL_INFILE=ON \ |
4433 | @@ -350,37 +332,7 @@ |
4434 | configure_cmd="LIBS=-lrt $configure_cmd" |
4435 | fi |
4436 | |
4437 | - |
4438 | - echo "Downloading sources" |
4439 | - |
4440 | - # Get Percona Server |
4441 | - if [ -d $branch_dir ] |
4442 | - then |
4443 | - rm -rf $branch_dir |
4444 | - fi |
4445 | - |
4446 | - if [ ! -f Percona-Server-XtraBackup-$PS_55_VERSION.tar.gz ] |
4447 | - then |
4448 | - make ps55source |
4449 | - fi |
4450 | - |
4451 | - rm -rf $branch_dir |
4452 | - tar xfz Percona-Server-XtraBackup-$PS_55_VERSION.tar.gz |
4453 | - cd $branch_dir |
4454 | - |
4455 | - $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main |
4456 | - cd $top_dir |
4457 | - rm -rf $server_dir |
4458 | - ln -s $branch_dir/Percona-Server $server_dir |
4459 | - |
4460 | - # Patch Percona Server |
4461 | - cd $server_dir |
4462 | - patch -p1 < $top_dir/patches/xtradb55.patch |
4463 | - |
4464 | - build_server $type |
4465 | - |
4466 | - build_xtrabackup |
4467 | - |
4468 | + build_all $type |
4469 | ;; |
4470 | *) |
4471 | usage |
http:// jenkins. percona. com/view/ XtraBackup/ job/percona- xtrabackup- 2.1-param/ 382/
innodb56/xtradb56 failures are bug #1203669.
galera55 failures are bug #1201686 and bug #1203668 (currently being looked at by Raghu).