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

Proposed by Alexey Kopytov on 2013-08-13
Status: Merged
Approved by: Alexey Kopytov on 2013-08-20
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 2013-08-13 Approve on 2013-08-20
Review via email: mp+179852@code.launchpad.net
To post a comment you must log in.
review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'patches/innodb56.patch'
2--- patches/innodb56.patch 2013-07-20 14:24:26 +0000
3+++ patches/innodb56.patch 2013-08-13 05:45:24 +0000
4@@ -1000,7 +1000,37 @@
5
6 /* If we are using the doublewrite method, we will
7 check if there are half-written pages in data files,
8-@@ -3456,7 +3485,8 @@
9+@@ -3003,6 +3032,7 @@
10+ log_group_t* group;
11+ log_group_t* max_cp_group;
12+ ulint max_cp_field;
13++ ulint log_hdr_log_block_size;
14+ lsn_t checkpoint_lsn;
15+ ib_uint64_t checkpoint_no;
16+ lsn_t group_scanned_lsn = 0;
17+@@ -3108,6 +3138,21 @@
18+ log_hdr_buf, max_cp_group);
19+ }
20+
21++ log_hdr_log_block_size
22++ = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
23++ if (log_hdr_log_block_size == 0) {
24++ /* 0 means default value */
25++ log_hdr_log_block_size = 512;
26++ }
27++ if (UNIV_UNLIKELY(log_hdr_log_block_size != srv_log_block_size)) {
28++ fprintf(stderr,
29++ "InnoDB: Error: The block size of ib_logfile (" ULINTPF
30++ ") is not equal to innodb_log_block_size.\n"
31++ "InnoDB: Error: Suggestion - Recreate log files.\n",
32++ log_hdr_log_block_size);
33++ return(DB_ERROR);
34++ }
35++
36+ #ifdef UNIV_LOG_ARCHIVE
37+ group = UT_LIST_GET_FIRST(log_sys->log_groups);
38+
39+@@ -3456,7 +3501,8 @@
40 that the data dictionary tables will be free of any locks.
41 The data dictionary latch should guarantee that there is at
42 most one data dictionary transaction active at a time. */
43@@ -1023,7 +1053,18 @@
44 * On Windows, mandatory locking is used.
45 --- a/storage/innobase/srv/srv0srv.cc
46 +++ b/storage/innobase/srv/srv0srv.cc
47-@@ -349,6 +349,10 @@
48+@@ -239,6 +239,10 @@
49+
50+ /* Switch to enable random read ahead. */
51+ UNIV_INTERN my_bool srv_random_read_ahead = FALSE;
52++
53++/* The log block size */
54++UNIV_INTERN ulint srv_log_block_size = 0;
55++
56+ /* User settable value of the number of pages that must be present
57+ in the buffer cache and accessed sequentially for InnoDB to trigger a
58+ readahead request. */
59+@@ -349,6 +353,10 @@
60
61 UNIV_INTERN ulong srv_replication_delay = 0;
62
63@@ -1034,7 +1075,7 @@
64 /*-------------------------------------------*/
65 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
66 UNIV_INTERN ulong srv_spin_wait_delay = 6;
67-@@ -1814,7 +1818,8 @@
68+@@ -1814,7 +1822,8 @@
69 if (ret == SRV_NONE
70 && srv_shutdown_state != SRV_SHUTDOWN_NONE
71 && trx_purge_state() != PURGE_STATE_DISABLED
72@@ -1451,3 +1492,62 @@
73 DBUG_INJECT_CRASH("ib_commit_inplace_crash",
74 crash_inject_count++);
75 }
76+--- a/storage/innobase/include/log0log.h
77++++ b/storage/innobase/include/log0log.h
78+@@ -681,6 +681,9 @@
79+ when mysqld is first time started
80+ on the restored database, it can
81+ print helpful info for the user */
82++#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
83++ /* extend to record log_block_size
84++ of XtraDB. 0 means default 512 */
85+ #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
86+ /* this 4-byte field is TRUE when
87+ the writing of an archived log file
88+--- a/storage/innobase/include/os0file.h
89++++ b/storage/innobase/include/os0file.h
90+@@ -99,7 +99,7 @@
91+ if this fails for a log block, then it is equivalent to a media failure in the
92+ log. */
93+
94+-#define OS_FILE_LOG_BLOCK_SIZE 512
95++#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size
96+
97+ /** Options for os_file_create_func @{ */
98+ enum os_file_create_t {
99+@@ -202,6 +202,10 @@
100+ extern ulint os_n_file_writes;
101+ extern ulint os_n_fsyncs;
102+
103++#define OS_MIN_LOG_BLOCK_SIZE 512
104++
105++extern ulint srv_log_block_size;
106++
107+ #ifdef UNIV_PFS_IO
108+ /* Keys to register InnoDB I/O with performance schema */
109+ extern mysql_pfs_key_t innodb_file_data_key;
110+--- a/storage/innobase/log/log0log.cc
111++++ b/storage/innobase/log/log0log.cc
112+@@ -1144,6 +1144,11 @@
113+ /* Wipe over possible label of ibbackup --restore */
114+ memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4);
115+
116++ if (srv_log_block_size > 512) {
117++ mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
118++ srv_log_block_size);
119++ }
120++
121+ dest_offset = nth_file * group->file_size;
122+
123+ #ifdef UNIV_DEBUG
124+@@ -1759,9 +1764,7 @@
125+
126+ ut_ad(!srv_read_only_mode);
127+ ut_ad(mutex_own(&(log_sys->mutex)));
128+-#if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE
129+-# error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE"
130+-#endif
131++ ut_ad(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
132+
133+ buf = group->checkpoint_buf;
134+
135
136=== modified file 'src/xtrabackup.cc'
137--- src/xtrabackup.cc 2013-08-13 05:45:24 +0000
138+++ src/xtrabackup.cc 2013-08-13 05:45:24 +0000
139@@ -219,7 +219,7 @@
140 long innobase_open_files = 300L;
141
142 longlong innobase_page_size = (1LL << 14); /* 16KB */
143-#ifdef XTRADB_BASED
144+#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
145 static ulong innobase_log_block_size = 512;
146 #endif
147 my_bool innobase_fast_checksum = FALSE;
148@@ -430,8 +430,10 @@
149 #if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
150 OPT_INNODB_PAGE_SIZE,
151 #endif
152-#ifdef XTRADB_BASED
153+#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
154 OPT_INNODB_LOG_BLOCK_SIZE,
155+#endif
156+#ifdef XTRADB_BASED
157 OPT_INNODB_FAST_CHECKSUM,
158 OPT_INNODB_EXTRA_UNDOSLOTS,
159 OPT_INNODB_DOUBLEWRITE_FILE,
160@@ -785,12 +787,14 @@
161 GET_LL, REQUIRED_ARG,
162 (1LL << 14), (1LL << 12), (1LL << UNIV_PAGE_SIZE_SHIFT_MAX), 0, 1L, 0},
163 #endif
164-#ifdef XTRADB_BASED
165+#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
166 {"innodb_log_block_size", OPT_INNODB_LOG_BLOCK_SIZE,
167 "The log block size of the transaction log file. "
168 "Changing for created log file is not supported. Use on your own risk!",
169 (G_PTR*) &innobase_log_block_size, (G_PTR*) &innobase_log_block_size, 0,
170 GET_ULONG, REQUIRED_ARG, 512, 512, 1 << UNIV_PAGE_SIZE_SHIFT_MAX, 0, 1L, 0},
171+#endif
172+#ifdef XTRADB_BASED
173 {"innodb_fast_checksum", OPT_INNODB_FAST_CHECKSUM,
174 "Change the algorithm of checksum for the whole of datapage to 4-bytes word based.",
175 (G_PTR*) &innobase_fast_checksum,
176@@ -1024,7 +1028,7 @@
177 ibool
178 xb_init_log_block_size(void)
179 {
180-#ifdef XTRADB_BASED
181+#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
182 srv_log_block_size = 0;
183 if (innobase_log_block_size != 512) {
184 uint n_shift = get_bit_shift(innobase_log_block_size);;
185@@ -1084,12 +1088,13 @@
186 srv_page_size_shift = 14;
187 srv_page_size = (1 << srv_page_size_shift);
188 }
189+
190+ if (!xb_init_log_block_size()) {
191+ goto error;
192+ }
193 #endif
194+
195 #ifdef XTRADB_BASED
196- if (!xb_init_log_block_size()) {
197- goto error;
198- }
199-
200 srv_fast_checksum = (ibool) innobase_fast_checksum;
201 #endif
202
203@@ -5761,7 +5766,7 @@
204 #if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
205 printf("innodb_page_size = %lld\n", innobase_page_size);
206 #endif
207-#ifdef XTRADB_BASED
208+#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
209 printf("innodb_fast_checksum = %d\n", innobase_fast_checksum);
210 printf("innodb_log_block_size = %lu\n", innobase_log_block_size);
211 if (innobase_doublewrite_file != NULL) {
212
213=== modified file 'test/t/bug733651.sh'
214--- test/t/bug733651.sh 2013-07-25 15:04:49 +0000
215+++ test/t/bug733651.sh 2013-08-13 05:45:24 +0000
216@@ -5,12 +5,6 @@
217
218 . inc/common.sh
219
220-# Require XtraDB <= 5.5 until bug #1194828 is fixed
221-if is_xtradb && is_server_version_higher_than 5.6.0
222-then
223- skip_test "Doesn't work with XtraDB 5.6, bug #1194828"
224-fi
225-
226 options="innodb_log_files_in_group innodb_log_file_size"
227
228 # innodb_page_size is supported in XtraDB 5.1+ and InnoDB 5.6+
229
230=== modified file 'test/t/bug976945.sh'
231--- test/t/bug976945.sh 2013-07-25 15:04:49 +0000
232+++ test/t/bug976945.sh 2013-08-13 05:45:24 +0000
233@@ -5,10 +5,6 @@
234
235 require_xtradb
236
237-# Require XtraDB <= 5.5 until bug #1194828 is fixed
238-is_server_version_lower_than 5.6.0 || \
239- skip_test "Doesn't work with XtraDB 5.6, bug #1194828"
240-
241 MYSQLD_EXTRA_MY_CNF_OPTS="
242 innodb_log_block_size=4096
243 "

Subscribers

People subscribed via source and target branches

to all changes: