Merge lp:~akopytov/percona-xtrabackup/bug1194828 into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: 659
Merged at revision: 668
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1194828
Merge into: lp:percona-xtrabackup/2.1
Prerequisite: lp:~akopytov/percona-xtrabackup/bug1210266-2.1
Diff against target: 243 lines (+117/-22)
4 files modified
patches/innodb56.patch (+103/-3)
src/xtrabackup.cc (+14/-9)
test/t/bug733651.sh (+0/-6)
test/t/bug976945.sh (+0/-4)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1194828
Reviewer Review Type Date Requested Status
George Ormond Lorch III g2 Approve
Review via email: mp+179852@code.launchpad.net
To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'patches/innodb56.patch'
--- patches/innodb56.patch 2013-07-20 14:24:26 +0000
+++ patches/innodb56.patch 2013-08-13 05:45:24 +0000
@@ -1000,7 +1000,37 @@
1000 1000
1001 /* If we are using the doublewrite method, we will1001 /* If we are using the doublewrite method, we will
1002 check if there are half-written pages in data files,1002 check if there are half-written pages in data files,
1003@@ -3456,7 +3485,8 @@1003@@ -3003,6 +3032,7 @@
1004 log_group_t* group;
1005 log_group_t* max_cp_group;
1006 ulint max_cp_field;
1007+ ulint log_hdr_log_block_size;
1008 lsn_t checkpoint_lsn;
1009 ib_uint64_t checkpoint_no;
1010 lsn_t group_scanned_lsn = 0;
1011@@ -3108,6 +3138,21 @@
1012 log_hdr_buf, max_cp_group);
1013 }
1014
1015+ log_hdr_log_block_size
1016+ = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
1017+ if (log_hdr_log_block_size == 0) {
1018+ /* 0 means default value */
1019+ log_hdr_log_block_size = 512;
1020+ }
1021+ if (UNIV_UNLIKELY(log_hdr_log_block_size != srv_log_block_size)) {
1022+ fprintf(stderr,
1023+ "InnoDB: Error: The block size of ib_logfile (" ULINTPF
1024+ ") is not equal to innodb_log_block_size.\n"
1025+ "InnoDB: Error: Suggestion - Recreate log files.\n",
1026+ log_hdr_log_block_size);
1027+ return(DB_ERROR);
1028+ }
1029+
1030 #ifdef UNIV_LOG_ARCHIVE
1031 group = UT_LIST_GET_FIRST(log_sys->log_groups);
1032
1033@@ -3456,7 +3501,8 @@
1004 that the data dictionary tables will be free of any locks.1034 that the data dictionary tables will be free of any locks.
1005 The data dictionary latch should guarantee that there is at1035 The data dictionary latch should guarantee that there is at
1006 most one data dictionary transaction active at a time. */1036 most one data dictionary transaction active at a time. */
@@ -1023,7 +1053,18 @@
1023 * On Windows, mandatory locking is used.1053 * On Windows, mandatory locking is used.
1024--- a/storage/innobase/srv/srv0srv.cc1054--- a/storage/innobase/srv/srv0srv.cc
1025+++ b/storage/innobase/srv/srv0srv.cc1055+++ b/storage/innobase/srv/srv0srv.cc
1026@@ -349,6 +349,10 @@1056@@ -239,6 +239,10 @@
1057
1058 /* Switch to enable random read ahead. */
1059 UNIV_INTERN my_bool srv_random_read_ahead = FALSE;
1060+
1061+/* The log block size */
1062+UNIV_INTERN ulint srv_log_block_size = 0;
1063+
1064 /* User settable value of the number of pages that must be present
1065 in the buffer cache and accessed sequentially for InnoDB to trigger a
1066 readahead request. */
1067@@ -349,6 +353,10 @@
1027 1068
1028 UNIV_INTERN ulong srv_replication_delay = 0;1069 UNIV_INTERN ulong srv_replication_delay = 0;
1029 1070
@@ -1034,7 +1075,7 @@
1034 /*-------------------------------------------*/1075 /*-------------------------------------------*/
1035 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;1076 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
1036 UNIV_INTERN ulong srv_spin_wait_delay = 6;1077 UNIV_INTERN ulong srv_spin_wait_delay = 6;
1037@@ -1814,7 +1818,8 @@1078@@ -1814,7 +1822,8 @@
1038 if (ret == SRV_NONE1079 if (ret == SRV_NONE
1039 && srv_shutdown_state != SRV_SHUTDOWN_NONE1080 && srv_shutdown_state != SRV_SHUTDOWN_NONE
1040 && trx_purge_state() != PURGE_STATE_DISABLED1081 && trx_purge_state() != PURGE_STATE_DISABLED
@@ -1451,3 +1492,62 @@
1451 DBUG_INJECT_CRASH("ib_commit_inplace_crash",1492 DBUG_INJECT_CRASH("ib_commit_inplace_crash",
1452 crash_inject_count++);1493 crash_inject_count++);
1453 }1494 }
1495--- a/storage/innobase/include/log0log.h
1496+++ b/storage/innobase/include/log0log.h
1497@@ -681,6 +681,9 @@
1498 when mysqld is first time started
1499 on the restored database, it can
1500 print helpful info for the user */
1501+#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
1502+ /* extend to record log_block_size
1503+ of XtraDB. 0 means default 512 */
1504 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
1505 /* this 4-byte field is TRUE when
1506 the writing of an archived log file
1507--- a/storage/innobase/include/os0file.h
1508+++ b/storage/innobase/include/os0file.h
1509@@ -99,7 +99,7 @@
1510 if this fails for a log block, then it is equivalent to a media failure in the
1511 log. */
1512
1513-#define OS_FILE_LOG_BLOCK_SIZE 512
1514+#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size
1515
1516 /** Options for os_file_create_func @{ */
1517 enum os_file_create_t {
1518@@ -202,6 +202,10 @@
1519 extern ulint os_n_file_writes;
1520 extern ulint os_n_fsyncs;
1521
1522+#define OS_MIN_LOG_BLOCK_SIZE 512
1523+
1524+extern ulint srv_log_block_size;
1525+
1526 #ifdef UNIV_PFS_IO
1527 /* Keys to register InnoDB I/O with performance schema */
1528 extern mysql_pfs_key_t innodb_file_data_key;
1529--- a/storage/innobase/log/log0log.cc
1530+++ b/storage/innobase/log/log0log.cc
1531@@ -1144,6 +1144,11 @@
1532 /* Wipe over possible label of ibbackup --restore */
1533 memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4);
1534
1535+ if (srv_log_block_size > 512) {
1536+ mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
1537+ srv_log_block_size);
1538+ }
1539+
1540 dest_offset = nth_file * group->file_size;
1541
1542 #ifdef UNIV_DEBUG
1543@@ -1759,9 +1764,7 @@
1544
1545 ut_ad(!srv_read_only_mode);
1546 ut_ad(mutex_own(&(log_sys->mutex)));
1547-#if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE
1548-# error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE"
1549-#endif
1550+ ut_ad(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
1551
1552 buf = group->checkpoint_buf;
1553
14541554
=== modified file 'src/xtrabackup.cc'
--- src/xtrabackup.cc 2013-08-13 05:45:24 +0000
+++ src/xtrabackup.cc 2013-08-13 05:45:24 +0000
@@ -219,7 +219,7 @@
219long innobase_open_files = 300L;219long innobase_open_files = 300L;
220220
221longlong innobase_page_size = (1LL << 14); /* 16KB */221longlong innobase_page_size = (1LL << 14); /* 16KB */
222#ifdef XTRADB_BASED222#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
223static ulong innobase_log_block_size = 512;223static ulong innobase_log_block_size = 512;
224#endif224#endif
225my_bool innobase_fast_checksum = FALSE;225my_bool innobase_fast_checksum = FALSE;
@@ -430,8 +430,10 @@
430#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600430#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
431 OPT_INNODB_PAGE_SIZE,431 OPT_INNODB_PAGE_SIZE,
432#endif432#endif
433#ifdef XTRADB_BASED433#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
434 OPT_INNODB_LOG_BLOCK_SIZE,434 OPT_INNODB_LOG_BLOCK_SIZE,
435#endif
436#ifdef XTRADB_BASED
435 OPT_INNODB_FAST_CHECKSUM,437 OPT_INNODB_FAST_CHECKSUM,
436 OPT_INNODB_EXTRA_UNDOSLOTS,438 OPT_INNODB_EXTRA_UNDOSLOTS,
437 OPT_INNODB_DOUBLEWRITE_FILE,439 OPT_INNODB_DOUBLEWRITE_FILE,
@@ -785,12 +787,14 @@
785 GET_LL, REQUIRED_ARG,787 GET_LL, REQUIRED_ARG,
786 (1LL << 14), (1LL << 12), (1LL << UNIV_PAGE_SIZE_SHIFT_MAX), 0, 1L, 0},788 (1LL << 14), (1LL << 12), (1LL << UNIV_PAGE_SIZE_SHIFT_MAX), 0, 1L, 0},
787#endif789#endif
788#ifdef XTRADB_BASED790#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
789 {"innodb_log_block_size", OPT_INNODB_LOG_BLOCK_SIZE,791 {"innodb_log_block_size", OPT_INNODB_LOG_BLOCK_SIZE,
790 "The log block size of the transaction log file. "792 "The log block size of the transaction log file. "
791 "Changing for created log file is not supported. Use on your own risk!",793 "Changing for created log file is not supported. Use on your own risk!",
792 (G_PTR*) &innobase_log_block_size, (G_PTR*) &innobase_log_block_size, 0,794 (G_PTR*) &innobase_log_block_size, (G_PTR*) &innobase_log_block_size, 0,
793 GET_ULONG, REQUIRED_ARG, 512, 512, 1 << UNIV_PAGE_SIZE_SHIFT_MAX, 0, 1L, 0},795 GET_ULONG, REQUIRED_ARG, 512, 512, 1 << UNIV_PAGE_SIZE_SHIFT_MAX, 0, 1L, 0},
796#endif
797#ifdef XTRADB_BASED
794 {"innodb_fast_checksum", OPT_INNODB_FAST_CHECKSUM,798 {"innodb_fast_checksum", OPT_INNODB_FAST_CHECKSUM,
795 "Change the algorithm of checksum for the whole of datapage to 4-bytes word based.",799 "Change the algorithm of checksum for the whole of datapage to 4-bytes word based.",
796 (G_PTR*) &innobase_fast_checksum,800 (G_PTR*) &innobase_fast_checksum,
@@ -1024,7 +1028,7 @@
1024ibool1028ibool
1025xb_init_log_block_size(void)1029xb_init_log_block_size(void)
1026{1030{
1027#ifdef XTRADB_BASED1031#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
1028 srv_log_block_size = 0;1032 srv_log_block_size = 0;
1029 if (innobase_log_block_size != 512) {1033 if (innobase_log_block_size != 512) {
1030 uint n_shift = get_bit_shift(innobase_log_block_size);;1034 uint n_shift = get_bit_shift(innobase_log_block_size);;
@@ -1084,12 +1088,13 @@
1084 srv_page_size_shift = 14;1088 srv_page_size_shift = 14;
1085 srv_page_size = (1 << srv_page_size_shift);1089 srv_page_size = (1 << srv_page_size_shift);
1086 }1090 }
1091
1092 if (!xb_init_log_block_size()) {
1093 goto error;
1094 }
1087#endif1095#endif
1096
1088#ifdef XTRADB_BASED1097#ifdef XTRADB_BASED
1089 if (!xb_init_log_block_size()) {
1090 goto error;
1091 }
1092
1093 srv_fast_checksum = (ibool) innobase_fast_checksum;1098 srv_fast_checksum = (ibool) innobase_fast_checksum;
1094#endif1099#endif
10951100
@@ -5761,7 +5766,7 @@
5761#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 506005766#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
5762 printf("innodb_page_size = %lld\n", innobase_page_size);5767 printf("innodb_page_size = %lld\n", innobase_page_size);
5763#endif5768#endif
5764#ifdef XTRADB_BASED5769#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
5765 printf("innodb_fast_checksum = %d\n", innobase_fast_checksum);5770 printf("innodb_fast_checksum = %d\n", innobase_fast_checksum);
5766 printf("innodb_log_block_size = %lu\n", innobase_log_block_size);5771 printf("innodb_log_block_size = %lu\n", innobase_log_block_size);
5767 if (innobase_doublewrite_file != NULL) {5772 if (innobase_doublewrite_file != NULL) {
57685773
=== modified file 'test/t/bug733651.sh'
--- test/t/bug733651.sh 2013-07-25 15:04:49 +0000
+++ test/t/bug733651.sh 2013-08-13 05:45:24 +0000
@@ -5,12 +5,6 @@
55
6. inc/common.sh6. inc/common.sh
77
8# Require XtraDB <= 5.5 until bug #1194828 is fixed
9if is_xtradb && is_server_version_higher_than 5.6.0
10then
11 skip_test "Doesn't work with XtraDB 5.6, bug #1194828"
12fi
13
14options="innodb_log_files_in_group innodb_log_file_size"8options="innodb_log_files_in_group innodb_log_file_size"
159
16# innodb_page_size is supported in XtraDB 5.1+ and InnoDB 5.6+10# innodb_page_size is supported in XtraDB 5.1+ and InnoDB 5.6+
1711
=== modified file 'test/t/bug976945.sh'
--- test/t/bug976945.sh 2013-07-25 15:04:49 +0000
+++ test/t/bug976945.sh 2013-08-13 05:45:24 +0000
@@ -5,10 +5,6 @@
55
6require_xtradb6require_xtradb
77
8# Require XtraDB <= 5.5 until bug #1194828 is fixed
9is_server_version_lower_than 5.6.0 || \
10 skip_test "Doesn't work with XtraDB 5.6, bug #1194828"
11
12MYSQLD_EXTRA_MY_CNF_OPTS="8MYSQLD_EXTRA_MY_CNF_OPTS="
13innodb_log_block_size=40969innodb_log_block_size=4096
14"10"

Subscribers

People subscribed via source and target branches

to all changes: