Merge lp:~akopytov/percona-xtrabackup/bug722638-trunk into lp:percona-xtrabackup/2.0

Proposed by Alexey Kopytov
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 303
Proposed branch: lp:~akopytov/percona-xtrabackup/bug722638-trunk
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 2266 lines (+476/-254)
17 files modified
patches/innodb51.patch (+42/-41)
patches/innodb51_builtin.patch (+113/-37)
patches/innodb55.patch (+39/-35)
patches/xtradb51.patch (+38/-36)
patches/xtradb55.patch (+38/-36)
test/inc/common.sh (+9/-0)
test/t/bug722638.sh (+119/-0)
test/t/bug723097.sh (+2/-2)
test/t/bug810269.sh (+2/-4)
test/t/ib_csm_csv.sh (+4/-4)
test/t/ib_incremental.sh (+2/-2)
test/t/xb_export.sh (+3/-3)
test/t/xb_incremental.sh (+2/-2)
test/t/xb_incremental_compressed.sh (+2/-4)
test/t/xb_part_range.sh (+2/-2)
test/t/xb_partial.sh (+2/-2)
xtrabackup.c (+57/-44)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug722638-trunk
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Review via email: mp+75468@code.launchpad.net

Description of the change

Bug #722638: xtrabackup: taking backup while tables are droped and
created breaks backup

The root cause of the problem was that xtrabackup iterated .ibd files
based on a data dictionary snapshot taken at the very start of a backup
process. If a tablespace id changed due to dropping and recreating the
table with the same name, or an ALTER TABLE that requires a table copy,
or TRUNCATE (if it was performed as DROP + CREATE TABLE), InnoDB
complained about id mismatch, and crashed with an assertion failure.

The idea of the fix is to ignore tablespaces with wrong ids at the
backup stage. They will be (re)created when doing recovery at the prepare
stage, since the corresponding delete/create log records will be
replayed on recovery.

Fixed by modifying fil_node_open_file() in all XtraBackup patches to
InnoDB/XtraDB source to signal id mismatches back to the caller (with an
descriptive warning) rather than crash with an error.

Warning messages in xtrabackup.c were also adjusted to take this new
case into account.

This patch also introduces a new command line switch to xtrabackup,
--debug-sync, to make possible automatic testing of the fix.

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Can't link a Jenkins build as it have been stuck for a few days.

Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'patches/innodb51.patch'
--- patches/innodb51.patch 2011-06-26 03:06:10 +0000
+++ patches/innodb51.patch 2011-09-15 04:23:22 +0000
@@ -1,4 +1,3 @@
1diff -ruN a/storage/innodb_plugin/btr/btr0btr.c b/storage/innodb_plugin/btr/btr0btr.c
2--- a/storage/innodb_plugin/btr/btr0btr.c1--- a/storage/innodb_plugin/btr/btr0btr.c
3+++ b/storage/innodb_plugin/btr/btr0btr.c2+++ b/storage/innodb_plugin/btr/btr0btr.c
4@@ -120,7 +120,7 @@3@@ -120,7 +120,7 @@
@@ -19,7 +18,6 @@
19 buf_block_t*18 buf_block_t*
20 btr_node_ptr_get_child(19 btr_node_ptr_get_child(
21 /*===================*/20 /*===================*/
22diff -ruN a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c
23--- a/storage/innodb_plugin/buf/buf0buf.c21--- a/storage/innodb_plugin/buf/buf0buf.c
24+++ b/storage/innodb_plugin/buf/buf0buf.c22+++ b/storage/innodb_plugin/buf/buf0buf.c
25@@ -358,7 +358,7 @@23@@ -358,7 +358,7 @@
@@ -51,7 +49,6 @@
51 ibuf_merge_or_delete_for_page(49 ibuf_merge_or_delete_for_page(
52 (buf_block_t*) bpage, bpage->space,50 (buf_block_t*) bpage, bpage->space,
53 bpage->offset, buf_page_get_zip_size(bpage),51 bpage->offset, buf_page_get_zip_size(bpage),
54diff -ruN a/storage/innodb_plugin/buf/buf0rea.c b/storage/innodb_plugin/buf/buf0rea.c
55--- a/storage/innodb_plugin/buf/buf0rea.c52--- a/storage/innodb_plugin/buf/buf0rea.c
56+++ b/storage/innodb_plugin/buf/buf0rea.c53+++ b/storage/innodb_plugin/buf/buf0rea.c
57@@ -120,6 +120,45 @@54@@ -120,6 +120,45 @@
@@ -151,7 +148,6 @@
151 return;148 return;
152 }149 }
153 150
154diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
155--- a/storage/innodb_plugin/fil/fil0fil.c151--- a/storage/innodb_plugin/fil/fil0fil.c
156+++ b/storage/innodb_plugin/fil/fil0fil.c152+++ b/storage/innodb_plugin/fil/fil0fil.c
157@@ -48,6 +48,8 @@153@@ -48,6 +48,8 @@
@@ -190,7 +186,7 @@
190 fil_node_open_file(186 fil_node_open_file(
191 /*===============*/187 /*===============*/
192 fil_node_t* node, /*!< in: file node */188 fil_node_t* node, /*!< in: file node */
193@@ -657,7 +659,14 @@189@@ -657,7 +659,17 @@
194 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);190 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
195 if (!success) {191 if (!success) {
196 /* The following call prints an error message */192 /* The following call prints an error message */
@@ -199,14 +195,36 @@
199+ {195+ {
200+ ut_print_timestamp(stderr);196+ ut_print_timestamp(stderr);
201+ fprintf(stderr,197+ fprintf(stderr,
202+ " InnoDB: Warning: cannot open %s\n",198+ " InnoDB: Warning: cannot open %s\n"
199+ "InnoDB: this can happen if the table "
200+ "was removed or renamed during an \n"
201+ "InnoDB: xtrabackup run and is not dangerous.\n",
203+ node->name);202+ node->name);
204+ return(OS_FILE_NOT_FOUND);203+ return(OS_FILE_NOT_FOUND);
205+ }204+ }
206 205
207 ut_print_timestamp(stderr);206 ut_print_timestamp(stderr);
208 207
209@@ -747,8 +756,8 @@208@@ -718,12 +730,15 @@
209
210 if (UNIV_UNLIKELY(space_id != space->id)) {
211 fprintf(stderr,
212- "InnoDB: Error: tablespace id is %lu"
213+ "InnoDB: Warning: tablespace id is %lu"
214 " in the data dictionary\n"
215- "InnoDB: but in file %s it is %lu!\n",
216+ "InnoDB: but in file %s it is %lu!\n"
217+ "InnoDB: this can happen if the table metadata "
218+ "was modified during an xtrabackup run\n"
219+ "InnoDB: and is not dangerous.\n",
220 space->id, node->name, space_id);
221
222- ut_error;
223+ return(OS_FILE_NOT_FOUND);
224 }
225
226 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
227@@ -747,8 +762,8 @@
210 }228 }
211 229
212 if (size_bytes >= 1024 * 1024) {230 if (size_bytes >= 1024 * 1024) {
@@ -217,7 +235,7 @@
217 }235 }
218 236
219 if (!(flags & DICT_TF_ZSSIZE_MASK)) {237 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
220@@ -793,6 +802,8 @@238@@ -793,6 +808,8 @@
221 /* Put the node to the LRU list */239 /* Put the node to the LRU list */
222 UT_LIST_ADD_FIRST(LRU, system->LRU, node);240 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
223 }241 }
@@ -226,7 +244,7 @@
226 }244 }
227 245
228 /**********************************************************************//**246 /**********************************************************************//**
229@@ -1418,7 +1429,12 @@247@@ -1418,7 +1435,12 @@
230 the file yet; the following calls will open it and update the248 the file yet; the following calls will open it and update the
231 size fields */249 size fields */
232 250
@@ -240,7 +258,7 @@
240 fil_node_complete_io(node, fil_system, OS_FILE_READ);258 fil_node_complete_io(node, fil_system, OS_FILE_READ);
241 }259 }
242 260
243@@ -1470,7 +1486,12 @@261@@ -1470,7 +1492,12 @@
244 the file yet; the following calls will open it and update the262 the file yet; the following calls will open it and update the
245 size fields */263 size fields */
246 264
@@ -254,7 +272,7 @@
254 fil_node_complete_io(node, fil_system, OS_FILE_READ);272 fil_node_complete_io(node, fil_system, OS_FILE_READ);
255 }273 }
256 274
257@@ -1910,7 +1931,7 @@275@@ -1910,7 +1937,7 @@
258 mem_free(path);276 mem_free(path);
259 }277 }
260 278
@@ -263,7 +281,7 @@
263 /********************************************************//**281 /********************************************************//**
264 Writes a log record about an .ibd file create/rename/delete. */282 Writes a log record about an .ibd file create/rename/delete. */
265 static283 static
266@@ -2134,7 +2155,7 @@284@@ -2134,7 +2161,7 @@
267 if (fil_create_new_single_table_tablespace(285 if (fil_create_new_single_table_tablespace(
268 space_id, name, FALSE, flags,286 space_id, name, FALSE, flags,
269 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {287 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
@@ -272,7 +290,7 @@
272 }290 }
273 }291 }
274 292
275@@ -2297,7 +2318,7 @@293@@ -2297,7 +2324,7 @@
276 }294 }
277 295
278 if (success) {296 if (success) {
@@ -281,7 +299,7 @@
281 /* Write a log record about the deletion of the .ibd299 /* Write a log record about the deletion of the .ibd
282 file, so that ibbackup can replay it in the300 file, so that ibbackup can replay it in the
283 --apply-log phase. We use a dummy mtr and the familiar301 --apply-log phase. We use a dummy mtr and the familiar
284@@ -2598,7 +2619,7 @@302@@ -2598,7 +2625,7 @@
285 303
286 mutex_exit(&fil_system->mutex);304 mutex_exit(&fil_system->mutex);
287 305
@@ -290,7 +308,7 @@
290 if (success) {308 if (success) {
291 mtr_t mtr;309 mtr_t mtr;
292 310
293@@ -2788,7 +2809,7 @@311@@ -2788,7 +2815,7 @@
294 312
295 fil_node_create(path, size, space_id, FALSE);313 fil_node_create(path, size, space_id, FALSE);
296 314
@@ -299,7 +317,7 @@
299 {317 {
300 mtr_t mtr;318 mtr_t mtr;
301 319
302@@ -3041,19 +3062,97 @@320@@ -3041,19 +3068,97 @@
303 "InnoDB: open the tablespace file ", stderr);321 "InnoDB: open the tablespace file ", stderr);
304 ut_print_filename(stderr, filepath);322 ut_print_filename(stderr, filepath);
305 fputs("!\n"323 fputs("!\n"
@@ -407,7 +425,7 @@
407 return(FALSE);425 return(FALSE);
408 }426 }
409 427
410@@ -3284,7 +3383,7 @@428@@ -3284,7 +3389,7 @@
411 cannot be ok. */429 cannot be ok. */
412 430
413 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;431 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
@@ -416,7 +434,7 @@
416 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {434 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
417 fprintf(stderr,435 fprintf(stderr,
418 "InnoDB: Error: the size of single-table tablespace"436 "InnoDB: Error: the size of single-table tablespace"
419@@ -3425,7 +3524,7 @@437@@ -3425,7 +3530,7 @@
420 idea is to read as much good data as we can and jump over bad data.438 idea is to read as much good data as we can and jump over bad data.
421 @return 0 if ok, -1 if error even after the retries, 1 if at the end439 @return 0 if ok, -1 if error even after the retries, 1 if at the end
422 of the directory */440 of the directory */
@@ -425,7 +443,7 @@
425 int443 int
426 fil_file_readdir_next_file(444 fil_file_readdir_next_file(
427 /*=======================*/445 /*=======================*/
428@@ -3724,15 +3823,97 @@446@@ -3724,15 +3829,97 @@
429 "InnoDB: in InnoDB data dictionary"447 "InnoDB: in InnoDB data dictionary"
430 " has tablespace id %lu,\n"448 " has tablespace id %lu,\n"
431 "InnoDB: but tablespace with that id"449 "InnoDB: but tablespace with that id"
@@ -531,7 +549,7 @@
531 } else {549 } else {
532 ut_print_timestamp(stderr);550 ut_print_timestamp(stderr);
533 fputs(" InnoDB: Error: table ", stderr);551 fputs(" InnoDB: Error: table ", stderr);
534@@ -4121,7 +4302,7 @@552@@ -4121,7 +4308,7 @@
535 off the LRU list if it is in the LRU list. The caller must hold the fil_sys553 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
536 mutex. */554 mutex. */
537 static555 static
@@ -540,7 +558,7 @@
540 fil_node_prepare_for_io(558 fil_node_prepare_for_io(
541 /*====================*/559 /*====================*/
542 fil_node_t* node, /*!< in: file node */560 fil_node_t* node, /*!< in: file node */
543@@ -4141,10 +4322,13 @@561@@ -4141,10 +4328,13 @@
544 }562 }
545 563
546 if (node->open == FALSE) {564 if (node->open == FALSE) {
@@ -555,7 +573,7 @@
555 }573 }
556 574
557 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE575 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
558@@ -4157,6 +4341,8 @@576@@ -4157,6 +4347,8 @@
559 }577 }
560 578
561 node->n_pending++;579 node->n_pending++;
@@ -564,7 +582,7 @@
564 }582 }
565 583
566 /********************************************************************//**584 /********************************************************************//**
567@@ -4292,7 +4478,9 @@585@@ -4292,7 +4484,9 @@
568 ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)586 ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)
569 || !ibuf_bitmap_page(zip_size, block_offset)587 || !ibuf_bitmap_page(zip_size, block_offset)
570 || sync || is_log);588 || sync || is_log);
@@ -575,7 +593,7 @@
575 || ibuf_page(space_id, zip_size, block_offset, NULL));593 || ibuf_page(space_id, zip_size, block_offset, NULL));
576 # endif /* UNIV_LOG_DEBUG */594 # endif /* UNIV_LOG_DEBUG */
577 if (sync) {595 if (sync) {
578@@ -4341,6 +4529,16 @@596@@ -4341,6 +4535,16 @@
579 597
580 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));598 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
581 599
@@ -592,7 +610,6 @@
592 node = UT_LIST_GET_FIRST(space->chain);610 node = UT_LIST_GET_FIRST(space->chain);
593 611
594 for (;;) {612 for (;;) {
595diff -ruN a/storage/innodb_plugin/ibuf/ibuf0ibuf.c b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
596--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c613--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c
597+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c614+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
598@@ -1061,6 +1061,9 @@615@@ -1061,6 +1061,9 @@
@@ -615,7 +632,6 @@
615 while (sum_pages < n_pages) {632 while (sum_pages < n_pages) {
616 n_bytes = ibuf_contract_ext(&n_pag2, sync);633 n_bytes = ibuf_contract_ext(&n_pag2, sync);
617 634
618diff -ruN a/storage/innodb_plugin/include/mem0mem.ic b/storage/innodb_plugin/include/mem0mem.ic
619--- a/storage/innodb_plugin/include/mem0mem.ic635--- a/storage/innodb_plugin/include/mem0mem.ic
620+++ b/storage/innodb_plugin/include/mem0mem.ic636+++ b/storage/innodb_plugin/include/mem0mem.ic
621@@ -367,7 +367,7 @@637@@ -367,7 +367,7 @@
@@ -627,7 +643,6 @@
627 #endif643 #endif
628 644
629 return(buf);645 return(buf);
630diff -ruN a/storage/innodb_plugin/include/mtr0mtr.ic b/storage/innodb_plugin/include/mtr0mtr.ic
631--- a/storage/innodb_plugin/include/mtr0mtr.ic646--- a/storage/innodb_plugin/include/mtr0mtr.ic
632+++ b/storage/innodb_plugin/include/mtr0mtr.ic647+++ b/storage/innodb_plugin/include/mtr0mtr.ic
633@@ -160,7 +160,7 @@648@@ -160,7 +160,7 @@
@@ -639,7 +654,6 @@
639 654
640 if ((object == slot->object) && (type == slot->type)) {655 if ((object == slot->object) && (type == slot->type)) {
641 656
642diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
643--- a/storage/innodb_plugin/include/srv0srv.h657--- a/storage/innodb_plugin/include/srv0srv.h
644+++ b/storage/innodb_plugin/include/srv0srv.h658+++ b/storage/innodb_plugin/include/srv0srv.h
645@@ -201,6 +201,10 @@659@@ -201,6 +201,10 @@
@@ -653,7 +667,6 @@
653 /*-------------------------------------------*/667 /*-------------------------------------------*/
654 668
655 extern ulint srv_n_rows_inserted;669 extern ulint srv_n_rows_inserted;
656diff -ruN a/storage/innodb_plugin/include/srv0start.h b/storage/innodb_plugin/include/srv0start.h
657--- a/storage/innodb_plugin/include/srv0start.h670--- a/storage/innodb_plugin/include/srv0start.h
658+++ b/storage/innodb_plugin/include/srv0start.h671+++ b/storage/innodb_plugin/include/srv0start.h
659@@ -91,6 +91,8 @@672@@ -91,6 +91,8 @@
@@ -665,7 +678,6 @@
665 #ifdef __NETWARE__678 #ifdef __NETWARE__
666 void set_panic_flag_for_netware(void);679 void set_panic_flag_for_netware(void);
667 #endif680 #endif
668diff -ruN a/storage/innodb_plugin/include/ut0byte.ic b/storage/innodb_plugin/include/ut0byte.ic
669--- a/storage/innodb_plugin/include/ut0byte.ic681--- a/storage/innodb_plugin/include/ut0byte.ic
670+++ b/storage/innodb_plugin/include/ut0byte.ic682+++ b/storage/innodb_plugin/include/ut0byte.ic
671@@ -168,6 +168,16 @@683@@ -168,6 +168,16 @@
@@ -713,7 +725,6 @@
713 return(diff);725 return(diff);
714 }726 }
715 727
716diff -ruN a/storage/innodb_plugin/log/log0log.c b/storage/innodb_plugin/log/log0log.c
717--- a/storage/innodb_plugin/log/log0log.c728--- a/storage/innodb_plugin/log/log0log.c
718+++ b/storage/innodb_plugin/log/log0log.c729+++ b/storage/innodb_plugin/log/log0log.c
719@@ -564,7 +564,9 @@730@@ -564,7 +564,9 @@
@@ -760,7 +771,6 @@
760 771
761 if (srv_fast_shutdown == 2) {772 if (srv_fast_shutdown == 2) {
762 /* In this fastest shutdown we do not flush the buffer pool:773 /* In this fastest shutdown we do not flush the buffer pool:
763diff -ruN a/storage/innodb_plugin/log/log0recv.c b/storage/innodb_plugin/log/log0recv.c
764--- a/storage/innodb_plugin/log/log0recv.c774--- a/storage/innodb_plugin/log/log0recv.c
765+++ b/storage/innodb_plugin/log/log0recv.c775+++ b/storage/innodb_plugin/log/log0recv.c
766@@ -42,27 +42,27 @@776@@ -42,27 +42,27 @@
@@ -912,7 +922,6 @@
912 trx_rollback_or_clean_recovered(FALSE);922 trx_rollback_or_clean_recovered(FALSE);
913 }923 }
914 924
915diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0file.c
916--- a/storage/innodb_plugin/os/os0file.c925--- a/storage/innodb_plugin/os/os0file.c
917+++ b/storage/innodb_plugin/os/os0file.c926+++ b/storage/innodb_plugin/os/os0file.c
918@@ -514,7 +514,7 @@927@@ -514,7 +514,7 @@
@@ -968,7 +977,6 @@
968 ret = os_file_pwrite(file, buf, n, offset, offset_high);977 ret = os_file_pwrite(file, buf, n, offset, offset_high);
969 978
970 if ((ulint)ret == n) {979 if ((ulint)ret == n) {
971diff -ruN a/storage/innodb_plugin/os/os0thread.c b/storage/innodb_plugin/os/os0thread.c
972--- a/storage/innodb_plugin/os/os0thread.c980--- a/storage/innodb_plugin/os/os0thread.c
973+++ b/storage/innodb_plugin/os/os0thread.c981+++ b/storage/innodb_plugin/os/os0thread.c
974@@ -287,12 +287,17 @@982@@ -287,12 +287,17 @@
@@ -989,7 +997,6 @@
989 #endif997 #endif
990 }998 }
991 999
992diff -ruN a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c
993--- a/storage/innodb_plugin/row/row0merge.c1000--- a/storage/innodb_plugin/row/row0merge.c
994+++ b/storage/innodb_plugin/row/row0merge.c1001+++ b/storage/innodb_plugin/row/row0merge.c
995@@ -453,7 +453,9 @@1002@@ -453,7 +453,9 @@
@@ -1030,7 +1037,6 @@
1030 1037
1031 /* Read clustered index of the table and create files for1038 /* Read clustered index of the table and create files for
1032 secondary index entries for merge sort */1039 secondary index entries for merge sort */
1033diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
1034--- a/storage/innodb_plugin/srv/srv0srv.c1040--- a/storage/innodb_plugin/srv/srv0srv.c
1035+++ b/storage/innodb_plugin/srv/srv0srv.c1041+++ b/storage/innodb_plugin/srv/srv0srv.c
1036@@ -372,6 +372,9 @@1042@@ -372,6 +372,9 @@
@@ -1068,7 +1074,6 @@
1068 }1074 }
1069 1075
1070 /*********************************************************************//**1076 /*********************************************************************//**
1071diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
1072--- a/storage/innodb_plugin/srv/srv0start.c1077--- a/storage/innodb_plugin/srv/srv0start.c
1073+++ b/storage/innodb_plugin/srv/srv0start.c1078+++ b/storage/innodb_plugin/srv/srv0start.c
1074@@ -94,6 +94,8 @@1079@@ -94,6 +94,8 @@
@@ -1153,7 +1158,6 @@
1153 srv_file_per_table = srv_file_per_table_original_value;1158 srv_file_per_table = srv_file_per_table_original_value;
1154 1159
1155 srv_was_started = TRUE;1160 srv_was_started = TRUE;
1156diff -ruN a/storage/innodb_plugin/trx/trx0purge.c b/storage/innodb_plugin/trx/trx0purge.c
1157--- a/storage/innodb_plugin/trx/trx0purge.c1161--- a/storage/innodb_plugin/trx/trx0purge.c
1158+++ b/storage/innodb_plugin/trx/trx0purge.c1162+++ b/storage/innodb_plugin/trx/trx0purge.c
1159@@ -1087,6 +1087,9 @@1163@@ -1087,6 +1087,9 @@
@@ -1166,7 +1170,6 @@
1166 mutex_enter(&(purge_sys->mutex));1170 mutex_enter(&(purge_sys->mutex));
1167 1171
1168 if (purge_sys->trx->n_active_thrs > 0) {1172 if (purge_sys->trx->n_active_thrs > 0) {
1169diff -ruN a/storage/innodb_plugin/trx/trx0rseg.c b/storage/innodb_plugin/trx/trx0rseg.c
1170--- a/storage/innodb_plugin/trx/trx0rseg.c1173--- a/storage/innodb_plugin/trx/trx0rseg.c
1171+++ b/storage/innodb_plugin/trx/trx0rseg.c1174+++ b/storage/innodb_plugin/trx/trx0rseg.c
1172@@ -143,9 +143,11 @@1175@@ -143,9 +143,11 @@
@@ -1181,7 +1184,6 @@
1181 1184
1182 undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);1185 undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);
1183 1186
1184diff -ruN a/storage/innodb_plugin/trx/trx0sys.c b/storage/innodb_plugin/trx/trx0sys.c
1185--- a/storage/innodb_plugin/trx/trx0sys.c1187--- a/storage/innodb_plugin/trx/trx0sys.c
1186+++ b/storage/innodb_plugin/trx/trx0sys.c1188+++ b/storage/innodb_plugin/trx/trx0sys.c
1187@@ -1607,10 +1607,12 @@1189@@ -1607,10 +1607,12 @@
@@ -1197,7 +1199,6 @@
1197 1199
1198 mem_free(trx_sys);1200 mem_free(trx_sys);
1199 1201
1200diff -ruN a/storage/innodb_plugin/trx/trx0trx.c b/storage/innodb_plugin/trx/trx0trx.c
1201--- a/storage/innodb_plugin/trx/trx0trx.c1202--- a/storage/innodb_plugin/trx/trx0trx.c
1202+++ b/storage/innodb_plugin/trx/trx0trx.c1203+++ b/storage/innodb_plugin/trx/trx0trx.c
1203@@ -461,8 +461,8 @@1204@@ -461,8 +461,8 @@
12041205
=== modified file 'patches/innodb51_builtin.patch'
--- patches/innodb51_builtin.patch 2011-06-26 03:06:10 +0000
+++ patches/innodb51_builtin.patch 2011-09-15 04:23:22 +0000
@@ -1,4 +1,3 @@
1diff -ruN a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
2--- a/storage/innobase/btr/btr0btr.c1--- a/storage/innobase/btr/btr0btr.c
3+++ b/storage/innobase/btr/btr0btr.c2+++ b/storage/innobase/btr/btr0btr.c
4@@ -515,7 +515,7 @@3@@ -515,7 +515,7 @@
@@ -10,7 +9,6 @@
10 page_t*9 page_t*
11 btr_node_ptr_get_child(10 btr_node_ptr_get_child(
12 /*===================*/11 /*===================*/
13diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
14--- a/storage/innobase/buf/buf0buf.c12--- a/storage/innobase/buf/buf0buf.c
15+++ b/storage/innobase/buf/buf0buf.c13+++ b/storage/innobase/buf/buf0buf.c
16@@ -304,7 +304,7 @@14@@ -304,7 +304,7 @@
@@ -50,7 +48,6 @@
50 ibuf_merge_or_delete_for_page(48 ibuf_merge_or_delete_for_page(
51 block->frame, block->space, block->offset,49 block->frame, block->space, block->offset,
52 TRUE);50 TRUE);
53diff -ruN a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c
54--- a/storage/innobase/buf/buf0flu.c51--- a/storage/innobase/buf/buf0flu.c
55+++ b/storage/innobase/buf/buf0flu.c52+++ b/storage/innobase/buf/buf0flu.c
56@@ -81,6 +81,22 @@53@@ -81,6 +81,22 @@
@@ -84,7 +81,6 @@
84 81
85 ut_ad(buf_flush_validate_low());82 ut_ad(buf_flush_validate_low());
86 }83 }
87diff -ruN a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c
88--- a/storage/innobase/buf/buf0rea.c84--- a/storage/innobase/buf/buf0rea.c
89+++ b/storage/innobase/buf/buf0rea.c85+++ b/storage/innobase/buf/buf0rea.c
90@@ -114,6 +114,45 @@86@@ -114,6 +114,45 @@
@@ -147,7 +143,6 @@
147 fprintf(stderr,143 fprintf(stderr,
148 "InnoDB: Error: InnoDB has waited for"144 "InnoDB: Error: InnoDB has waited for"
149 " 50 seconds for pending\n"145 " 50 seconds for pending\n"
150diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
151--- a/storage/innobase/fil/fil0fil.c146--- a/storage/innobase/fil/fil0fil.c
152+++ b/storage/innobase/fil/fil0fil.c147+++ b/storage/innobase/fil/fil0fil.c
153@@ -26,6 +26,10 @@148@@ -26,6 +26,10 @@
@@ -161,7 +156,60 @@
161 156
162 157
163 /*158 /*
164@@ -604,9 +608,9 @@159@@ -260,7 +264,7 @@
160 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
161 mutex. */
162 static
163-void
164+ulint
165 fil_node_prepare_for_io(
166 /*====================*/
167 fil_node_t* node, /* in: file node */
168@@ -494,7 +498,7 @@
169 Opens a the file of a node of a tablespace. The caller must own the fil_system
170 mutex. */
171 static
172-void
173+ulint
174 fil_node_open_file(
175 /*===============*/
176 fil_node_t* node, /* in: file node */
177@@ -529,7 +533,18 @@
178 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
179 if (!success) {
180 /* The following call prints an error message */
181- os_file_get_last_error(TRUE);
182+ if (os_file_get_last_error(TRUE) == OS_FILE_NOT_FOUND)
183+ {
184+ ut_print_timestamp(stderr);
185+ fprintf(stderr,
186+ " InnoDB: Warning: cannot open %s\n"
187+ "InnoDB: this can happen if the table "
188+ "was removed or renamed during an \n"
189+ "InnoDB: xtrabackup run and is not dangerous.\n",
190+ node->name);
191+ return(OS_FILE_NOT_FOUND);
192+ }
193+
194
195 ut_print_timestamp(stderr);
196
197@@ -595,18 +610,21 @@
198
199 if (space_id != space->id) {
200 fprintf(stderr,
201- "InnoDB: Error: tablespace id is %lu"
202+ "InnoDB: Warning: tablespace id is %lu"
203 " in the data dictionary\n"
204- "InnoDB: but in file %s it is %lu!\n",
205+ "InnoDB: but in file %s it is %lu!\n"
206+ "InnoDB: this can happen if the table metadata "
207+ "was modified during an xtrabackup run\n"
208+ "InnoDB: and is not dangerous.\n",
209 space->id, node->name, space_id);
210
211- ut_a(0);
212+ return(OS_FILE_NOT_FOUND);
165 }213 }
166 214
167 if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {215 if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
@@ -174,7 +222,30 @@
174 } else {222 } else {
175 node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);223 node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
176 }224 }
177@@ -1755,7 +1759,7 @@225@@ -642,6 +660,8 @@
226 /* Put the node to the LRU list */
227 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
228 }
229+
230+ return(0);
231 }
232
233 /**************************************************************************
234@@ -1288,7 +1308,12 @@
235 the file yet; the following calls will open it and update the
236 size fields */
237
238- fil_node_prepare_for_io(node, system, space);
239+ if (fil_node_prepare_for_io(node, system, space))
240+ {
241+ mutex_exit(&(system->mutex));
242+
243+ return(0);
244+ }
245 fil_node_complete_io(node, system, OS_FILE_READ);
246 }
247
248@@ -1755,7 +1780,7 @@
178 mem_free(path);249 mem_free(path);
179 }250 }
180 251
@@ -183,7 +254,7 @@
183 /************************************************************254 /************************************************************
184 Writes a log record about an .ibd file create/rename/delete. */255 Writes a log record about an .ibd file create/rename/delete. */
185 static256 static
186@@ -1957,7 +1961,7 @@257@@ -1957,7 +1982,7 @@
187 if (fil_create_new_single_table_tablespace(258 if (fil_create_new_single_table_tablespace(
188 &space_id, name, FALSE,259 &space_id, name, FALSE,
189 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {260 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
@@ -192,7 +263,7 @@
192 }263 }
193 }264 }
194 }265 }
195@@ -2116,7 +2120,7 @@266@@ -2116,7 +2141,7 @@
196 }267 }
197 268
198 if (success) {269 if (success) {
@@ -201,7 +272,7 @@
201 /* Write a log record about the deletion of the .ibd272 /* Write a log record about the deletion of the .ibd
202 file, so that ibbackup can replay it in the273 file, so that ibbackup can replay it in the
203 --apply-log phase. We use a dummy mtr and the familiar274 --apply-log phase. We use a dummy mtr and the familiar
204@@ -2392,7 +2396,7 @@275@@ -2392,7 +2417,7 @@
205 276
206 mutex_exit(&(system->mutex));277 mutex_exit(&(system->mutex));
207 278
@@ -210,7 +281,7 @@
210 if (success) {281 if (success) {
211 mtr_t mtr;282 mtr_t mtr;
212 283
213@@ -2568,7 +2572,7 @@284@@ -2568,7 +2593,7 @@
214 285
215 fil_node_create(path, size, *space_id, FALSE);286 fil_node_create(path, size, *space_id, FALSE);
216 287
@@ -219,7 +290,7 @@
219 {290 {
220 mtr_t mtr;291 mtr_t mtr;
221 292
222@@ -2786,20 +2790,99 @@293@@ -2786,20 +2811,99 @@
223 "InnoDB: open the tablespace file ", stderr);294 "InnoDB: open the tablespace file ", stderr);
224 ut_print_filename(stderr, filepath);295 ut_print_filename(stderr, filepath);
225 fputs("!\n"296 fputs("!\n"
@@ -330,7 +401,7 @@
330 return(FALSE);401 return(FALSE);
331 }402 }
332 403
333@@ -3025,7 +3108,7 @@404@@ -3025,7 +3129,7 @@
334 cannot be ok. */405 cannot be ok. */
335 406
336 size = (((ib_longlong)size_high) << 32) + (ib_longlong)size_low;407 size = (((ib_longlong)size_high) << 32) + (ib_longlong)size_low;
@@ -339,7 +410,7 @@
339 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {410 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
340 fprintf(stderr,411 fprintf(stderr,
341 "InnoDB: Error: the size of single-table tablespace"412 "InnoDB: Error: the size of single-table tablespace"
342@@ -3152,7 +3235,7 @@413@@ -3152,7 +3256,7 @@
343 A fault-tolerant function that tries to read the next file name in the414 A fault-tolerant function that tries to read the next file name in the
344 directory. We retry 100 times if os_file_readdir_next_file() returns -1. The415 directory. We retry 100 times if os_file_readdir_next_file() returns -1. The
345 idea is to read as much good data as we can and jump over bad data. */416 idea is to read as much good data as we can and jump over bad data. */
@@ -348,7 +419,7 @@
348 int419 int
349 fil_file_readdir_next_file(420 fil_file_readdir_next_file(
350 /*=======================*/421 /*=======================*/
351@@ -3500,15 +3583,100 @@422@@ -3500,15 +3604,100 @@
352 "InnoDB: in InnoDB data dictionary"423 "InnoDB: in InnoDB data dictionary"
353 " has tablespace id %lu,\n"424 " has tablespace id %lu,\n"
354 "InnoDB: but tablespace with that id"425 "InnoDB: but tablespace with that id"
@@ -457,7 +528,32 @@
457 } else {528 } else {
458 ut_print_timestamp(stderr);529 ut_print_timestamp(stderr);
459 fputs(" InnoDB: Error: table ", stderr);530 fputs(" InnoDB: Error: table ", stderr);
460@@ -4067,7 +4235,9 @@531@@ -3901,7 +4090,7 @@
532 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
533 mutex. */
534 static
535-void
536+ulint
537 fil_node_prepare_for_io(
538 /*====================*/
539 fil_node_t* node, /* in: file node */
540@@ -3921,10 +4110,14 @@
541 }
542
543 if (node->open == FALSE) {
544+ ulint err;
545 /* File is closed: open it */
546 ut_a(node->n_pending == 0);
547
548- fil_node_open_file(node, system, space);
549+ err = fil_node_open_file(node, system, space);
550+ if (err) {
551+ return(err);
552+ }
553 }
554
555 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
556@@ -4067,7 +4259,9 @@
461 ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)557 ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)
462 || !ibuf_bitmap_page(block_offset) || sync || is_log);558 || !ibuf_bitmap_page(block_offset) || sync || is_log);
463 #ifdef UNIV_SYNC_DEBUG559 #ifdef UNIV_SYNC_DEBUG
@@ -468,7 +564,7 @@
468 || ibuf_page(space_id, block_offset));564 || ibuf_page(space_id, block_offset));
469 #endif565 #endif
470 #endif566 #endif
471@@ -4112,6 +4282,16 @@567@@ -4112,6 +4306,16 @@
472 568
473 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));569 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
474 570
@@ -485,7 +581,6 @@
485 node = UT_LIST_GET_FIRST(space->chain);581 node = UT_LIST_GET_FIRST(space->chain);
486 582
487 for (;;) {583 for (;;) {
488diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
489--- a/storage/innobase/ibuf/ibuf0ibuf.c584--- a/storage/innobase/ibuf/ibuf0ibuf.c
490+++ b/storage/innobase/ibuf/ibuf0ibuf.c585+++ b/storage/innobase/ibuf/ibuf0ibuf.c
491@@ -984,7 +984,7 @@586@@ -984,7 +984,7 @@
@@ -507,7 +602,6 @@
507 while (sum_pages < n_pages) {602 while (sum_pages < n_pages) {
508 n_bytes = ibuf_contract_ext(&n_pag2, sync);603 n_bytes = ibuf_contract_ext(&n_pag2, sync);
509 604
510diff -ruN a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h
511--- a/storage/innobase/include/mem0mem.h605--- a/storage/innobase/include/mem0mem.h
512+++ b/storage/innobase/include/mem0mem.h606+++ b/storage/innobase/include/mem0mem.h
513@@ -401,6 +401,7 @@607@@ -401,6 +401,7 @@
@@ -518,7 +612,6 @@
518 #ifdef MEM_PERIODIC_CHECK612 #ifdef MEM_PERIODIC_CHECK
519 UT_LIST_NODE_T(mem_block_t) mem_block_list;613 UT_LIST_NODE_T(mem_block_t) mem_block_list;
520 /* List of all mem blocks allocated; protected614 /* List of all mem blocks allocated; protected
521diff -ruN a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic
522--- a/storage/innobase/include/mem0mem.ic615--- a/storage/innobase/include/mem0mem.ic
523+++ b/storage/innobase/include/mem0mem.ic616+++ b/storage/innobase/include/mem0mem.ic
524@@ -452,6 +452,7 @@617@@ -452,6 +452,7 @@
@@ -552,7 +645,6 @@
552 645
553 if (heap->free_block) {646 if (heap->free_block) {
554 size += UNIV_PAGE_SIZE;647 size += UNIV_PAGE_SIZE;
555diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
556--- a/storage/innobase/include/srv0srv.h648--- a/storage/innobase/include/srv0srv.h
557+++ b/storage/innobase/include/srv0srv.h649+++ b/storage/innobase/include/srv0srv.h
558@@ -60,6 +60,8 @@650@@ -60,6 +60,8 @@
@@ -583,7 +675,6 @@
583 /*-------------------------------------------*/675 /*-------------------------------------------*/
584 676
585 extern ulint srv_n_rows_inserted;677 extern ulint srv_n_rows_inserted;
586diff -ruN a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h
587--- a/storage/innobase/include/srv0start.h678--- a/storage/innobase/include/srv0start.h
588+++ b/storage/innobase/include/srv0start.h679+++ b/storage/innobase/include/srv0start.h
589@@ -80,6 +80,7 @@680@@ -80,6 +80,7 @@
@@ -594,7 +685,6 @@
594 685
595 #ifdef __NETWARE__686 #ifdef __NETWARE__
596 void set_panic_flag_for_netware(void);687 void set_panic_flag_for_netware(void);
597diff -ruN a/storage/innobase/include/ut0byte.ic b/storage/innobase/include/ut0byte.ic
598--- a/storage/innobase/include/ut0byte.ic688--- a/storage/innobase/include/ut0byte.ic
599+++ b/storage/innobase/include/ut0byte.ic689+++ b/storage/innobase/include/ut0byte.ic
600@@ -152,6 +152,16 @@690@@ -152,6 +152,16 @@
@@ -642,7 +732,6 @@
642 return(diff);732 return(diff);
643 }733 }
644 734
645diff -ruN a/storage/innobase/include/ut0mem.h b/storage/innobase/include/ut0mem.h
646--- a/storage/innobase/include/ut0mem.h735--- a/storage/innobase/include/ut0mem.h
647+++ b/storage/innobase/include/ut0mem.h736+++ b/storage/innobase/include/ut0mem.h
648@@ -30,6 +30,13 @@737@@ -30,6 +30,13 @@
@@ -659,7 +748,6 @@
659 Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is748 Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
660 defined and set_to_zero is TRUE. */749 defined and set_to_zero is TRUE. */
661 750
662diff -ruN a/storage/innobase/include/ut0rnd.ic b/storage/innobase/include/ut0rnd.ic
663--- a/storage/innobase/include/ut0rnd.ic751--- a/storage/innobase/include/ut0rnd.ic
664+++ b/storage/innobase/include/ut0rnd.ic752+++ b/storage/innobase/include/ut0rnd.ic
665@@ -172,7 +172,7 @@753@@ -172,7 +172,7 @@
@@ -680,7 +768,6 @@
680 i++;768 i++;
681 ut_a(i < 100);769 ut_a(i < 100);
682 #endif770 #endif
683diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
684--- a/storage/innobase/log/log0log.c771--- a/storage/innobase/log/log0log.c
685+++ b/storage/innobase/log/log0log.c772+++ b/storage/innobase/log/log0log.c
686@@ -538,7 +538,9 @@773@@ -538,7 +538,9 @@
@@ -718,7 +805,6 @@
718 805
719 if (srv_fast_shutdown == 2) {806 if (srv_fast_shutdown == 2) {
720 /* In this fastest shutdown we do not flush the buffer pool:807 /* In this fastest shutdown we do not flush the buffer pool:
721diff -ruN a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
722--- a/storage/innobase/log/log0recv.c808--- a/storage/innobase/log/log0recv.c
723+++ b/storage/innobase/log/log0recv.c809+++ b/storage/innobase/log/log0recv.c
724@@ -35,19 +35,19 @@810@@ -35,19 +35,19 @@
@@ -861,7 +947,6 @@
861 }947 }
862 948
863 /**********************************************************949 /**********************************************************
864diff -ruN a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c
865--- a/storage/innobase/mem/mem0dbg.c950--- a/storage/innobase/mem/mem0dbg.c
866+++ b/storage/innobase/mem/mem0dbg.c951+++ b/storage/innobase/mem/mem0dbg.c
867@@ -133,6 +133,14 @@952@@ -133,6 +133,14 @@
@@ -879,7 +964,6 @@
879 mem_comm_pool = mem_pool_create(size);964 mem_comm_pool = mem_pool_create(size);
880 }965 }
881 966
882diff -ruN a/storage/innobase/mem/mem0mem.c b/storage/innobase/mem/mem0mem.c
883--- a/storage/innobase/mem/mem0mem.c967--- a/storage/innobase/mem/mem0mem.c
884+++ b/storage/innobase/mem/mem0mem.c968+++ b/storage/innobase/mem/mem0mem.c
885@@ -472,6 +472,7 @@969@@ -472,6 +472,7 @@
@@ -914,7 +998,6 @@
914 998
915 if (init_block) {999 if (init_block) {
916 /* Do not have to free: do nothing */1000 /* Do not have to free: do nothing */
917diff -ruN a/storage/innobase/mem/mem0pool.c b/storage/innobase/mem/mem0pool.c
918--- a/storage/innobase/mem/mem0pool.c1001--- a/storage/innobase/mem/mem0pool.c
919+++ b/storage/innobase/mem/mem0pool.c1002+++ b/storage/innobase/mem/mem0pool.c
920@@ -11,6 +11,7 @@1003@@ -11,6 +11,7 @@
@@ -957,7 +1040,6 @@
957 /* It may be that the area was really allocated from the OS with1040 /* It may be that the area was really allocated from the OS with
958 regular malloc: check if ptr points within our memory pool */1041 regular malloc: check if ptr points within our memory pool */
959 1042
960diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
961--- a/storage/innobase/os/os0file.c1043--- a/storage/innobase/os/os0file.c
962+++ b/storage/innobase/os/os0file.c1044+++ b/storage/innobase/os/os0file.c
963@@ -466,7 +466,7 @@1045@@ -466,7 +466,7 @@
@@ -1058,7 +1140,6 @@
1058 1140
1059 array->n_reserved++;1141 array->n_reserved++;
1060 1142
1061diff -ruN a/storage/innobase/os/os0thread.c b/storage/innobase/os/os0thread.c
1062--- a/storage/innobase/os/os0thread.c1143--- a/storage/innobase/os/os0thread.c
1063+++ b/storage/innobase/os/os0thread.c1144+++ b/storage/innobase/os/os0thread.c
1064@@ -273,12 +273,17 @@1145@@ -273,12 +273,17 @@
@@ -1079,7 +1160,6 @@
1079 #endif1160 #endif
1080 }1161 }
1081 1162
1082diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
1083--- a/storage/innobase/srv/srv0srv.c1163--- a/storage/innobase/srv/srv0srv.c
1084+++ b/storage/innobase/srv/srv0srv.c1164+++ b/storage/innobase/srv/srv0srv.c
1085@@ -94,6 +94,8 @@1165@@ -94,6 +94,8 @@
@@ -1118,7 +1198,6 @@
1118 os_sync_init();1198 os_sync_init();
1119 sync_init();1199 sync_init();
1120 mem_init(srv_mem_pool_size);1200 mem_init(srv_mem_pool_size);
1121diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
1122--- a/storage/innobase/srv/srv0start.c1201--- a/storage/innobase/srv/srv0start.c
1123+++ b/storage/innobase/srv/srv0start.c1202+++ b/storage/innobase/srv/srv0start.c
1124@@ -61,6 +61,8 @@1203@@ -61,6 +61,8 @@
@@ -1231,7 +1310,6 @@
1231 srv_file_per_table = srv_file_per_table_original_value;1310 srv_file_per_table = srv_file_per_table_original_value;
1232 1311
1233 return((int) DB_SUCCESS);1312 return((int) DB_SUCCESS);
1234diff -ruN a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c
1235--- a/storage/innobase/trx/trx0purge.c1313--- a/storage/innobase/trx/trx0purge.c
1236+++ b/storage/innobase/trx/trx0purge.c1314+++ b/storage/innobase/trx/trx0purge.c
1237@@ -1024,6 +1024,9 @@1315@@ -1024,6 +1024,9 @@
@@ -1244,7 +1322,6 @@
1244 mutex_enter(&(purge_sys->mutex));1322 mutex_enter(&(purge_sys->mutex));
1245 1323
1246 if (purge_sys->trx->n_active_thrs > 0) {1324 if (purge_sys->trx->n_active_thrs > 0) {
1247diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
1248--- a/storage/innobase/trx/trx0trx.c1325--- a/storage/innobase/trx/trx0trx.c
1249+++ b/storage/innobase/trx/trx0trx.c1326+++ b/storage/innobase/trx/trx0trx.c
1250@@ -478,8 +478,8 @@1327@@ -478,8 +478,8 @@
@@ -1270,7 +1347,6 @@
1270 } else {1347 } else {
1271 fprintf(stderr,1348 fprintf(stderr,
1272 "InnoDB: Since"1349 "InnoDB: Since"
1273diff -ruN a/storage/innobase/ut/ut0mem.c b/storage/innobase/ut/ut0mem.c
1274--- a/storage/innobase/ut/ut0mem.c1350--- a/storage/innobase/ut/ut0mem.c
1275+++ b/storage/innobase/ut/ut0mem.c1351+++ b/storage/innobase/ut/ut0mem.c
1276@@ -15,6 +15,7 @@1352@@ -15,6 +15,7 @@
12771353
=== modified file 'patches/innodb55.patch'
--- patches/innodb55.patch 2011-06-26 03:06:10 +0000
+++ patches/innodb55.patch 2011-09-15 04:23:22 +0000
@@ -1,4 +1,3 @@
1diff -ruN a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
2--- a/storage/innobase/btr/btr0btr.c1--- a/storage/innobase/btr/btr0btr.c
3+++ b/storage/innobase/btr/btr0btr.c2+++ b/storage/innobase/btr/btr0btr.c
4@@ -120,7 +120,7 @@3@@ -120,7 +120,7 @@
@@ -19,7 +18,6 @@
19 buf_block_t*18 buf_block_t*
20 btr_node_ptr_get_child(19 btr_node_ptr_get_child(
21 /*===================*/20 /*===================*/
22diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
23--- a/storage/innobase/buf/buf0buf.c21--- a/storage/innobase/buf/buf0buf.c
24+++ b/storage/innobase/buf/buf0buf.c22+++ b/storage/innobase/buf/buf0buf.c
25@@ -517,7 +517,7 @@23@@ -517,7 +517,7 @@
@@ -51,7 +49,6 @@
51 ibuf_merge_or_delete_for_page(49 ibuf_merge_or_delete_for_page(
52 (buf_block_t*) bpage, bpage->space,50 (buf_block_t*) bpage, bpage->space,
53 bpage->offset, buf_page_get_zip_size(bpage),51 bpage->offset, buf_page_get_zip_size(bpage),
54diff -ruN a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c
55--- a/storage/innobase/buf/buf0rea.c52--- a/storage/innobase/buf/buf0rea.c
56+++ b/storage/innobase/buf/buf0rea.c53+++ b/storage/innobase/buf/buf0rea.c
57@@ -122,6 +122,45 @@54@@ -122,6 +122,45 @@
@@ -151,7 +148,6 @@
151 return;148 return;
152 }149 }
153 150
154diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
155--- a/storage/innobase/fil/fil0fil.c151--- a/storage/innobase/fil/fil0fil.c
156+++ b/storage/innobase/fil/fil0fil.c152+++ b/storage/innobase/fil/fil0fil.c
157@@ -40,6 +40,8 @@153@@ -40,6 +40,8 @@
@@ -190,7 +186,7 @@
190 fil_node_open_file(186 fil_node_open_file(
191 /*===============*/187 /*===============*/
192 fil_node_t* node, /*!< in: file node */188 fil_node_t* node, /*!< in: file node */
193@@ -696,7 +698,14 @@189@@ -696,7 +698,17 @@
194 OS_FILE_READ_ONLY, &success);190 OS_FILE_READ_ONLY, &success);
195 if (!success) {191 if (!success) {
196 /* The following call prints an error message */192 /* The following call prints an error message */
@@ -199,14 +195,36 @@
199+ {195+ {
200+ ut_print_timestamp(stderr);196+ ut_print_timestamp(stderr);
201+ fprintf(stderr,197+ fprintf(stderr,
202+ " InnoDB: Warning: cannot open %s\n",198+ " InnoDB: Warning: cannot open %s\n"
199+ "InnoDB: this can happen if the table "
200+ "was removed or renamed during an \n"
201+ "InnoDB: xtrabackup run and is not dangerous.\n",
203+ node->name);202+ node->name);
204+ return(OS_FILE_NOT_FOUND);203+ return(OS_FILE_NOT_FOUND);
205+ }204+ }
206 205
207 ut_print_timestamp(stderr);206 ut_print_timestamp(stderr);
208 207
209@@ -786,8 +795,8 @@208@@ -757,12 +769,15 @@
209
210 if (UNIV_UNLIKELY(space_id != space->id)) {
211 fprintf(stderr,
212- "InnoDB: Error: tablespace id is %lu"
213+ "InnoDB: Warning: tablespace id is %lu"
214 " in the data dictionary\n"
215- "InnoDB: but in file %s it is %lu!\n",
216+ "InnoDB: but in file %s it is %lu!\n"
217+ "InnoDB: this can happen if the table metadata "
218+ "was modified during an xtrabackup run\n"
219+ "InnoDB: and is not dangerous.\n",
220 space->id, node->name, space_id);
221
222- ut_error;
223+ return(OS_FILE_NOT_FOUND);
224 }
225
226 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
227@@ -786,8 +801,8 @@
210 }228 }
211 229
212 if (size_bytes >= 1024 * 1024) {230 if (size_bytes >= 1024 * 1024) {
@@ -217,7 +235,7 @@
217 }235 }
218 236
219 if (!(flags & DICT_TF_ZSSIZE_MASK)) {237 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
220@@ -838,6 +847,8 @@238@@ -838,6 +853,8 @@
221 /* Put the node to the LRU list */239 /* Put the node to the LRU list */
222 UT_LIST_ADD_FIRST(LRU, system->LRU, node);240 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
223 }241 }
@@ -226,7 +244,7 @@
226 }244 }
227 245
228 /**********************************************************************//**246 /**********************************************************************//**
229@@ -1463,7 +1474,12 @@247@@ -1463,7 +1480,12 @@
230 the file yet; the following calls will open it and update the248 the file yet; the following calls will open it and update the
231 size fields */249 size fields */
232 250
@@ -240,7 +258,7 @@
240 fil_node_complete_io(node, fil_system, OS_FILE_READ);258 fil_node_complete_io(node, fil_system, OS_FILE_READ);
241 }259 }
242 260
243@@ -1515,7 +1531,12 @@261@@ -1515,7 +1537,12 @@
244 the file yet; the following calls will open it and update the262 the file yet; the following calls will open it and update the
245 size fields */263 size fields */
246 264
@@ -272,7 +290,7 @@
272 }290 }
273 }291 }
274 292
275@@ -2343,7 +2364,7 @@293@@ -2343,7 +2370,7 @@
276 }294 }
277 295
278 if (success) {296 if (success) {
@@ -281,7 +299,7 @@
281 /* Write a log record about the deletion of the .ibd299 /* Write a log record about the deletion of the .ibd
282 file, so that ibbackup can replay it in the300 file, so that ibbackup can replay it in the
283 --apply-log phase. We use a dummy mtr and the familiar301 --apply-log phase. We use a dummy mtr and the familiar
284@@ -2644,7 +2665,7 @@302@@ -2644,7 +2671,7 @@
285 303
286 mutex_exit(&fil_system->mutex);304 mutex_exit(&fil_system->mutex);
287 305
@@ -290,7 +308,7 @@
290 if (success) {308 if (success) {
291 mtr_t mtr;309 mtr_t mtr;
292 310
293@@ -2835,7 +2856,7 @@311@@ -2835,7 +2862,7 @@
294 312
295 fil_node_create(path, size, space_id, FALSE);313 fil_node_create(path, size, space_id, FALSE);
296 314
@@ -299,7 +317,7 @@
299 {317 {
300 mtr_t mtr;318 mtr_t mtr;
301 319
302@@ -3090,19 +3111,97 @@320@@ -3090,19 +3117,97 @@
303 "InnoDB: open the tablespace file ", stderr);321 "InnoDB: open the tablespace file ", stderr);
304 ut_print_filename(stderr, filepath);322 ut_print_filename(stderr, filepath);
305 fputs("!\n"323 fputs("!\n"
@@ -407,7 +425,7 @@
407 return(FALSE);425 return(FALSE);
408 }426 }
409 427
410@@ -3334,7 +3433,7 @@428@@ -3334,7 +3439,7 @@
411 cannot be ok. */429 cannot be ok. */
412 430
413 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;431 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
@@ -416,7 +434,7 @@
416 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {434 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
417 fprintf(stderr,435 fprintf(stderr,
418 "InnoDB: Error: the size of single-table tablespace"436 "InnoDB: Error: the size of single-table tablespace"
419@@ -3475,7 +3574,7 @@437@@ -3475,7 +3580,7 @@
420 idea is to read as much good data as we can and jump over bad data.438 idea is to read as much good data as we can and jump over bad data.
421 @return 0 if ok, -1 if error even after the retries, 1 if at the end439 @return 0 if ok, -1 if error even after the retries, 1 if at the end
422 of the directory */440 of the directory */
@@ -425,7 +443,7 @@
425 int443 int
426 fil_file_readdir_next_file(444 fil_file_readdir_next_file(
427 /*=======================*/445 /*=======================*/
428@@ -3774,15 +3873,97 @@446@@ -3774,15 +3879,97 @@
429 "InnoDB: in InnoDB data dictionary"447 "InnoDB: in InnoDB data dictionary"
430 " has tablespace id %lu,\n"448 " has tablespace id %lu,\n"
431 "InnoDB: but tablespace with that id"449 "InnoDB: but tablespace with that id"
@@ -531,7 +549,7 @@
531 } else {549 } else {
532 ut_print_timestamp(stderr);550 ut_print_timestamp(stderr);
533 fputs(" InnoDB: Error: table ", stderr);551 fputs(" InnoDB: Error: table ", stderr);
534@@ -4171,7 +4352,7 @@552@@ -4171,7 +4358,7 @@
535 off the LRU list if it is in the LRU list. The caller must hold the fil_sys553 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
536 mutex. */554 mutex. */
537 static555 static
@@ -540,7 +558,7 @@
540 fil_node_prepare_for_io(558 fil_node_prepare_for_io(
541 /*====================*/559 /*====================*/
542 fil_node_t* node, /*!< in: file node */560 fil_node_t* node, /*!< in: file node */
543@@ -4191,10 +4372,13 @@561@@ -4191,10 +4378,13 @@
544 }562 }
545 563
546 if (node->open == FALSE) {564 if (node->open == FALSE) {
@@ -555,7 +573,7 @@
555 }573 }
556 574
557 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE575 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
558@@ -4207,6 +4391,8 @@576@@ -4207,6 +4397,8 @@
559 }577 }
560 578
561 node->n_pending++;579 node->n_pending++;
@@ -592,7 +610,6 @@
592 node = UT_LIST_GET_FIRST(space->chain);610 node = UT_LIST_GET_FIRST(space->chain);
593 611
594 for (;;) {612 for (;;) {
595diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
596--- a/storage/innobase/ibuf/ibuf0ibuf.c613--- a/storage/innobase/ibuf/ibuf0ibuf.c
597+++ b/storage/innobase/ibuf/ibuf0ibuf.c614+++ b/storage/innobase/ibuf/ibuf0ibuf.c
598@@ -1160,6 +1160,9 @@615@@ -1160,6 +1160,9 @@
@@ -630,7 +647,6 @@
630 while (sum_pages < n_pages) {647 while (sum_pages < n_pages) {
631 n_bytes = ibuf_contract_ext(&n_pag2, sync);648 n_bytes = ibuf_contract_ext(&n_pag2, sync);
632 649
633diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
634--- a/storage/innobase/include/srv0srv.h650--- a/storage/innobase/include/srv0srv.h
635+++ b/storage/innobase/include/srv0srv.h651+++ b/storage/innobase/include/srv0srv.h
636@@ -216,6 +216,10 @@652@@ -216,6 +216,10 @@
@@ -644,7 +660,6 @@
644 /*-------------------------------------------*/660 /*-------------------------------------------*/
645 661
646 extern ulint srv_n_rows_inserted;662 extern ulint srv_n_rows_inserted;
647diff -ruN a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h
648--- a/storage/innobase/include/srv0start.h663--- a/storage/innobase/include/srv0start.h
649+++ b/storage/innobase/include/srv0start.h664+++ b/storage/innobase/include/srv0start.h
650@@ -91,6 +91,8 @@665@@ -91,6 +91,8 @@
@@ -656,7 +671,6 @@
656 #ifdef HAVE_DARWIN_THREADS671 #ifdef HAVE_DARWIN_THREADS
657 /** TRUE if the F_FULLFSYNC option is available */672 /** TRUE if the F_FULLFSYNC option is available */
658 extern ibool srv_have_fullfsync;673 extern ibool srv_have_fullfsync;
659diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
660--- a/storage/innobase/log/log0log.c674--- a/storage/innobase/log/log0log.c
661+++ b/storage/innobase/log/log0log.c675+++ b/storage/innobase/log/log0log.c
662@@ -576,7 +576,9 @@676@@ -576,7 +576,9 @@
@@ -703,7 +717,6 @@
703 717
704 if (srv_fast_shutdown == 2) {718 if (srv_fast_shutdown == 2) {
705 /* In this fastest shutdown we do not flush the buffer pool:719 /* In this fastest shutdown we do not flush the buffer pool:
706diff -ruN a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
707--- a/storage/innobase/log/log0recv.c720--- a/storage/innobase/log/log0recv.c
708+++ b/storage/innobase/log/log0recv.c721+++ b/storage/innobase/log/log0recv.c
709@@ -42,27 +42,27 @@722@@ -42,27 +42,27 @@
@@ -855,7 +868,6 @@
855 trx_rollback_or_clean_recovered(FALSE);868 trx_rollback_or_clean_recovered(FALSE);
856 }869 }
857 870
858diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
859--- a/storage/innobase/os/os0file.c871--- a/storage/innobase/os/os0file.c
860+++ b/storage/innobase/os/os0file.c872+++ b/storage/innobase/os/os0file.c
861@@ -656,7 +656,7 @@873@@ -656,7 +656,7 @@
@@ -911,7 +923,6 @@
911 ret = os_file_pwrite(file, buf, n, offset, offset_high);923 ret = os_file_pwrite(file, buf, n, offset, offset_high);
912 924
913 if ((ulint)ret == n) {925 if ((ulint)ret == n) {
914diff -ruN a/storage/innobase/os/os0thread.c b/storage/innobase/os/os0thread.c
915--- a/storage/innobase/os/os0thread.c926--- a/storage/innobase/os/os0thread.c
916+++ b/storage/innobase/os/os0thread.c927+++ b/storage/innobase/os/os0thread.c
917@@ -266,12 +266,17 @@928@@ -266,12 +266,17 @@
@@ -932,7 +943,6 @@
932 #endif943 #endif
933 }944 }
934 945
935diff -ruN a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
936--- a/storage/innobase/row/row0merge.c946--- a/storage/innobase/row/row0merge.c
937+++ b/storage/innobase/row/row0merge.c947+++ b/storage/innobase/row/row0merge.c
938@@ -459,7 +459,9 @@948@@ -459,7 +459,9 @@
@@ -960,7 +970,7 @@
960 mem_heap_free(heap);970 mem_heap_free(heap);
961 return(DB_DUPLICATE_KEY);971 return(DB_DUPLICATE_KEY);
962 }972 }
963@@ -2628,7 +2634,9 @@973@@ -2628,7 +2632,9 @@
964 974
965 /* Reset the MySQL row buffer that is used when reporting975 /* Reset the MySQL row buffer that is used when reporting
966 duplicate keys. */976 duplicate keys. */
@@ -971,7 +981,6 @@
971 981
972 /* Read clustered index of the table and create files for982 /* Read clustered index of the table and create files for
973 secondary index entries for merge sort */983 secondary index entries for merge sort */
974diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
975--- a/storage/innobase/srv/srv0srv.c984--- a/storage/innobase/srv/srv0srv.c
976+++ b/storage/innobase/srv/srv0srv.c985+++ b/storage/innobase/srv/srv0srv.c
977@@ -401,6 +401,9 @@986@@ -401,6 +401,9 @@
@@ -1018,7 +1027,6 @@
1018 }1027 }
1019 1028
1020 if (trx->was_chosen_as_deadlock_victim) {1029 if (trx->was_chosen_as_deadlock_victim) {
1021diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
1022--- a/storage/innobase/srv/srv0start.c1030--- a/storage/innobase/srv/srv0start.c
1023+++ b/storage/innobase/srv/srv0start.c1031+++ b/storage/innobase/srv/srv0start.c
1024@@ -94,6 +94,8 @@1032@@ -94,6 +94,8 @@
@@ -1102,7 +1110,6 @@
1102 srv_file_per_table = srv_file_per_table_original_value;1110 srv_file_per_table = srv_file_per_table_original_value;
1103 1111
1104 srv_was_started = TRUE;1112 srv_was_started = TRUE;
1105diff -ruN a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c
1106--- a/storage/innobase/trx/trx0purge.c1113--- a/storage/innobase/trx/trx0purge.c
1107+++ b/storage/innobase/trx/trx0purge.c1114+++ b/storage/innobase/trx/trx0purge.c
1108@@ -1100,6 +1100,9 @@1115@@ -1100,6 +1100,9 @@
@@ -1115,7 +1122,6 @@
1115 mutex_enter(&(purge_sys->mutex));1122 mutex_enter(&(purge_sys->mutex));
1116 1123
1117 if (purge_sys->trx->n_active_thrs > 0) {1124 if (purge_sys->trx->n_active_thrs > 0) {
1118diff -ruN a/storage/innobase/trx/trx0rseg.c b/storage/innobase/trx/trx0rseg.c
1119--- a/storage/innobase/trx/trx0rseg.c1125--- a/storage/innobase/trx/trx0rseg.c
1120+++ b/storage/innobase/trx/trx0rseg.c1126+++ b/storage/innobase/trx/trx0rseg.c
1121@@ -140,9 +140,11 @@1127@@ -140,9 +140,11 @@
@@ -1130,7 +1136,6 @@
1130 1136
1131 undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);1137 undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);
1132 1138
1133diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
1134--- a/storage/innobase/trx/trx0sys.c1139--- a/storage/innobase/trx/trx0sys.c
1135+++ b/storage/innobase/trx/trx0sys.c1140+++ b/storage/innobase/trx/trx0sys.c
1136@@ -1641,10 +1641,12 @@1141@@ -1641,10 +1641,12 @@
@@ -1146,7 +1151,6 @@
1146 1151
1147 mem_free(trx_sys);1152 mem_free(trx_sys);
1148 1153
1149diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
1150--- a/storage/innobase/trx/trx0trx.c1154--- a/storage/innobase/trx/trx0trx.c
1151+++ b/storage/innobase/trx/trx0trx.c1155+++ b/storage/innobase/trx/trx0trx.c
1152@@ -469,8 +469,8 @@1156@@ -469,8 +469,8 @@
11531157
=== modified file 'patches/xtradb51.patch'
--- patches/xtradb51.patch 2011-06-26 03:06:10 +0000
+++ patches/xtradb51.patch 2011-09-15 04:23:22 +0000
@@ -1,4 +1,3 @@
1diff -ruN a/storage/innodb_plugin/btr/btr0btr.c b/storage/innodb_plugin/btr/btr0btr.c
2--- a/storage/innodb_plugin/btr/btr0btr.c1--- a/storage/innodb_plugin/btr/btr0btr.c
3+++ b/storage/innodb_plugin/btr/btr0btr.c2+++ b/storage/innodb_plugin/btr/btr0btr.c
4@@ -120,7 +120,7 @@3@@ -120,7 +120,7 @@
@@ -19,7 +18,6 @@
19 buf_block_t*18 buf_block_t*
20 btr_node_ptr_get_child(19 btr_node_ptr_get_child(
21 /*===================*/20 /*===================*/
22diff -ruN a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c
23--- a/storage/innodb_plugin/buf/buf0buf.c21--- a/storage/innodb_plugin/buf/buf0buf.c
24+++ b/storage/innodb_plugin/buf/buf0buf.c22+++ b/storage/innodb_plugin/buf/buf0buf.c
25@@ -440,7 +440,7 @@23@@ -440,7 +440,7 @@
@@ -51,7 +49,6 @@
51 ibuf_merge_or_delete_for_page(49 ibuf_merge_or_delete_for_page(
52 /* Delete possible entries, if bpage is_corrupt */50 /* Delete possible entries, if bpage is_corrupt */
53 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :51 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :
54diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
55--- a/storage/innodb_plugin/fil/fil0fil.c52--- a/storage/innodb_plugin/fil/fil0fil.c
56+++ b/storage/innodb_plugin/fil/fil0fil.c53+++ b/storage/innodb_plugin/fil/fil0fil.c
57@@ -294,7 +294,7 @@54@@ -294,7 +294,7 @@
@@ -81,7 +78,7 @@
81 fil_node_open_file(78 fil_node_open_file(
82 /*===============*/79 /*===============*/
83 fil_node_t* node, /*!< in: file node */80 fil_node_t* node, /*!< in: file node */
84@@ -664,7 +664,14 @@81@@ -664,7 +664,17 @@
85 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);82 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
86 if (!success) {83 if (!success) {
87 /* The following call prints an error message */84 /* The following call prints an error message */
@@ -90,14 +87,36 @@
90+ {87+ {
91+ ut_print_timestamp(stderr);88+ ut_print_timestamp(stderr);
92+ fprintf(stderr,89+ fprintf(stderr,
93+ " InnoDB: Warning: cannot open %s\n",90+ " InnoDB: Warning: cannot open %s\n"
91+ "InnoDB: this can happen if the table "
92+ "was removed or renamed during an \n"
93+ "InnoDB: xtrabackup run and is not dangerous.\n",
94+ node->name);94+ node->name);
95+ return(OS_FILE_NOT_FOUND);95+ return(OS_FILE_NOT_FOUND);
96+ }96+ }
97 97
98 ut_print_timestamp(stderr);98 ut_print_timestamp(stderr);
99 99
100@@ -754,8 +761,8 @@100@@ -725,12 +735,14 @@
101
102 if (UNIV_UNLIKELY(space_id != space->id)) {
103 fprintf(stderr,
104- "InnoDB: Error: tablespace id is %lu"
105+ "InnoDB: Warning: tablespace id is %lu"
106 " in the data dictionary\n"
107- "InnoDB: but in file %s it is %lu!\n",
108+ "InnoDB: but in file %s it is %lu!\n"
109+ "InnoDB: this can happen if the table metadata "
110+ "was modified during an xtrabackup run\n"
111+ "InnoDB: and is not dangerous.\n",
112 space->id, node->name, space_id);
113-
114- ut_error;
115+ return(OS_FILE_NOT_FOUND);
116 }
117
118 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
119@@ -754,8 +766,8 @@
101 }120 }
102 121
103 if (size_bytes >= 1024 * 1024) {122 if (size_bytes >= 1024 * 1024) {
@@ -108,7 +127,7 @@
108 }127 }
109 128
110 if (!(flags & DICT_TF_ZSSIZE_MASK)) {129 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
111@@ -800,6 +807,8 @@130@@ -800,6 +812,8 @@
112 /* Put the node to the LRU list */131 /* Put the node to the LRU list */
113 UT_LIST_ADD_FIRST(LRU, system->LRU, node);132 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
114 }133 }
@@ -117,7 +136,7 @@
117 }136 }
118 137
119 /**********************************************************************//**138 /**********************************************************************//**
120@@ -1428,7 +1437,12 @@139@@ -1428,7 +1442,12 @@
121 the file yet; the following calls will open it and update the140 the file yet; the following calls will open it and update the
122 size fields */141 size fields */
123 142
@@ -131,7 +150,7 @@
131 fil_node_complete_io(node, fil_system, OS_FILE_READ);150 fil_node_complete_io(node, fil_system, OS_FILE_READ);
132 }151 }
133 152
134@@ -1480,7 +1494,12 @@153@@ -1480,7 +1499,12 @@
135 the file yet; the following calls will open it and update the154 the file yet; the following calls will open it and update the
136 size fields */155 size fields */
137 156
@@ -163,7 +182,7 @@
163 }182 }
164 }183 }
165 184
166@@ -2316,7 +2335,7 @@185@@ -2316,7 +2340,7 @@
167 }186 }
168 187
169 if (success) {188 if (success) {
@@ -172,7 +191,7 @@
172 /* Write a log record about the deletion of the .ibd191 /* Write a log record about the deletion of the .ibd
173 file, so that ibbackup can replay it in the192 file, so that ibbackup can replay it in the
174 --apply-log phase. We use a dummy mtr and the familiar193 --apply-log phase. We use a dummy mtr and the familiar
175@@ -2617,7 +2636,7 @@194@@ -2617,7 +2641,7 @@
176 195
177 mutex_exit(&fil_system->mutex);196 mutex_exit(&fil_system->mutex);
178 197
@@ -181,7 +200,7 @@
181 if (success) {200 if (success) {
182 mtr_t mtr;201 mtr_t mtr;
183 202
184@@ -2807,7 +2826,7 @@203@@ -2807,7 +2831,7 @@
185 204
186 fil_node_create(path, size, space_id, FALSE);205 fil_node_create(path, size, space_id, FALSE);
187 206
@@ -190,7 +209,7 @@
190 {209 {
191 mtr_t mtr;210 mtr_t mtr;
192 211
193@@ -3060,19 +3079,97 @@212@@ -3060,19 +3084,97 @@
194 "InnoDB: open the tablespace file ", stderr);213 "InnoDB: open the tablespace file ", stderr);
195 ut_print_filename(stderr, filepath);214 ut_print_filename(stderr, filepath);
196 fputs("!\n"215 fputs("!\n"
@@ -298,7 +317,7 @@
298 return(FALSE);317 return(FALSE);
299 }318 }
300 319
301@@ -3777,7 +3874,7 @@320@@ -3777,7 +3879,7 @@
302 cannot be ok. */321 cannot be ok. */
303 322
304 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;323 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
@@ -307,7 +326,7 @@
307 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {326 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
308 fprintf(stderr,327 fprintf(stderr,
309 "InnoDB: Error: the size of single-table tablespace"328 "InnoDB: Error: the size of single-table tablespace"
310@@ -3918,7 +4015,7 @@329@@ -3918,7 +4020,7 @@
311 idea is to read as much good data as we can and jump over bad data.330 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 end331 @return 0 if ok, -1 if error even after the retries, 1 if at the end
313 of the directory */332 of the directory */
@@ -316,7 +335,7 @@
316 int335 int
317 fil_file_readdir_next_file(336 fil_file_readdir_next_file(
318 /*=======================*/337 /*=======================*/
319@@ -4217,15 +4314,97 @@338@@ -4217,15 +4319,97 @@
320 "InnoDB: in InnoDB data dictionary"339 "InnoDB: in InnoDB data dictionary"
321 " has tablespace id %lu,\n"340 " has tablespace id %lu,\n"
322 "InnoDB: but tablespace with that id"341 "InnoDB: but tablespace with that id"
@@ -422,7 +441,7 @@
422 } else {441 } else {
423 ut_print_timestamp(stderr);442 ut_print_timestamp(stderr);
424 fputs(" InnoDB: Error: table ", stderr);443 fputs(" InnoDB: Error: table ", stderr);
425@@ -4614,7 +4793,7 @@444@@ -4614,7 +4798,7 @@
426 off the LRU list if it is in the LRU list. The caller must hold the fil_sys445 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
427 mutex. */446 mutex. */
428 static447 static
@@ -431,7 +450,7 @@
431 fil_node_prepare_for_io(450 fil_node_prepare_for_io(
432 /*====================*/451 /*====================*/
433 fil_node_t* node, /*!< in: file node */452 fil_node_t* node, /*!< in: file node */
434@@ -4634,10 +4813,13 @@453@@ -4634,10 +4818,13 @@
435 }454 }
436 455
437 if (node->open == FALSE) {456 if (node->open == FALSE) {
@@ -446,7 +465,7 @@
446 }465 }
447 466
448 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE467 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
449@@ -4650,6 +4832,8 @@468@@ -4650,6 +4837,8 @@
450 }469 }
451 470
452 node->n_pending++;471 node->n_pending++;
@@ -483,7 +502,6 @@
483 node = UT_LIST_GET_FIRST(space->chain);502 node = UT_LIST_GET_FIRST(space->chain);
484 503
485 for (;;) {504 for (;;) {
486diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
487--- a/storage/innodb_plugin/handler/ha_innodb.cc505--- a/storage/innodb_plugin/handler/ha_innodb.cc
488+++ b/storage/innodb_plugin/handler/ha_innodb.cc506+++ b/storage/innodb_plugin/handler/ha_innodb.cc
489@@ -343,12 +343,6 @@507@@ -343,12 +343,6 @@
@@ -525,7 +543,6 @@
525 MYSQL_SYSVAR(enable_unsafe_group_commit),543 MYSQL_SYSVAR(enable_unsafe_group_commit),
526 MYSQL_SYSVAR(expand_import),544 MYSQL_SYSVAR(expand_import),
527 MYSQL_SYSVAR(extra_rsegments),545 MYSQL_SYSVAR(extra_rsegments),
528diff -ruN a/storage/innodb_plugin/ibuf/ibuf0ibuf.c b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
529--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c546--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c
530+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c547+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
531@@ -1064,6 +1064,9 @@548@@ -1064,6 +1064,9 @@
@@ -548,7 +565,6 @@
548 while (sum_pages < n_pages) {565 while (sum_pages < n_pages) {
549 n_bytes = ibuf_contract_ext(&n_pag2, sync);566 n_bytes = ibuf_contract_ext(&n_pag2, sync);
550 567
551diff -ruN a/storage/innodb_plugin/include/ha_prototypes.h b/storage/innodb_plugin/include/ha_prototypes.h
552--- a/storage/innodb_plugin/include/ha_prototypes.h568--- a/storage/innodb_plugin/include/ha_prototypes.h
553+++ b/storage/innodb_plugin/include/ha_prototypes.h569+++ b/storage/innodb_plugin/include/ha_prototypes.h
554@@ -268,12 +268,4 @@570@@ -268,12 +268,4 @@
@@ -602,7 +618,6 @@
602 extern long long srv_ibuf_max_size;618 extern long long srv_ibuf_max_size;
603 extern ulint srv_ibuf_active_contract;619 extern ulint srv_ibuf_active_contract;
604 extern ulint srv_ibuf_accel_rate;620 extern ulint srv_ibuf_accel_rate;
605diff -ruN a/storage/innodb_plugin/include/srv0start.h b/storage/innodb_plugin/include/srv0start.h
606--- a/storage/innodb_plugin/include/srv0start.h621--- a/storage/innodb_plugin/include/srv0start.h
607+++ b/storage/innodb_plugin/include/srv0start.h622+++ b/storage/innodb_plugin/include/srv0start.h
608@@ -91,6 +91,8 @@623@@ -91,6 +91,8 @@
@@ -614,7 +629,6 @@
614 #ifdef __NETWARE__629 #ifdef __NETWARE__
615 void set_panic_flag_for_netware(void);630 void set_panic_flag_for_netware(void);
616 #endif631 #endif
617diff -ruN a/storage/innodb_plugin/include/trx0trx.h b/storage/innodb_plugin/include/trx0trx.h
618--- a/storage/innodb_plugin/include/trx0trx.h632--- a/storage/innodb_plugin/include/trx0trx.h
619+++ b/storage/innodb_plugin/include/trx0trx.h633+++ b/storage/innodb_plugin/include/trx0trx.h
620@@ -497,7 +497,6 @@634@@ -497,7 +497,6 @@
@@ -625,7 +639,6 @@
625 ulint flush_log_later;/* In 2PC, we hold the639 ulint flush_log_later;/* In 2PC, we hold the
626 prepare_commit mutex across640 prepare_commit mutex across
627 both phases. In that case, we641 both phases. In that case, we
628diff -ruN a/storage/innodb_plugin/include/ut0byte.ic b/storage/innodb_plugin/include/ut0byte.ic
629--- a/storage/innodb_plugin/include/ut0byte.ic642--- a/storage/innodb_plugin/include/ut0byte.ic
630+++ b/storage/innodb_plugin/include/ut0byte.ic643+++ b/storage/innodb_plugin/include/ut0byte.ic
631@@ -168,6 +168,16 @@644@@ -168,6 +168,16 @@
@@ -673,7 +686,6 @@
673 return(diff);686 return(diff);
674 }687 }
675 688
676diff -ruN a/storage/innodb_plugin/log/log0log.c b/storage/innodb_plugin/log/log0log.c
677--- a/storage/innodb_plugin/log/log0log.c689--- a/storage/innodb_plugin/log/log0log.c
678+++ b/storage/innodb_plugin/log/log0log.c690+++ b/storage/innodb_plugin/log/log0log.c
679@@ -1370,7 +1370,7 @@691@@ -1370,7 +1370,7 @@
@@ -710,7 +722,6 @@
710 722
711 if (srv_fast_shutdown == 2) {723 if (srv_fast_shutdown == 2) {
712 /* In this fastest shutdown we do not flush the buffer pool:724 /* In this fastest shutdown we do not flush the buffer pool:
713diff -ruN a/storage/innodb_plugin/log/log0recv.c b/storage/innodb_plugin/log/log0recv.c
714--- a/storage/innodb_plugin/log/log0recv.c725--- a/storage/innodb_plugin/log/log0recv.c
715+++ b/storage/innodb_plugin/log/log0recv.c726+++ b/storage/innodb_plugin/log/log0recv.c
716@@ -42,27 +42,27 @@727@@ -42,27 +42,27 @@
@@ -836,7 +847,6 @@
836 trx_rollback_or_clean_recovered(FALSE);847 trx_rollback_or_clean_recovered(FALSE);
837 }848 }
838 849
839diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0file.c
840--- a/storage/innodb_plugin/os/os0file.c850--- a/storage/innodb_plugin/os/os0file.c
841+++ b/storage/innodb_plugin/os/os0file.c851+++ b/storage/innodb_plugin/os/os0file.c
842@@ -554,7 +554,7 @@852@@ -554,7 +554,7 @@
@@ -892,7 +902,6 @@
892 ret = os_file_pwrite(file, buf, n, offset, offset_high);902 ret = os_file_pwrite(file, buf, n, offset, offset_high);
893 903
894 if ((ulint)ret == n) {904 if ((ulint)ret == n) {
895diff -ruN a/storage/innodb_plugin/os/os0thread.c b/storage/innodb_plugin/os/os0thread.c
896--- a/storage/innodb_plugin/os/os0thread.c905--- a/storage/innodb_plugin/os/os0thread.c
897+++ b/storage/innodb_plugin/os/os0thread.c906+++ b/storage/innodb_plugin/os/os0thread.c
898@@ -287,12 +287,17 @@907@@ -287,12 +287,17 @@
@@ -913,7 +922,6 @@
913 #endif922 #endif
914 }923 }
915 924
916diff -ruN a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c
917--- a/storage/innodb_plugin/row/row0merge.c925--- a/storage/innodb_plugin/row/row0merge.c
918+++ b/storage/innodb_plugin/row/row0merge.c926+++ b/storage/innodb_plugin/row/row0merge.c
919@@ -453,7 +453,9 @@927@@ -453,7 +453,9 @@
@@ -952,7 +960,6 @@
952 960
953 /* Read clustered index of the table and create files for961 /* Read clustered index of the table and create files for
954 secondary index entries for merge sort */962 secondary index entries for merge sort */
955diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
956--- a/storage/innodb_plugin/srv/srv0srv.c963--- a/storage/innodb_plugin/srv/srv0srv.c
957+++ b/storage/innodb_plugin/srv/srv0srv.c964+++ b/storage/innodb_plugin/srv/srv0srv.c
958@@ -402,6 +402,10 @@965@@ -402,6 +402,10 @@
@@ -991,7 +998,6 @@
991 }998 }
992 999
993 /*********************************************************************//**1000 /*********************************************************************//**
994diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
995--- a/storage/innodb_plugin/srv/srv0start.c1001--- a/storage/innodb_plugin/srv/srv0start.c
996+++ b/storage/innodb_plugin/srv/srv0start.c1002+++ b/storage/innodb_plugin/srv/srv0start.c
997@@ -94,6 +94,8 @@1003@@ -94,6 +94,8 @@
@@ -1067,7 +1073,6 @@
1067 srv_file_per_table = srv_file_per_table_original_value;1073 srv_file_per_table = srv_file_per_table_original_value;
1068 1074
1069 srv_was_started = TRUE;1075 srv_was_started = TRUE;
1070diff -ruN a/storage/innodb_plugin/trx/trx0purge.c b/storage/innodb_plugin/trx/trx0purge.c
1071--- a/storage/innodb_plugin/trx/trx0purge.c1076--- a/storage/innodb_plugin/trx/trx0purge.c
1072+++ b/storage/innodb_plugin/trx/trx0purge.c1077+++ b/storage/innodb_plugin/trx/trx0purge.c
1073@@ -1113,6 +1113,9 @@1078@@ -1113,6 +1113,9 @@
@@ -1080,7 +1085,6 @@
1080 mutex_enter(&(purge_sys->mutex));1085 mutex_enter(&(purge_sys->mutex));
1081 1086
1082 if (purge_sys->trx->n_active_thrs > 0) {1087 if (purge_sys->trx->n_active_thrs > 0) {
1083diff -ruN a/storage/innodb_plugin/trx/trx0rseg.c b/storage/innodb_plugin/trx/trx0rseg.c
1084--- a/storage/innodb_plugin/trx/trx0rseg.c1088--- a/storage/innodb_plugin/trx/trx0rseg.c
1085+++ b/storage/innodb_plugin/trx/trx0rseg.c1089+++ b/storage/innodb_plugin/trx/trx0rseg.c
1086@@ -143,9 +143,11 @@1090@@ -143,9 +143,11 @@
@@ -1095,7 +1099,6 @@
1095 1099
1096 undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);1100 undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);
1097 1101
1098diff -ruN a/storage/innodb_plugin/trx/trx0sys.c b/storage/innodb_plugin/trx/trx0sys.c
1099--- a/storage/innodb_plugin/trx/trx0sys.c1102--- a/storage/innodb_plugin/trx/trx0sys.c
1100+++ b/storage/innodb_plugin/trx/trx0sys.c1103+++ b/storage/innodb_plugin/trx/trx0sys.c
1101@@ -1931,10 +1931,12 @@1104@@ -1931,10 +1931,12 @@
@@ -1111,7 +1114,6 @@
1111 1114
1112 mem_free(trx_sys);1115 mem_free(trx_sys);
1113 1116
1114diff -ruN a/storage/innodb_plugin/trx/trx0trx.c b/storage/innodb_plugin/trx/trx0trx.c
1115--- a/storage/innodb_plugin/trx/trx0trx.c1117--- a/storage/innodb_plugin/trx/trx0trx.c
1116+++ b/storage/innodb_plugin/trx/trx0trx.c1118+++ b/storage/innodb_plugin/trx/trx0trx.c
1117@@ -109,8 +109,6 @@1119@@ -109,8 +109,6 @@
11181120
=== modified file 'patches/xtradb55.patch'
--- patches/xtradb55.patch 2011-06-26 03:06:10 +0000
+++ patches/xtradb55.patch 2011-09-15 04:23:22 +0000
@@ -1,4 +1,3 @@
1diff -ruN a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
2--- a/storage/innobase/btr/btr0btr.c1--- a/storage/innobase/btr/btr0btr.c
3+++ b/storage/innobase/btr/btr0btr.c2+++ b/storage/innobase/btr/btr0btr.c
4@@ -120,7 +120,7 @@3@@ -120,7 +120,7 @@
@@ -19,7 +18,6 @@
19 buf_block_t*18 buf_block_t*
20 btr_node_ptr_get_child(19 btr_node_ptr_get_child(
21 /*===================*/20 /*===================*/
22diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
23--- a/storage/innobase/buf/buf0buf.c21--- a/storage/innobase/buf/buf0buf.c
24+++ b/storage/innobase/buf/buf0buf.c22+++ b/storage/innobase/buf/buf0buf.c
25@@ -609,7 +609,7 @@23@@ -609,7 +609,7 @@
@@ -79,7 +77,6 @@
79 ibuf_merge_or_delete_for_page(77 ibuf_merge_or_delete_for_page(
80 /* Delete possible entries, if bpage is_corrupt */78 /* Delete possible entries, if bpage is_corrupt */
81 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :79 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :
82diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
83--- a/storage/innobase/fil/fil0fil.c80--- a/storage/innobase/fil/fil0fil.c
84+++ b/storage/innobase/fil/fil0fil.c81+++ b/storage/innobase/fil/fil0fil.c
85@@ -305,7 +305,7 @@82@@ -305,7 +305,7 @@
@@ -109,7 +106,7 @@
109 fil_node_open_file(106 fil_node_open_file(
110 /*===============*/107 /*===============*/
111 fil_node_t* node, /*!< in: file node */108 fil_node_t* node, /*!< in: file node */
112@@ -704,7 +704,14 @@109@@ -704,7 +704,17 @@
113 OS_FILE_READ_ONLY, &success);110 OS_FILE_READ_ONLY, &success);
114 if (!success) {111 if (!success) {
115 /* The following call prints an error message */112 /* The following call prints an error message */
@@ -118,14 +115,36 @@
118+ {115+ {
119+ ut_print_timestamp(stderr);116+ ut_print_timestamp(stderr);
120+ fprintf(stderr,117+ fprintf(stderr,
121+ " InnoDB: Warning: cannot open %s\n",118+ " InnoDB: Warning: cannot open %s\n"
119+ "InnoDB: this can happen if the table "
120+ "was removed or renamed during an \n"
121+ "InnoDB: xtrabackup run and is not dangerous.\n",
122+ node->name);122+ node->name);
123+ return(OS_FILE_NOT_FOUND);123+ return(OS_FILE_NOT_FOUND);
124+ }124+ }
125 125
126 ut_print_timestamp(stderr);126 ut_print_timestamp(stderr);
127 127
128@@ -794,8 +801,8 @@128@@ -765,12 +775,15 @@
129
130 if (UNIV_UNLIKELY(space_id != space->id)) {
131 fprintf(stderr,
132- "InnoDB: Error: tablespace id is %lu"
133+ "InnoDB: Warning: tablespace id is %lu"
134 " in the data dictionary\n"
135- "InnoDB: but in file %s it is %lu!\n",
136+ "InnoDB: but in file %s it is %lu!\n"
137+ "InnoDB: this can happen if the table metadata "
138+ "was modified during an xtrabackup run\n"
139+ "InnoDB: and is not dangerous.\n",
140 space->id, node->name, space_id);
141
142- ut_error;
143+ return(OS_FILE_NOT_FOUND);
144 }
145
146 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
147@@ -794,8 +807,8 @@
129 }148 }
130 149
131 if (size_bytes >= 1024 * 1024) {150 if (size_bytes >= 1024 * 1024) {
@@ -136,7 +155,7 @@
136 }155 }
137 156
138 if (!(flags & DICT_TF_ZSSIZE_MASK)) {157 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
139@@ -846,6 +853,8 @@158@@ -846,6 +859,8 @@
140 /* Put the node to the LRU list */159 /* Put the node to the LRU list */
141 UT_LIST_ADD_FIRST(LRU, system->LRU, node);160 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
142 }161 }
@@ -145,7 +164,7 @@
145 }164 }
146 165
147 /**********************************************************************//**166 /**********************************************************************//**
148@@ -1474,7 +1483,12 @@167@@ -1474,7 +1489,12 @@
149 the file yet; the following calls will open it and update the168 the file yet; the following calls will open it and update the
150 size fields */169 size fields */
151 170
@@ -159,7 +178,7 @@
159 fil_node_complete_io(node, fil_system, OS_FILE_READ);178 fil_node_complete_io(node, fil_system, OS_FILE_READ);
160 }179 }
161 180
162@@ -1526,7 +1540,12 @@181@@ -1526,7 +1546,12 @@
163 the file yet; the following calls will open it and update the182 the file yet; the following calls will open it and update the
164 size fields */183 size fields */
165 184
@@ -191,7 +210,7 @@
191 }210 }
192 }211 }
193 212
194@@ -2369,7 +2388,7 @@213@@ -2369,7 +2394,7 @@
195 }214 }
196 215
197 if (success) {216 if (success) {
@@ -200,7 +219,7 @@
200 /* Write a log record about the deletion of the .ibd219 /* Write a log record about the deletion of the .ibd
201 file, so that ibbackup can replay it in the220 file, so that ibbackup can replay it in the
202 --apply-log phase. We use a dummy mtr and the familiar221 --apply-log phase. We use a dummy mtr and the familiar
203@@ -2670,7 +2689,7 @@222@@ -2670,7 +2695,7 @@
204 223
205 mutex_exit(&fil_system->mutex);224 mutex_exit(&fil_system->mutex);
206 225
@@ -209,7 +228,7 @@
209 if (success) {228 if (success) {
210 mtr_t mtr;229 mtr_t mtr;
211 230
212@@ -2861,7 +2880,7 @@231@@ -2861,7 +2886,7 @@
213 232
214 fil_node_create(path, size, space_id, FALSE);233 fil_node_create(path, size, space_id, FALSE);
215 234
@@ -218,7 +237,7 @@
218 {237 {
219 mtr_t mtr;238 mtr_t mtr;
220 239
221@@ -3116,19 +3135,97 @@240@@ -3116,19 +3141,97 @@
222 "InnoDB: open the tablespace file ", stderr);241 "InnoDB: open the tablespace file ", stderr);
223 ut_print_filename(stderr, filepath);242 ut_print_filename(stderr, filepath);
224 fputs("!\n"243 fputs("!\n"
@@ -326,7 +345,7 @@
326 return(FALSE);345 return(FALSE);
327 }346 }
328 347
329@@ -3836,7 +3933,7 @@348@@ -3836,7 +3939,7 @@
330 cannot be ok. */349 cannot be ok. */
331 350
332 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;351 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
@@ -335,7 +354,7 @@
335 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {354 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
336 fprintf(stderr,355 fprintf(stderr,
337 "InnoDB: Error: the size of single-table tablespace"356 "InnoDB: Error: the size of single-table tablespace"
338@@ -3977,7 +4074,7 @@357@@ -3977,7 +4080,7 @@
339 idea is to read as much good data as we can and jump over bad data.358 idea is to read as much good data as we can and jump over bad data.
340 @return 0 if ok, -1 if error even after the retries, 1 if at the end359 @return 0 if ok, -1 if error even after the retries, 1 if at the end
341 of the directory */360 of the directory */
@@ -344,7 +363,7 @@
344 int363 int
345 fil_file_readdir_next_file(364 fil_file_readdir_next_file(
346 /*=======================*/365 /*=======================*/
347@@ -4276,15 +4373,97 @@366@@ -4276,15 +4379,97 @@
348 "InnoDB: in InnoDB data dictionary"367 "InnoDB: in InnoDB data dictionary"
349 " has tablespace id %lu,\n"368 " has tablespace id %lu,\n"
350 "InnoDB: but tablespace with that id"369 "InnoDB: but tablespace with that id"
@@ -450,7 +469,7 @@
450 } else {469 } else {
451 ut_print_timestamp(stderr);470 ut_print_timestamp(stderr);
452 fputs(" InnoDB: Error: table ", stderr);471 fputs(" InnoDB: Error: table ", stderr);
453@@ -4683,7 +4862,7 @@472@@ -4683,7 +4868,7 @@
454 off the LRU list if it is in the LRU list. The caller must hold the fil_sys473 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
455 mutex. */474 mutex. */
456 static475 static
@@ -459,7 +478,7 @@
459 fil_node_prepare_for_io(478 fil_node_prepare_for_io(
460 /*====================*/479 /*====================*/
461 fil_node_t* node, /*!< in: file node */480 fil_node_t* node, /*!< in: file node */
462@@ -4703,10 +4882,13 @@481@@ -4703,10 +4888,13 @@
463 }482 }
464 483
465 if (node->open == FALSE) {484 if (node->open == FALSE) {
@@ -474,7 +493,7 @@
474 }493 }
475 494
476 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE495 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
477@@ -4719,6 +4901,8 @@496@@ -4719,6 +4907,8 @@
478 }497 }
479 498
480 node->n_pending++;499 node->n_pending++;
@@ -511,7 +530,6 @@
511 node = UT_LIST_GET_FIRST(space->chain);530 node = UT_LIST_GET_FIRST(space->chain);
512 531
513 for (;;) {532 for (;;) {
514diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
515--- a/storage/innobase/handler/ha_innodb.cc533--- a/storage/innobase/handler/ha_innodb.cc
516+++ b/storage/innobase/handler/ha_innodb.cc534+++ b/storage/innobase/handler/ha_innodb.cc
517@@ -460,13 +460,6 @@535@@ -460,13 +460,6 @@
@@ -597,7 +615,6 @@
597 MYSQL_SYSVAR(flush_method),615 MYSQL_SYSVAR(flush_method),
598 MYSQL_SYSVAR(force_recovery),616 MYSQL_SYSVAR(force_recovery),
599 MYSQL_SYSVAR(locks_unsafe_for_binlog),617 MYSQL_SYSVAR(locks_unsafe_for_binlog),
600diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
601--- a/storage/innobase/ibuf/ibuf0ibuf.c618--- a/storage/innobase/ibuf/ibuf0ibuf.c
602+++ b/storage/innobase/ibuf/ibuf0ibuf.c619+++ b/storage/innobase/ibuf/ibuf0ibuf.c
603@@ -1202,6 +1202,9 @@620@@ -1202,6 +1202,9 @@
@@ -635,7 +652,6 @@
635 while (sum_pages < n_pages) {652 while (sum_pages < n_pages) {
636 n_bytes = ibuf_contract_ext(&n_pag2, sync);653 n_bytes = ibuf_contract_ext(&n_pag2, sync);
637 654
638diff -ruN a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
639--- a/storage/innobase/include/ha_prototypes.h655--- a/storage/innobase/include/ha_prototypes.h
640+++ b/storage/innobase/include/ha_prototypes.h656+++ b/storage/innobase/include/ha_prototypes.h
641@@ -275,12 +275,5 @@657@@ -275,12 +275,5 @@
@@ -651,7 +667,6 @@
651- void* thd);667- void* thd);
652 668
653 #endif669 #endif
654diff -ruN a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
655--- a/storage/innobase/include/log0recv.h670--- a/storage/innobase/include/log0recv.h
656+++ b/storage/innobase/include/log0recv.h671+++ b/storage/innobase/include/log0recv.h
657@@ -444,7 +444,7 @@672@@ -444,7 +444,7 @@
@@ -663,7 +678,6 @@
663 time_t stats_recv_start_time;678 time_t stats_recv_start_time;
664 ulint stats_recv_turns;679 ulint stats_recv_turns;
665 680
666diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
667--- a/storage/innobase/include/srv0srv.h681--- a/storage/innobase/include/srv0srv.h
668+++ b/storage/innobase/include/srv0srv.h682+++ b/storage/innobase/include/srv0srv.h
669@@ -148,8 +148,7 @@683@@ -148,8 +148,7 @@
@@ -687,7 +701,6 @@
687 /*-------------------------------------------*/701 /*-------------------------------------------*/
688 702
689 extern ulint srv_n_rows_inserted;703 extern ulint srv_n_rows_inserted;
690diff -ruN a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h
691--- a/storage/innobase/include/srv0start.h704--- a/storage/innobase/include/srv0start.h
692+++ b/storage/innobase/include/srv0start.h705+++ b/storage/innobase/include/srv0start.h
693@@ -91,6 +91,8 @@706@@ -91,6 +91,8 @@
@@ -699,7 +712,6 @@
699 #ifdef HAVE_DARWIN_THREADS712 #ifdef HAVE_DARWIN_THREADS
700 /** TRUE if the F_FULLFSYNC option is available */713 /** TRUE if the F_FULLFSYNC option is available */
701 extern ibool srv_have_fullfsync;714 extern ibool srv_have_fullfsync;
702diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
703--- a/storage/innobase/log/log0log.c715--- a/storage/innobase/log/log0log.c
704+++ b/storage/innobase/log/log0log.c716+++ b/storage/innobase/log/log0log.c
705@@ -1154,7 +1154,7 @@717@@ -1154,7 +1154,7 @@
@@ -745,7 +757,6 @@
745 757
746 if (srv_fast_shutdown == 2) {758 if (srv_fast_shutdown == 2) {
747 /* In this fastest shutdown we do not flush the buffer pool:759 /* In this fastest shutdown we do not flush the buffer pool:
748diff -ruN a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
749--- a/storage/innobase/log/log0recv.c760--- a/storage/innobase/log/log0recv.c
750+++ b/storage/innobase/log/log0recv.c761+++ b/storage/innobase/log/log0recv.c
751@@ -42,27 +42,27 @@762@@ -42,27 +42,27 @@
@@ -871,7 +882,6 @@
871 trx_rollback_or_clean_recovered(FALSE);882 trx_rollback_or_clean_recovered(FALSE);
872 }883 }
873 884
874diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
875--- a/storage/innobase/os/os0file.c885--- a/storage/innobase/os/os0file.c
876+++ b/storage/innobase/os/os0file.c886+++ b/storage/innobase/os/os0file.c
877@@ -660,7 +660,7 @@887@@ -660,7 +660,7 @@
@@ -945,7 +955,6 @@
945 ret = os_file_pwrite(file, buf, n, offset, offset_high);955 ret = os_file_pwrite(file, buf, n, offset, offset_high);
946 956
947 if ((ulint)ret == n) {957 if ((ulint)ret == n) {
948diff -ruN a/storage/innobase/os/os0thread.c b/storage/innobase/os/os0thread.c
949--- a/storage/innobase/os/os0thread.c958--- a/storage/innobase/os/os0thread.c
950+++ b/storage/innobase/os/os0thread.c959+++ b/storage/innobase/os/os0thread.c
951@@ -266,12 +266,17 @@960@@ -266,12 +266,17 @@
@@ -966,7 +975,6 @@
966 #endif975 #endif
967 }976 }
968 977
969diff -ruN a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
970--- a/storage/innobase/row/row0merge.c978--- a/storage/innobase/row/row0merge.c
971+++ b/storage/innobase/row/row0merge.c979+++ b/storage/innobase/row/row0merge.c
972@@ -459,7 +459,9 @@980@@ -459,7 +459,9 @@
@@ -1005,7 +1013,6 @@
1005 1013
1006 /* Read clustered index of the table and create files for1014 /* Read clustered index of the table and create files for
1007 secondary index entries for merge sort */1015 secondary index entries for merge sort */
1008diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
1009--- a/storage/innobase/srv/srv0srv.c1016--- a/storage/innobase/srv/srv0srv.c
1010+++ b/storage/innobase/srv/srv0srv.c1017+++ b/storage/innobase/srv/srv0srv.c
1011@@ -197,8 +197,7 @@1018@@ -197,8 +197,7 @@
@@ -1063,7 +1070,6 @@
1063 }1070 }
1064 1071
1065 if (trx->was_chosen_as_deadlock_victim) {1072 if (trx->was_chosen_as_deadlock_victim) {
1066diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
1067--- a/storage/innobase/srv/srv0start.c1073--- a/storage/innobase/srv/srv0start.c
1068+++ b/storage/innobase/srv/srv0start.c1074+++ b/storage/innobase/srv/srv0start.c
1069@@ -94,6 +94,8 @@1075@@ -94,6 +94,8 @@
@@ -1138,7 +1144,6 @@
1138 srv_file_per_table = srv_file_per_table_original_value;1144 srv_file_per_table = srv_file_per_table_original_value;
1139 1145
1140 srv_was_started = TRUE;1146 srv_was_started = TRUE;
1141diff -ruN a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c
1142--- a/storage/innobase/trx/trx0purge.c1147--- a/storage/innobase/trx/trx0purge.c
1143+++ b/storage/innobase/trx/trx0purge.c1148+++ b/storage/innobase/trx/trx0purge.c
1144@@ -1100,6 +1100,9 @@1149@@ -1100,6 +1100,9 @@
@@ -1151,7 +1156,6 @@
1151 mutex_enter(&(purge_sys->mutex));1156 mutex_enter(&(purge_sys->mutex));
1152 1157
1153 if (purge_sys->trx->n_active_thrs > 0) {1158 if (purge_sys->trx->n_active_thrs > 0) {
1154diff -ruN a/storage/innobase/trx/trx0rseg.c b/storage/innobase/trx/trx0rseg.c
1155--- a/storage/innobase/trx/trx0rseg.c1159--- a/storage/innobase/trx/trx0rseg.c
1156+++ b/storage/innobase/trx/trx0rseg.c1160+++ b/storage/innobase/trx/trx0rseg.c
1157@@ -140,9 +140,11 @@1161@@ -140,9 +140,11 @@
@@ -1166,7 +1170,6 @@
1166 1170
1167 undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);1171 undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);
1168 1172
1169diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
1170--- a/storage/innobase/trx/trx0sys.c1173--- a/storage/innobase/trx/trx0sys.c
1171+++ b/storage/innobase/trx/trx0sys.c1174+++ b/storage/innobase/trx/trx0sys.c
1172@@ -1938,10 +1938,12 @@1175@@ -1938,10 +1938,12 @@
@@ -1182,7 +1185,6 @@
1182 1185
1183 mem_free(trx_sys);1186 mem_free(trx_sys);
1184 1187
1185diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
1186--- a/storage/innobase/trx/trx0trx.c1188--- a/storage/innobase/trx/trx0trx.c
1187+++ b/storage/innobase/trx/trx0trx.c1189+++ b/storage/innobase/trx/trx0trx.c
1188@@ -505,8 +505,8 @@1190@@ -505,8 +505,8 @@
11891191
=== modified file 'test/inc/common.sh'
--- test/inc/common.sh 2011-06-29 05:38:02 +0000
+++ test/inc/common.sh 2011-09-15 04:23:22 +0000
@@ -230,3 +230,12 @@
230 let "race_cycle_cnt=race_cycle_cnt+1"230 let "race_cycle_cnt=race_cycle_cnt+1"
231 done231 done
232}232}
233
234########################################################################
235# Prints checksum for a given table.
236# Expects 2 arguments: $1 is the DB name and $2 is the table to checksum
237########################################################################
238function checksum_table()
239{
240 $MYSQL $MYSQL_ARGS -Ns -e "CHECKSUM TABLE $2" $1 | awk {'print $2'}
241}
233\ No newline at end of file242\ No newline at end of file
234243
=== added file 'test/t/bug722638.sh'
--- test/t/bug722638.sh 1970-01-01 00:00:00 +0000
+++ test/t/bug722638.sh 2011-09-15 04:23:22 +0000
@@ -0,0 +1,119 @@
1########################################################################
2# Bug #722638: xtrabackup: taking backup while tables are droped and
3# created breaks backup
4########################################################################
5
6if ! `$XB_BIN --help | grep debug-sync > /dev/null`; then
7 echo "Requires --debug-sync support" > $SKIPPED_REASON
8 exit $SKIPPED_EXIT_CODE
9fi
10
11. inc/common.sh
12
13init
14run_mysqld --innodb_file_per_table
15
16run_cmd $MYSQL $MYSQL_ARGS test <<EOF
17
18CREATE TABLE t1(a INT) ENGINE=InnoDB;
19INSERT INTO t1 VALUES (1), (2), (3);
20
21CREATE TABLE t2(a INT) ENGINE=InnoDB;
22INSERT INTO t2 VALUES (1), (2), (3);
23
24CREATE TABLE t3(a INT) ENGINE=InnoDB;
25INSERT INTO t3 VALUES (1), (2), (3);
26
27CREATE TABLE t4_old(a INT) ENGINE=InnoDB;
28INSERT INTO t4_old VALUES (1), (2), (3);
29
30EOF
31
32mkdir -p $topdir/backup
33
34# Backup
35xtrabackup --datadir=$mysql_datadir --backup --target-dir=$topdir/backup \
36 --debug-sync="data_copy_thread_func" &
37
38job_pid=$!
39
40pid_file=$topdir/backup/xtrabackup_debug_sync
41
42# Wait for xtrabackup to suspend
43i=0
44while [ ! -r "$pid_file" ]
45do
46 sleep 1
47 i=$((i+1))
48 echo "Waited $i seconds for $pid_file to be created"
49done
50
51xb_pid=`cat $pid_file`
52
53# Modify the original tables, then change spaces ids by running DDL
54
55run_cmd $MYSQL $MYSQL_ARGS test <<EOF
56
57INSERT INTO t1 VALUES (4), (5), (6);
58DROP TABLE t1;
59CREATE TABLE t1(a CHAR(1)) ENGINE=InnoDB;
60INSERT INTO t1 VALUES ("1"), ("2"), ("3");
61
62INSERT INTO t2 VALUES (4), (5), (6);
63ALTER TABLE t2 MODIFY a BIGINT;
64INSERT INTO t2 VALUES (7), (8), (9);
65
66INSERT INTO t3 VALUES (4), (5), (6);
67TRUNCATE t3;
68INSERT INTO t3 VALUES (7), (8), (9);
69
70INSERT INTO t4_old VALUES (4), (5), (6);
71ALTER TABLE t4_old RENAME t4;
72INSERT INTO t4 VALUES (7), (8), (9);
73
74EOF
75
76# Calculate checksums
77checksum_t1=`checksum_table test t1`
78checksum_t2=`checksum_table test t2`
79checksum_t3=`checksum_table test t3`
80checksum_t4=`checksum_table test t4`
81
82# Resume xtrabackup
83vlog "Resuming xtrabackup"
84kill -SIGCONT $xb_pid
85
86run_cmd wait $job_pid
87
88# Prepare
89xtrabackup --datadir=$mysql_datadir --prepare --target-dir=$topdir/backup
90
91stop_mysqld
92
93# Restore
94rm -rf $mysql_datadir/ibdata1 $mysql_datadir/ib_logfile* \
95 $mysql_datadir/test/*.ibd
96cp -r $topdir/backup/* $mysql_datadir
97
98run_mysqld --innodb_file_per_table
99
100# Verify checksums
101checksum_t1_new=`checksum_table test t1`
102checksum_t2_new=`checksum_table test t2`
103checksum_t3_new=`checksum_table test t3`
104checksum_t4_new=`checksum_table test t4`
105vlog "Checksums (old/new):"
106vlog "t1: $checksum_t1/$checksum_t1_new"
107vlog "t2: $checksum_t2/$checksum_t2_new"
108vlog "t3: $checksum_t3/$checksum_t3_new"
109vlog "t4: $checksum_t4/$checksum_t4_new"
110
111if [ "$checksum_t1" = "$checksum_t1_new" -a \
112 "$checksum_t2" = "$checksum_t2_new" -a \
113 "$checksum_t3" = "$checksum_t3_new" -a \
114 "$checksum_t4" = "$checksum_t4_new" ]; then
115 exit 0
116fi
117
118vlog "Checksums do not match"
119exit -1
0120
=== modified file 'test/t/bug723097.sh'
--- test/t/bug723097.sh 2011-06-12 10:16:51 +0000
+++ test/t/bug723097.sh 2011-09-15 04:23:22 +0000
@@ -7,7 +7,7 @@
7run_cmd ${MYSQL} ${MYSQL_ARGS} test < inc/bug723097.sql7run_cmd ${MYSQL} ${MYSQL_ARGS} test < inc/bug723097.sql
88
9vlog "Saving checksum"9vlog "Saving checksum"
10checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "CHECKSUM TABLE messages" test | awk {'print $2'}`10checksum_a=`checksum_table test messages`
11vlog "Checksum before is $checksum_a"11vlog "Checksum before is $checksum_a"
1212
13vlog "Creating backup directory"13vlog "Creating backup directory"
@@ -24,7 +24,7 @@
24cp -r * $mysql_datadir/test24cp -r * $mysql_datadir/test
25cd -25cd -
26run_mysqld --innodb_file_per_table26run_mysqld --innodb_file_per_table
27checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "CHECKSUM TABLE messages" test | awk {'print $2'}`27checksum_b=`checksum_table test messages`
28vlog "Checksum after is $checksum_b"28vlog "Checksum after is $checksum_b"
2929
30if [ $checksum_a -eq $checksum_b ]30if [ $checksum_a -eq $checksum_b ]
3131
=== modified file 'test/t/bug810269.sh'
--- test/t/bug810269.sh 2011-08-10 01:26:20 +0000
+++ test/t/bug810269.sh 2011-09-15 04:23:22 +0000
@@ -46,8 +46,7 @@
4646
47vlog "Initial rows added"47vlog "Initial rows added"
4848
49checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" \49checksum_a=`checksum_table incremental_sample test`
50incremental_sample | awk '{print $2}'`
5150
52vlog "Starting streaming backup"51vlog "Starting streaming backup"
5352
@@ -71,8 +70,7 @@
7170
72run_mysqld71run_mysqld
7372
74checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" \73checksum_b=`checksum_table incremental_sample test`
75incremental_sample | awk '{print $2}'`
7674
77if [ "$checksum_a" != "$checksum_b" ]; then75if [ "$checksum_a" != "$checksum_b" ]; then
78 vlog "Checksums do not match"76 vlog "Checksums do not match"
7977
=== modified file 'test/t/ib_csm_csv.sh'
--- test/t/ib_csm_csv.sh 2011-06-10 07:55:26 +0000
+++ test/t/ib_csm_csv.sh 2011-09-15 04:23:22 +0000
@@ -25,7 +25,7 @@
25vlog "Full backup done to directory $full_backup_dir"25vlog "Full backup done to directory $full_backup_dir"
2626
27# Saving the checksum of original table27# Saving the checksum of original table
28checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table csm;" csv | awk '{print $2}'`28checksum_a=`checksum_table csv csm`
29vlog "Table checksum is $checksum_a"29vlog "Table checksum is $checksum_a"
3030
31vlog "Preparing backup"31vlog "Preparing backup"
@@ -50,10 +50,10 @@
50vlog "Data restored"50vlog "Data restored"
5151
52run_mysqld --innodb_file_per_table52run_mysqld --innodb_file_per_table
53vlog "Checking checksums"53checksum_b=`checksum_table csv csm`
54checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table csm" incremental_sample | awk '{print $2}'`54vlog "Checking checksums: $checksum_a/$checksum_b"
5555
56if [ $checksum_a -ne $checksum_b ]56if [ "$checksum_a" != "$checksum_b" ]
57then 57then
58 vlog "Checksums are not equal"58 vlog "Checksums are not equal"
59 exit -159 exit -1
6060
=== modified file 'test/t/ib_incremental.sh'
--- test/t/ib_incremental.sh 2011-06-29 05:38:02 +0000
+++ test/t/ib_incremental.sh 2011-09-15 04:23:22 +0000
@@ -37,7 +37,7 @@
37vlog "Changes done"37vlog "Changes done"
3838
39# Saving the checksum of original table39# Saving the checksum of original table
40checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`40checksum_a=`checksum_table incremental_sample test`
41vlog "Table checksum is $checksum_a"41vlog "Table checksum is $checksum_a"
4242
43vlog "Making incremental backup"43vlog "Making incremental backup"
@@ -87,7 +87,7 @@
87run_mysqld --innodb_file_per_table87run_mysqld --innodb_file_per_table
8888
89vlog "Checking checksums"89vlog "Checking checksums"
90checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`90checksum_b=`checksum_table incremental_sample test`
9191
92if [ $checksum_a -ne $checksum_b ]92if [ $checksum_a -ne $checksum_b ]
93then 93then
9494
=== modified file 'test/t/xb_export.sh'
--- test/t/xb_export.sh 2011-06-28 09:31:12 +0000
+++ test/t/xb_export.sh 2011-09-15 04:23:22 +0000
@@ -38,7 +38,7 @@
38done38done
39vlog "Initial rows added"39vlog "Initial rows added"
4040
41checksum_1=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test" incremental_sample | awk '{print $2}'`41checksum_1=`checksum_table incremental_sample test`
42rowsnum_1=`${MYSQL} ${MYSQL_ARGS} -Ns -e "select count(*) from test" incremental_sample`42rowsnum_1=`${MYSQL} ${MYSQL_ARGS} -Ns -e "select count(*) from test" incremental_sample`
43vlog "rowsnum_1 is $rowsnum_1"43vlog "rowsnum_1 is $rowsnum_1"
44vlog "checksum_1 is $checksum_1"44vlog "checksum_1 is $checksum_1"
@@ -74,7 +74,7 @@
74vlog "Table has been imported"74vlog "Table has been imported"
7575
76vlog "Cheking checksums"76vlog "Cheking checksums"
77checksum_2=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`77checksum_2=`checksum_table incremental_sample test`
78vlog "checksum_2 is $checksum_2"78vlog "checksum_2 is $checksum_2"
79rowsnum_1=`${MYSQL} ${MYSQL_ARGS} -Ns -e "select count(*) from test" incremental_sample`79rowsnum_1=`${MYSQL} ${MYSQL_ARGS} -Ns -e "select count(*) from test" incremental_sample`
80vlog "rowsnum_1 is $rowsnum_1"80vlog "rowsnum_1 is $rowsnum_1"
@@ -120,7 +120,7 @@
120run_mysqld120run_mysqld
121121
122vlog "Cheking checksums"122vlog "Cheking checksums"
123checksum_3=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`123checksum_3=`checksum_table incremental_sample test`
124vlog "checksum_3 is $checksum_3"124vlog "checksum_3 is $checksum_3"
125125
126if [ "$checksum_3" != $checksum_2 ]126if [ "$checksum_3" != $checksum_2 ]
127127
=== modified file 'test/t/xb_incremental.sh'
--- test/t/xb_incremental.sh 2011-06-10 07:55:26 +0000
+++ test/t/xb_incremental.sh 2011-09-15 04:23:22 +0000
@@ -47,7 +47,7 @@
47vlog "Changes done"47vlog "Changes done"
4848
49# Saving the checksum of original table49# Saving the checksum of original table
50checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`50checksum_a=`checksum_table incremental_sample test`
5151
52vlog "Table checksum is $checksum_a"52vlog "Table checksum is $checksum_a"
53vlog "Making incremental backup"53vlog "Making incremental backup"
@@ -83,7 +83,7 @@
83run_mysqld --innodb_file_per_table83run_mysqld --innodb_file_per_table
8484
85vlog "Checking checksums"85vlog "Checking checksums"
86checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`86checksum_b=`checksum_table incremental_sample test`
8787
88if [ $checksum_a -ne $checksum_b ]88if [ $checksum_a -ne $checksum_b ]
89then 89then
9090
=== modified file 'test/t/xb_incremental_compressed.sh'
--- test/t/xb_incremental_compressed.sh 2011-06-22 17:55:52 +0000
+++ test/t/xb_incremental_compressed.sh 2011-09-15 04:23:22 +0000
@@ -103,8 +103,7 @@
103 vlog "Changes done"103 vlog "Changes done"
104104
105 # Saving the checksum of original table105 # Saving the checksum of original table
106 checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" \106 checksum_a=`checksum_table incremental_sample test`
107incremental_sample | awk '{print $2}'`
108107
109 vlog "Table checksum is $checksum_a"108 vlog "Table checksum is $checksum_a"
110109
@@ -148,8 +147,7 @@
148 run_mysqld ${mysqld_additional_args}147 run_mysqld ${mysqld_additional_args}
149148
150 vlog "Cheking checksums"149 vlog "Cheking checksums"
151 checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" \150 checksum_b=`checksum_table incremental_sample test`
152incremental_sample | awk '{print $2}'`
153151
154 if [ $checksum_a -ne $checksum_b ]152 if [ $checksum_a -ne $checksum_b ]
155 then 153 then
156154
=== modified file 'test/t/xb_part_range.sh'
--- test/t/xb_part_range.sh 2011-06-22 08:07:10 +0000
+++ test/t/xb_part_range.sh 2011-09-15 04:23:22 +0000
@@ -59,7 +59,7 @@
59vlog "Changes done"59vlog "Changes done"
6060
61# Saving the checksum of original table61# Saving the checksum of original table
62checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" test | awk '{print $2}'`62checksum_a=`checksum_table test test`
6363
64vlog "Table checksum is $checksum_a - before backup"64vlog "Table checksum is $checksum_a - before backup"
6565
@@ -102,7 +102,7 @@
102run_mysqld102run_mysqld
103103
104vlog "Cheking checksums"104vlog "Cheking checksums"
105checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" test | awk '{print $2}'`105checksum_b=`checksum_table test test`
106106
107if [ $checksum_a -ne $checksum_b ]107if [ $checksum_a -ne $checksum_b ]
108then 108then
109109
=== modified file 'test/t/xb_partial.sh'
--- test/t/xb_partial.sh 2011-06-10 07:55:26 +0000
+++ test/t/xb_partial.sh 2011-09-15 04:23:22 +0000
@@ -14,7 +14,7 @@
14 let "count=count+1"14 let "count=count+1"
15done15done
16vlog "Initial rows added"16vlog "Initial rows added"
17checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`17checksum_a=`checksum_table incremental_sample test`
18vlog "Table checksum is $checksum_a"18vlog "Table checksum is $checksum_a"
1919
20# Backup directory20# Backup directory
@@ -42,7 +42,7 @@
42vlog "Data restored"42vlog "Data restored"
43run_mysqld --innodb_file_per_table43run_mysqld --innodb_file_per_table
44vlog "Checking checksums"44vlog "Checking checksums"
45checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" incremental_sample | awk '{print $2}'`45checksum_b=`checksum_table incremental_sample test`
4646
47if [ $checksum_a -ne $checksum_b ]47if [ $checksum_a -ne $checksum_b ]
48then 48then
4949
=== modified file 'xtrabackup.c'
--- xtrabackup.c 2011-08-10 01:26:20 +0000
+++ xtrabackup.c 2011-09-15 04:23:22 +0000
@@ -812,6 +812,8 @@
812#define INNOBASE_WAKE_INTERVAL 32812#define INNOBASE_WAKE_INTERVAL 32
813ulong innobase_active_counter = 0;813ulong innobase_active_counter = 0;
814814
815static char *xtrabackup_debug_sync = NULL;
816
815/* ======== Datafiles iterator ======== */817/* ======== Datafiles iterator ======== */
816typedef struct {818typedef struct {
817 fil_system_t *system;819 fil_system_t *system;
@@ -961,7 +963,8 @@
961 OPT_INNODB_OPEN_FILES,963 OPT_INNODB_OPEN_FILES,
962 OPT_INNODB_SYNC_SPIN_LOOPS,964 OPT_INNODB_SYNC_SPIN_LOOPS,
963 OPT_INNODB_THREAD_CONCURRENCY,965 OPT_INNODB_THREAD_CONCURRENCY,
964 OPT_INNODB_THREAD_SLEEP_DELAY966 OPT_INNODB_THREAD_SLEEP_DELAY,
967 OPT_XTRA_DEBUG_SYNC
965};968};
966969
967static struct my_option my_long_options[] =970static struct my_option my_long_options[] =
@@ -1219,45 +1222,59 @@
1219 (G_PTR*) &innobase_doublewrite_file, (G_PTR*) &innobase_doublewrite_file,1222 (G_PTR*) &innobase_doublewrite_file, (G_PTR*) &innobase_doublewrite_file,
1220 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},1223 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1221#endif1224#endif
1222/*1225
1223 {"innodb_rollback_on_timeout", OPT_INNODB_ROLLBACK_ON_TIMEOUT,1226#ifndef __WIN__
1224 "Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)",1227 {"debug-sync", OPT_XTRA_DEBUG_SYNC,
1225 (G_PTR*) &innobase_rollback_on_timeout, (G_PTR*) &innobase_rollback_on_timeout,1228 "Debug sync point. This is only used by the xtrabackup test suite",
1226 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},1229 (G_PTR*) &xtrabackup_debug_sync,
1227*/1230 (G_PTR*) &xtrabackup_debug_sync,
1228/*1231 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1229 {"innodb_status_file", OPT_INNODB_STATUS_FILE,1232#endif
1230 "Enable SHOW INNODB STATUS output in the innodb_status.<pid> file",
1231 (G_PTR*) &innobase_create_status_file, (G_PTR*) &innobase_create_status_file,
1232 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
1233*/
1234/*
1235 {"innodb_sync_spin_loops", OPT_INNODB_SYNC_SPIN_LOOPS,
1236 "Count of spin-loop rounds in InnoDB mutexes",
1237 (G_PTR*) &srv_n_spin_wait_rounds,
1238 (G_PTR*) &srv_n_spin_wait_rounds,
1239 0, GET_ULONG, REQUIRED_ARG, 20L, 0L, ULONG_MAX, 0, 1L, 0},
1240*/
1241/*
1242 {"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY,
1243 "Helps in performance tuning in heavily concurrent environments. "
1244 "Sets the maximum number of threads allowed inside InnoDB. Value 0"
1245 " will disable the thread throttling.",
1246 (G_PTR*) &srv_thread_concurrency, (G_PTR*) &srv_thread_concurrency,
1247 0, GET_ULONG, REQUIRED_ARG, 8, 0, 1000, 0, 1, 0},
1248*/
1249/*
1250 {"innodb_thread_sleep_delay", OPT_INNODB_THREAD_SLEEP_DELAY,
1251 "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0"
1252 " disable a sleep",
1253 (G_PTR*) &srv_thread_sleep_delay,
1254 (G_PTR*) &srv_thread_sleep_delay,
1255 0, GET_ULONG, REQUIRED_ARG, 10000L, 0L, ULONG_MAX, 0, 1L, 0},
1256*/
12571233
1258 { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}1234 { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
1259};1235};
12601236
1237UNIV_INLINE
1238void
1239debug_sync_point(const char *name)
1240{
1241#ifndef __WIN__
1242 FILE *fp;
1243 pid_t pid;
1244 char pid_path[FN_REFLEN];
1245
1246 if (xtrabackup_debug_sync == NULL) {
1247 return;
1248 }
1249
1250 if (strcmp(xtrabackup_debug_sync, name)) {
1251 return;
1252 }
1253
1254 pid = getpid();
1255
1256 snprintf(pid_path, sizeof(pid_path), "%s/xtrabackup_debug_sync",
1257 xtrabackup_target_dir);
1258 fp = fopen(pid_path, "w");
1259 if (fp == NULL) {
1260 fprintf(stderr, "xtrabackup: Error: cannot open %s\n",
1261 pid_path);
1262 exit(EXIT_FAILURE);
1263 }
1264 fprintf(fp, "%u\n", (uint) pid);
1265 fclose(fp);
1266
1267 fprintf(stderr, "xtrabackup: DEBUG: "
1268 "Suspending at debug sync point '%s'. "
1269 "Resume with 'kill -SIGCONT %u'.\n", name, (uint) pid);
1270
1271 kill(pid, SIGSTOP);
1272
1273 /* On resume */
1274 my_delete(pid_path, MYF(MY_WME));
1275#endif
1276}
1277
1261static const char *load_default_groups[]= { "mysqld","xtrabackup",0 };1278static const char *load_default_groups[]= { "mysqld","xtrabackup",0 };
12621279
1263static void print_version(void)1280static void print_version(void)
@@ -2816,11 +2833,6 @@
2816#else2833#else
2817 zip_size = fil_space_get_zip_size(node->space->id);2834 zip_size = fil_space_get_zip_size(node->space->id);
2818 if (zip_size == ULINT_UNDEFINED) {2835 if (zip_size == ULINT_UNDEFINED) {
2819 fprintf(stderr, "[%02u] xtrabackup: Warning: "
2820 "Failed to determine page size for %s.\n"
2821 "[%02u] xtrabackup: Warning: We assume the table was "
2822 "dropped during xtrabackup execution and ignore the "
2823 "file.\n", thread_n, node->name, thread_n);
2824 goto skip;2836 goto skip;
2825 } else if (zip_size) {2837 } else if (zip_size) {
2826 page_size = zip_size;2838 page_size = zip_size;
@@ -2884,8 +2896,8 @@
2884 fprintf(stderr,2896 fprintf(stderr,
2885 "[%02u] xtrabackup: Warning: cannot open %s\n"2897 "[%02u] xtrabackup: Warning: cannot open %s\n"
2886 "[%02u] xtrabackup: Warning: We assume the "2898 "[%02u] xtrabackup: Warning: We assume the "
2887 "table was dropped during xtrabackup execution "2899 "table was dropped or renamed during "
2888 "and ignore the file.\n",2900 "xtrabackup execution and ignore the file.\n",
2889 thread_n, node->name, thread_n);2901 thread_n, node->name, thread_n);
2890 goto skip;2902 goto skip;
2891 }2903 }
@@ -3583,6 +3595,8 @@
3583 */3595 */
3584 my_thread_init();3596 my_thread_init();
35853597
3598 debug_sync_point("data_copy_thread_func");
3599
3586 while ((node = datafiles_iter_next(ctxt->it, &space_changed)) != NULL) {3600 while ((node = datafiles_iter_next(ctxt->it, &space_changed)) != NULL) {
3587 space = node->space;3601 space = node->space;
35883602
@@ -3607,7 +3621,6 @@
3607 OS_THREAD_DUMMY_RETURN;3621 OS_THREAD_DUMMY_RETURN;
3608}3622}
36093623
3610/* CAUTION(?): Don't rename file_per_table during backup */
3611static void3624static void
3612xtrabackup_backup_func(void)3625xtrabackup_backup_func(void)
3613{3626{

Subscribers

People subscribed via source and target branches