Merge lp:~sergei.glushchenko/percona-xtrabackup/2.1-ST43302-xb-bug1340717 into lp:percona-xtrabackup/2.1
- 2.1-ST43302-xb-bug1340717
- Merge into 2.1
Status: | Merged |
---|---|
Approved by: | Alexey Kopytov |
Approved revision: | no longer in the source branch. |
Merged at revision: | 760 |
Proposed branch: | lp:~sergei.glushchenko/percona-xtrabackup/2.1-ST43302-xb-bug1340717 |
Merge into: | lp:percona-xtrabackup/2.1 |
Diff against target: |
425 lines (+81/-43) 2 files modified
patches/innodb56.patch (+46/-43) test/t/bug1340717.sh (+35/-0) |
To merge this branch: | bzr merge lp:~sergei.glushchenko/percona-xtrabackup/2.1-ST43302-xb-bug1340717 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Approve | ||
Review via email: mp+227022@code.launchpad.net |
Commit message
Description of the change
Bug 1340717: Crash on prepare partial backup with 5.6-based
xtrabackup
The root cause of the crash is that purge_sys is not initialized
at the moment when xtrabackup trying to delete missing tablespace.
Fix for upstream Bug#16593427 "ROLLBACK OF RECOVERED TRANSACTION
CORRUPTS NON-ONLINE ADD INDEX" introduced function
trx_
initialized. It loads some tablepsaces in data dictionary. Crash
happens when tablespace is missing from partial backup.
Fix is not to remove missing tablespaces from data dictionary
until purge_sys is initialized. They will be eventually removed
during subsequent operation.
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Alexey Kopytov (akopytov) wrote : | # |
Sergei,
Some questions:
1. " Fix is not to remove missing tablespaces from data dictionary
until purge_sys is initialized. They will be eventually removed
during subsequent operation."
What are those "subsequent operations"? If it is supposed to be removed when a redo log record is applied, what happens when there are no corresponding redo log records to replay?
2. What about a test case? Why isn't this case covered by current tests? I thought we have some partial prepared cases in the suite.
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Hello Alexey,
Let me explain the bug more verbosely. New code has been added to
MySQL 5.6 to resurrect table locks. This code opens some tables. It
being done before purge_sys initialized and here is where the problem
is.
trx_resurrect_
tables in it. It is done while purge_sys is still down. In order to
catch this crash we need to take a backup at the moment when there are
active transactions. Since our test suite communicate with MySQL via
mysql cli tool we cannot produce uncommitted transactions. Only option
for us is to run mysql in parallel and implement some hacks for
synchronization.
Subsequent operations are dict_check_
invoked from innobase_
Hope this makes more sense.
Alexey Kopytov (akopytov) wrote : | # |
It does make sense, thanks.
I still think a test case is possible. Have a look at start_uncommitt
Alexey Kopytov (akopytov) wrote : | # |
ping?
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
I'll try to reproduce this crash. Will likely have results by Monday.
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
I constructed the test case based on start_uncommitt
Alexey Kopytov (akopytov) wrote : | # |
Are you saying that undo_tablespaces.sh is broken because it doesn't wait for the transaction to start, and that's why the test suite didn't trigger this bug before? If so, can you also fix the broken test?
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
This bug needs partial backup to crash. Recovery crashes when tablespace is not found and there is uncommitted transaction for this tablespace. Both conditions are essential. undo_tablespaces.sh does not do partial backup. Maybe it also doesn't wait for server to write something into undo tablespace. It takes backup immediately in parallel with delete statement. It is possible that delete work some time using only redo log and without flushing, thus not writing to undo tablespace.
Alexey Kopytov (akopytov) : | # |
Preview Diff
1 | === modified file 'patches/innodb56.patch' | |||
2 | --- patches/innodb56.patch 2014-05-01 06:29:32 +0000 | |||
3 | +++ patches/innodb56.patch 2014-08-17 09:44:59 +0000 | |||
4 | @@ -112,16 +112,17 @@ | |||
5 | 112 | bpage->offset, buf_page_get_zip_size(bpage), | 112 | bpage->offset, buf_page_get_zip_size(bpage), |
6 | 113 | --- a/storage/innobase/fil/fil0fil.cc | 113 | --- a/storage/innobase/fil/fil0fil.cc |
7 | 114 | +++ b/storage/innobase/fil/fil0fil.cc | 114 | +++ b/storage/innobase/fil/fil0fil.cc |
9 | 115 | @@ -43,6 +43,8 @@ | 115 | @@ -43,6 +43,9 @@ |
10 | 116 | #include "dict0dict.h" | 116 | #include "dict0dict.h" |
11 | 117 | #include "page0page.h" | 117 | #include "page0page.h" |
12 | 118 | #include "page0zip.h" | 118 | #include "page0zip.h" |
13 | 119 | +#include "pars0pars.h" | 119 | +#include "pars0pars.h" |
14 | 120 | +#include "que0que.h" | 120 | +#include "que0que.h" |
15 | 121 | +#include "trx0purge.h" | ||
16 | 121 | #include "trx0sys.h" | 122 | #include "trx0sys.h" |
17 | 122 | #include "row0mysql.h" | 123 | #include "row0mysql.h" |
18 | 123 | #ifndef UNIV_HOTBACKUP | 124 | #ifndef UNIV_HOTBACKUP |
20 | 124 | @@ -313,17 +315,15 @@ | 125 | @@ -313,17 +316,15 @@ |
21 | 125 | 126 | ||
22 | 126 | /** The tablespace memory cache. This variable is NULL before the module is | 127 | /** The tablespace memory cache. This variable is NULL before the module is |
23 | 127 | initialized. */ | 128 | initialized. */ |
24 | @@ -145,7 +146,7 @@ | |||
25 | 145 | #else /* __WIN__ */ | 146 | #else /* __WIN__ */ |
26 | 146 | # define fil_buffering_disabled(s) (0) | 147 | # define fil_buffering_disabled(s) (0) |
27 | 147 | #endif /* __WIN__ */ | 148 | #endif /* __WIN__ */ |
29 | 148 | @@ -791,6 +791,7 @@ | 149 | @@ -791,6 +792,7 @@ |
30 | 149 | "InnoDB: Error: tablespace id is %lu" | 150 | "InnoDB: Error: tablespace id is %lu" |
31 | 150 | " in the data dictionary\n" | 151 | " in the data dictionary\n" |
32 | 151 | "InnoDB: but in file %s it is %lu!\n", | 152 | "InnoDB: but in file %s it is %lu!\n", |
33 | @@ -153,7 +154,7 @@ | |||
34 | 153 | space->id, node->name, space_id); | 154 | space->id, node->name, space_id); |
35 | 154 | 155 | ||
36 | 155 | ut_error; | 156 | ut_error; |
38 | 156 | @@ -830,8 +831,9 @@ | 157 | @@ -830,8 +832,9 @@ |
39 | 157 | } | 158 | } |
40 | 158 | 159 | ||
41 | 159 | if (size_bytes >= 1024 * 1024) { | 160 | if (size_bytes >= 1024 * 1024) { |
42 | @@ -165,7 +166,7 @@ | |||
43 | 165 | } | 166 | } |
44 | 166 | 167 | ||
45 | 167 | if (!fsp_flags_is_compressed(flags)) { | 168 | if (!fsp_flags_is_compressed(flags)) { |
47 | 168 | @@ -1302,12 +1304,6 @@ | 169 | @@ -1302,12 +1305,6 @@ |
48 | 169 | 170 | ||
49 | 170 | if (!fil_system->space_id_reuse_warned) { | 171 | if (!fil_system->space_id_reuse_warned) { |
50 | 171 | fil_system->space_id_reuse_warned = TRUE; | 172 | fil_system->space_id_reuse_warned = TRUE; |
51 | @@ -178,7 +179,7 @@ | |||
52 | 178 | } | 179 | } |
53 | 179 | 180 | ||
54 | 180 | fil_system->max_assigned_id = id; | 181 | fil_system->max_assigned_id = id; |
56 | 181 | @@ -2031,12 +2027,6 @@ | 182 | @@ -2031,12 +2028,6 @@ |
57 | 182 | contain sensible data */ | 183 | contain sensible data */ |
58 | 183 | ulint* flags, /*!< out: tablespace flags */ | 184 | ulint* flags, /*!< out: tablespace flags */ |
59 | 184 | ulint* space_id, /*!< out: tablespace ID */ | 185 | ulint* space_id, /*!< out: tablespace ID */ |
60 | @@ -191,7 +192,7 @@ | |||
61 | 191 | lsn_t* min_flushed_lsn, /*!< out: min of flushed | 192 | lsn_t* min_flushed_lsn, /*!< out: min of flushed |
62 | 192 | lsn values in data files */ | 193 | lsn values in data files */ |
63 | 193 | lsn_t* max_flushed_lsn) /*!< out: max of flushed | 194 | lsn_t* max_flushed_lsn) /*!< out: max of flushed |
65 | 194 | @@ -2061,7 +2051,7 @@ | 195 | @@ -2061,7 +2052,7 @@ |
66 | 195 | 196 | ||
67 | 196 | flushed_lsn = mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN); | 197 | flushed_lsn = mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN); |
68 | 197 | 198 | ||
69 | @@ -200,7 +201,7 @@ | |||
70 | 200 | check_msg = fil_check_first_page(page); | 201 | check_msg = fil_check_first_page(page); |
71 | 201 | } | 202 | } |
72 | 202 | 203 | ||
74 | 203 | @@ -2074,10 +2064,6 @@ | 204 | @@ -2074,10 +2065,6 @@ |
75 | 204 | if (!one_read_already) { | 205 | if (!one_read_already) { |
76 | 205 | *min_flushed_lsn = flushed_lsn; | 206 | *min_flushed_lsn = flushed_lsn; |
77 | 206 | *max_flushed_lsn = flushed_lsn; | 207 | *max_flushed_lsn = flushed_lsn; |
78 | @@ -211,7 +212,7 @@ | |||
79 | 211 | return(NULL); | 212 | return(NULL); |
80 | 212 | } | 213 | } |
81 | 213 | 214 | ||
83 | 214 | @@ -2087,14 +2073,6 @@ | 215 | @@ -2087,14 +2074,6 @@ |
84 | 215 | if (*max_flushed_lsn < flushed_lsn) { | 216 | if (*max_flushed_lsn < flushed_lsn) { |
85 | 216 | *max_flushed_lsn = flushed_lsn; | 217 | *max_flushed_lsn = flushed_lsn; |
86 | 217 | } | 218 | } |
87 | @@ -226,7 +227,7 @@ | |||
88 | 226 | 227 | ||
89 | 227 | return(NULL); | 228 | return(NULL); |
90 | 228 | } | 229 | } |
92 | 229 | @@ -2195,7 +2173,7 @@ | 230 | @@ -2195,7 +2174,7 @@ |
93 | 230 | mem_free(path); | 231 | mem_free(path); |
94 | 231 | } | 232 | } |
95 | 232 | 233 | ||
96 | @@ -235,7 +236,7 @@ | |||
97 | 235 | /********************************************************//** | 236 | /********************************************************//** |
98 | 236 | Writes a log record about an .ibd file create/rename/delete. */ | 237 | Writes a log record about an .ibd file create/rename/delete. */ |
99 | 237 | static | 238 | static |
101 | 238 | @@ -2423,7 +2401,7 @@ | 239 | @@ -2423,7 +2402,7 @@ |
102 | 239 | space_id, name, path, flags, | 240 | space_id, name, path, flags, |
103 | 240 | DICT_TF2_USE_TABLESPACE, | 241 | DICT_TF2_USE_TABLESPACE, |
104 | 241 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { | 242 | FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { |
105 | @@ -244,7 +245,7 @@ | |||
106 | 244 | } | 245 | } |
107 | 245 | } | 246 | } |
108 | 246 | 247 | ||
110 | 247 | @@ -2782,7 +2760,7 @@ | 248 | @@ -2782,7 +2761,7 @@ |
111 | 248 | } | 249 | } |
112 | 249 | 250 | ||
113 | 250 | if (err == DB_SUCCESS) { | 251 | if (err == DB_SUCCESS) { |
114 | @@ -253,7 +254,7 @@ | |||
115 | 253 | /* Write a log record about the deletion of the .ibd | 254 | /* Write a log record about the deletion of the .ibd |
116 | 254 | file, so that ibbackup can replay it in the | 255 | file, so that ibbackup can replay it in the |
117 | 255 | --apply-log phase. We use a dummy mtr and the familiar | 256 | --apply-log phase. We use a dummy mtr and the familiar |
119 | 256 | @@ -3137,7 +3115,7 @@ | 257 | @@ -3137,7 +3116,7 @@ |
120 | 257 | 258 | ||
121 | 258 | mutex_exit(&fil_system->mutex); | 259 | mutex_exit(&fil_system->mutex); |
122 | 259 | 260 | ||
123 | @@ -262,7 +263,7 @@ | |||
124 | 262 | if (success && !recv_recovery_on) { | 263 | if (success && !recv_recovery_on) { |
125 | 263 | mtr_t mtr; | 264 | mtr_t mtr; |
126 | 264 | 265 | ||
128 | 265 | @@ -3368,7 +3346,21 @@ | 266 | @@ -3368,7 +3347,21 @@ |
129 | 266 | ibool success; | 267 | ibool success; |
130 | 267 | /* TRUE if a table is created with CREATE TEMPORARY TABLE */ | 268 | /* TRUE if a table is created with CREATE TEMPORARY TABLE */ |
131 | 268 | bool is_temp = !!(flags2 & DICT_TF2_TEMPORARY); | 269 | bool is_temp = !!(flags2 & DICT_TF2_TEMPORARY); |
132 | @@ -284,7 +285,7 @@ | |||
133 | 284 | 285 | ||
134 | 285 | ut_a(space_id > 0); | 286 | ut_a(space_id > 0); |
135 | 286 | ut_ad(!srv_read_only_mode); | 287 | ut_ad(!srv_read_only_mode); |
137 | 287 | @@ -3521,7 +3513,7 @@ | 288 | @@ -3521,7 +3514,7 @@ |
138 | 288 | goto error_exit_1; | 289 | goto error_exit_1; |
139 | 289 | } | 290 | } |
140 | 290 | 291 | ||
141 | @@ -293,7 +294,7 @@ | |||
142 | 293 | { | 294 | { |
143 | 294 | mtr_t mtr; | 295 | mtr_t mtr; |
144 | 295 | ulint mlog_file_flag = 0; | 296 | ulint mlog_file_flag = 0; |
146 | 296 | @@ -3599,6 +3591,97 @@ | 297 | @@ -3599,6 +3592,97 @@ |
147 | 297 | (ulong) expected_id, (ulong) expected_flags); | 298 | (ulong) expected_id, (ulong) expected_flags); |
148 | 298 | } | 299 | } |
149 | 299 | 300 | ||
150 | @@ -391,7 +392,7 @@ | |||
151 | 391 | /********************************************************************//** | 392 | /********************************************************************//** |
152 | 392 | Tries to open a single-table tablespace and optionally checks that the | 393 | Tries to open a single-table tablespace and optionally checks that the |
153 | 393 | space id in it is correct. If this does not succeed, print an error message | 394 | space id in it is correct. If this does not succeed, print an error message |
155 | 394 | @@ -3664,6 +3747,9 @@ | 395 | @@ -3664,6 +3748,9 @@ |
156 | 395 | in the default location. If it is remote, it should not be here. */ | 396 | in the default location. If it is remote, it should not be here. */ |
157 | 396 | def.filepath = fil_make_ibd_name(tablename, false); | 397 | def.filepath = fil_make_ibd_name(tablename, false); |
158 | 397 | 398 | ||
159 | @@ -401,7 +402,7 @@ | |||
160 | 401 | /* The path_in was read from SYS_DATAFILES. */ | 402 | /* The path_in was read from SYS_DATAFILES. */ |
161 | 402 | if (path_in) { | 403 | if (path_in) { |
162 | 403 | if (strcmp(def.filepath, path_in)) { | 404 | if (strcmp(def.filepath, path_in)) { |
164 | 404 | @@ -3711,6 +3797,7 @@ | 405 | @@ -3711,6 +3798,7 @@ |
165 | 405 | tablespaces_found++; | 406 | tablespaces_found++; |
166 | 406 | } | 407 | } |
167 | 407 | } | 408 | } |
168 | @@ -409,7 +410,7 @@ | |||
169 | 409 | 410 | ||
170 | 410 | /* Always look for a file at the default location. */ | 411 | /* Always look for a file at the default location. */ |
171 | 411 | ut_a(def.filepath); | 412 | ut_a(def.filepath); |
173 | 412 | @@ -3732,9 +3819,6 @@ | 413 | @@ -3732,9 +3820,6 @@ |
174 | 413 | if (def.success) { | 414 | if (def.success) { |
175 | 414 | def.check_msg = fil_read_first_page( | 415 | def.check_msg = fil_read_first_page( |
176 | 415 | def.file, FALSE, &def.flags, &def.id, | 416 | def.file, FALSE, &def.flags, &def.id, |
177 | @@ -419,7 +420,7 @@ | |||
178 | 419 | &def.lsn, &def.lsn); | 420 | &def.lsn, &def.lsn); |
179 | 420 | def.valid = !def.check_msg; | 421 | def.valid = !def.check_msg; |
180 | 421 | 422 | ||
182 | 422 | @@ -3757,9 +3841,6 @@ | 423 | @@ -3757,9 +3842,6 @@ |
183 | 423 | if (remote.success) { | 424 | if (remote.success) { |
184 | 424 | remote.check_msg = fil_read_first_page( | 425 | remote.check_msg = fil_read_first_page( |
185 | 425 | remote.file, FALSE, &remote.flags, &remote.id, | 426 | remote.file, FALSE, &remote.flags, &remote.id, |
186 | @@ -429,7 +430,7 @@ | |||
187 | 429 | &remote.lsn, &remote.lsn); | 430 | &remote.lsn, &remote.lsn); |
188 | 430 | remote.valid = !remote.check_msg; | 431 | remote.valid = !remote.check_msg; |
189 | 431 | 432 | ||
191 | 432 | @@ -3783,9 +3864,6 @@ | 433 | @@ -3783,9 +3865,6 @@ |
192 | 433 | if (dict.success) { | 434 | if (dict.success) { |
193 | 434 | dict.check_msg = fil_read_first_page( | 435 | dict.check_msg = fil_read_first_page( |
194 | 435 | dict.file, FALSE, &dict.flags, &dict.id, | 436 | dict.file, FALSE, &dict.flags, &dict.id, |
195 | @@ -439,7 +440,7 @@ | |||
196 | 439 | &dict.lsn, &dict.lsn); | 440 | &dict.lsn, &dict.lsn); |
197 | 440 | dict.valid = !dict.check_msg; | 441 | dict.valid = !dict.check_msg; |
198 | 441 | 442 | ||
200 | 442 | @@ -3810,11 +3888,15 @@ | 443 | @@ -3810,11 +3889,17 @@ |
201 | 443 | /* The following call prints an error message */ | 444 | /* The following call prints an error message */ |
202 | 444 | os_file_get_last_error(true); | 445 | os_file_get_last_error(true); |
203 | 445 | 446 | ||
204 | @@ -452,11 +453,13 @@ | |||
205 | 452 | + ib_logf(IB_LOG_LEVEL_WARN, | 453 | + ib_logf(IB_LOG_LEVEL_WARN, |
206 | 453 | + "It will be removed from the data dictionary."); | 454 | + "It will be removed from the data dictionary."); |
207 | 454 | + | 455 | + |
209 | 455 | + fil_remove_invalid_table_from_data_dict(tablename); | 456 | + if (purge_sys) { |
210 | 457 | + fil_remove_invalid_table_from_data_dict(tablename); | ||
211 | 458 | + } | ||
212 | 456 | 459 | ||
213 | 457 | err = DB_CORRUPTION; | 460 | err = DB_CORRUPTION; |
214 | 458 | 461 | ||
216 | 459 | @@ -4187,9 +4269,6 @@ | 462 | @@ -4187,9 +4272,6 @@ |
217 | 460 | fsp->success = TRUE; | 463 | fsp->success = TRUE; |
218 | 461 | if (const char* check_msg = fil_read_first_page( | 464 | if (const char* check_msg = fil_read_first_page( |
219 | 462 | fsp->file, FALSE, &fsp->flags, &fsp->id, | 465 | fsp->file, FALSE, &fsp->flags, &fsp->id, |
220 | @@ -466,7 +469,7 @@ | |||
221 | 466 | &fsp->lsn, &fsp->lsn)) { | 469 | &fsp->lsn, &fsp->lsn)) { |
222 | 467 | ib_logf(IB_LOG_LEVEL_ERROR, | 470 | ib_logf(IB_LOG_LEVEL_ERROR, |
223 | 468 | "%s in tablespace %s (table %s)", | 471 | "%s in tablespace %s (table %s)", |
225 | 469 | @@ -4266,6 +4345,9 @@ | 472 | @@ -4266,6 +4348,9 @@ |
226 | 470 | #ifdef UNIV_HOTBACKUP | 473 | #ifdef UNIV_HOTBACKUP |
227 | 471 | fil_space_t* space; | 474 | fil_space_t* space; |
228 | 472 | #endif | 475 | #endif |
229 | @@ -476,7 +479,7 @@ | |||
230 | 476 | 479 | ||
231 | 477 | memset(&def, 0, sizeof(def)); | 480 | memset(&def, 0, sizeof(def)); |
232 | 478 | memset(&remote, 0, sizeof(remote)); | 481 | memset(&remote, 0, sizeof(remote)); |
234 | 479 | @@ -4310,6 +4392,9 @@ | 482 | @@ -4310,6 +4395,9 @@ |
235 | 480 | # endif /* !UNIV_HOTBACKUP */ | 483 | # endif /* !UNIV_HOTBACKUP */ |
236 | 481 | #endif | 484 | #endif |
237 | 482 | 485 | ||
238 | @@ -486,7 +489,7 @@ | |||
239 | 486 | /* Check for a link file which locates a remote tablespace. */ | 489 | /* Check for a link file which locates a remote tablespace. */ |
240 | 487 | remote.success = fil_open_linked_file( | 490 | remote.success = fil_open_linked_file( |
241 | 488 | tablename, &remote.filepath, &remote.file); | 491 | tablename, &remote.filepath, &remote.file); |
243 | 489 | @@ -4320,8 +4405,20 @@ | 492 | @@ -4320,8 +4408,20 @@ |
244 | 490 | if (!remote.success) { | 493 | if (!remote.success) { |
245 | 491 | os_file_close(remote.file); | 494 | os_file_close(remote.file); |
246 | 492 | mem_free(remote.filepath); | 495 | mem_free(remote.filepath); |
247 | @@ -507,7 +510,7 @@ | |||
248 | 507 | 510 | ||
249 | 508 | 511 | ||
250 | 509 | /* Try to open the tablespace in the datadir. */ | 512 | /* Try to open the tablespace in the datadir. */ |
252 | 510 | @@ -4334,6 +4431,17 @@ | 513 | @@ -4334,6 +4434,17 @@ |
253 | 511 | fil_validate_single_table_tablespace(tablename, &def); | 514 | fil_validate_single_table_tablespace(tablename, &def); |
254 | 512 | if (!def.success) { | 515 | if (!def.success) { |
255 | 513 | os_file_close(def.file); | 516 | os_file_close(def.file); |
256 | @@ -525,7 +528,7 @@ | |||
257 | 525 | } | 528 | } |
258 | 526 | } | 529 | } |
259 | 527 | 530 | ||
261 | 528 | @@ -4418,7 +4526,7 @@ | 531 | @@ -4418,7 +4529,7 @@ |
262 | 529 | /* At this point, only one tablespace is open */ | 532 | /* At this point, only one tablespace is open */ |
263 | 530 | ut_a(def.success == !remote.success); | 533 | ut_a(def.success == !remote.success); |
264 | 531 | 534 | ||
265 | @@ -534,7 +537,7 @@ | |||
266 | 534 | 537 | ||
267 | 535 | /* Get and test the file size. */ | 538 | /* Get and test the file size. */ |
268 | 536 | size = os_file_get_size(fsp->file); | 539 | size = os_file_get_size(fsp->file); |
270 | 537 | @@ -4437,9 +4545,9 @@ | 540 | @@ -4437,9 +4548,9 @@ |
271 | 538 | 541 | ||
272 | 539 | /* Every .ibd file is created >= 4 pages in size. Smaller files | 542 | /* Every .ibd file is created >= 4 pages in size. Smaller files |
273 | 540 | cannot be ok. */ | 543 | cannot be ok. */ |
274 | @@ -546,7 +549,7 @@ | |||
275 | 546 | ib_logf(IB_LOG_LEVEL_ERROR, | 549 | ib_logf(IB_LOG_LEVEL_ERROR, |
276 | 547 | "The size of single-table tablespace file %s " | 550 | "The size of single-table tablespace file %s " |
277 | 548 | "is only " UINT64PF ", should be at least %lu!", | 551 | "is only " UINT64PF ", should be at least %lu!", |
279 | 549 | @@ -4520,7 +4628,7 @@ | 552 | @@ -4520,7 +4631,7 @@ |
280 | 550 | } | 553 | } |
281 | 551 | mutex_exit(&fil_system->mutex); | 554 | mutex_exit(&fil_system->mutex); |
282 | 552 | #endif /* UNIV_HOTBACKUP */ | 555 | #endif /* UNIV_HOTBACKUP */ |
283 | @@ -555,7 +558,7 @@ | |||
284 | 555 | tablename, fsp->id, fsp->flags, FIL_TABLESPACE); | 558 | tablename, fsp->id, fsp->flags, FIL_TABLESPACE); |
285 | 556 | 559 | ||
286 | 557 | if (!file_space_create_success) { | 560 | if (!file_space_create_success) { |
288 | 558 | @@ -4547,13 +4655,55 @@ | 561 | @@ -4547,13 +4658,55 @@ |
289 | 559 | } | 562 | } |
290 | 560 | 563 | ||
291 | 561 | func_exit: | 564 | func_exit: |
292 | @@ -615,7 +618,7 @@ | |||
293 | 615 | mem_free(tablename); | 618 | mem_free(tablename); |
294 | 616 | if (remote.success) { | 619 | if (remote.success) { |
295 | 617 | mem_free(remote.filepath); | 620 | mem_free(remote.filepath); |
297 | 618 | @@ -4567,7 +4717,7 @@ | 621 | @@ -4567,7 +4720,7 @@ |
298 | 619 | idea is to read as much good data as we can and jump over bad data. | 622 | idea is to read as much good data as we can and jump over bad data. |
299 | 620 | @return 0 if ok, -1 if error even after the retries, 1 if at the end | 623 | @return 0 if ok, -1 if error even after the retries, 1 if at the end |
300 | 621 | of the directory */ | 624 | of the directory */ |
301 | @@ -624,7 +627,7 @@ | |||
302 | 624 | int | 627 | int |
303 | 625 | fil_file_readdir_next_file( | 628 | fil_file_readdir_next_file( |
304 | 626 | /*=======================*/ | 629 | /*=======================*/ |
306 | 627 | @@ -4607,7 +4757,7 @@ | 630 | @@ -4607,7 +4760,7 @@ |
307 | 628 | @return DB_SUCCESS or error number */ | 631 | @return DB_SUCCESS or error number */ |
308 | 629 | UNIV_INTERN | 632 | UNIV_INTERN |
309 | 630 | dberr_t | 633 | dberr_t |
310 | @@ -633,7 +636,7 @@ | |||
311 | 633 | /*===================================*/ | 636 | /*===================================*/ |
312 | 634 | { | 637 | { |
313 | 635 | int ret; | 638 | int ret; |
315 | 636 | @@ -4663,7 +4813,9 @@ | 639 | @@ -4663,7 +4816,9 @@ |
316 | 637 | "%s/%s", fil_path_to_mysql_datadir, dbinfo.name); | 640 | "%s/%s", fil_path_to_mysql_datadir, dbinfo.name); |
317 | 638 | srv_normalize_path_for_win(dbpath); | 641 | srv_normalize_path_for_win(dbpath); |
318 | 639 | 642 | ||
319 | @@ -644,7 +647,7 @@ | |||
320 | 644 | 647 | ||
321 | 645 | if (dbdir != NULL) { | 648 | if (dbdir != NULL) { |
322 | 646 | 649 | ||
324 | 647 | @@ -4684,9 +4836,15 @@ | 650 | @@ -4684,9 +4839,15 @@ |
325 | 648 | && (0 == strcmp(fileinfo.name | 651 | && (0 == strcmp(fileinfo.name |
326 | 649 | + strlen(fileinfo.name) - 4, | 652 | + strlen(fileinfo.name) - 4, |
327 | 650 | ".ibd") | 653 | ".ibd") |
328 | @@ -662,7 +665,7 @@ | |||
329 | 662 | /* The name ends in .ibd or .isl; | 665 | /* The name ends in .ibd or .isl; |
330 | 663 | try opening the file */ | 666 | try opening the file */ |
331 | 664 | fil_load_single_table_tablespace( | 667 | fil_load_single_table_tablespace( |
333 | 665 | @@ -4842,6 +5000,7 @@ | 668 | @@ -4842,6 +5003,7 @@ |
334 | 666 | { | 669 | { |
335 | 667 | fil_space_t* fnamespace; | 670 | fil_space_t* fnamespace; |
336 | 668 | fil_space_t* space; | 671 | fil_space_t* space; |
337 | @@ -670,7 +673,7 @@ | |||
338 | 670 | 673 | ||
339 | 671 | ut_ad(fil_system); | 674 | ut_ad(fil_system); |
340 | 672 | 675 | ||
342 | 673 | @@ -4919,6 +5078,10 @@ | 676 | @@ -4919,6 +5081,10 @@ |
343 | 674 | if (fnamespace == NULL) { | 677 | if (fnamespace == NULL) { |
344 | 675 | if (print_error_if_does_not_exist) { | 678 | if (print_error_if_does_not_exist) { |
345 | 676 | fil_report_missing_tablespace(name, id); | 679 | fil_report_missing_tablespace(name, id); |
346 | @@ -681,18 +684,18 @@ | |||
347 | 681 | } | 684 | } |
348 | 682 | } else { | 685 | } else { |
349 | 683 | ut_print_timestamp(stderr); | 686 | ut_print_timestamp(stderr); |
351 | 684 | @@ -4942,6 +5105,10 @@ | 687 | @@ -4942,6 +5108,10 @@ |
352 | 685 | 688 | ||
353 | 686 | mutex_exit(&fil_system->mutex); | 689 | mutex_exit(&fil_system->mutex); |
354 | 687 | 690 | ||
356 | 688 | + if (remove_from_data_dict) { | 691 | + if (remove_from_data_dict && purge_sys) { |
357 | 689 | + fil_remove_invalid_table_from_data_dict(name); | 692 | + fil_remove_invalid_table_from_data_dict(name); |
358 | 690 | + } | 693 | + } |
359 | 691 | + | 694 | + |
360 | 692 | return(FALSE); | 695 | return(FALSE); |
361 | 693 | } | 696 | } |
362 | 694 | 697 | ||
364 | 695 | @@ -5575,6 +5742,16 @@ | 698 | @@ -5575,6 +5745,16 @@ |
365 | 696 | 699 | ||
366 | 697 | ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE); | 700 | ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE); |
367 | 698 | 701 | ||
368 | @@ -709,7 +712,7 @@ | |||
369 | 709 | node = UT_LIST_GET_FIRST(space->chain); | 712 | node = UT_LIST_GET_FIRST(space->chain); |
370 | 710 | 713 | ||
371 | 711 | for (;;) { | 714 | for (;;) { |
373 | 712 | @@ -6502,6 +6679,7 @@ | 715 | @@ -6502,6 +6682,7 @@ |
374 | 713 | return(err); | 716 | return(err); |
375 | 714 | } | 717 | } |
376 | 715 | 718 | ||
377 | @@ -717,7 +720,7 @@ | |||
378 | 717 | /****************************************************************//** | 720 | /****************************************************************//** |
379 | 718 | Generate redo logs for swapping two .ibd files */ | 721 | Generate redo logs for swapping two .ibd files */ |
380 | 719 | UNIV_INTERN | 722 | UNIV_INTERN |
382 | 720 | @@ -6528,3 +6706,4 @@ | 723 | @@ -6528,3 +6709,4 @@ |
383 | 721 | 0, 0, new_name, old_name, mtr); | 724 | 0, 0, new_name, old_name, mtr); |
384 | 722 | } | 725 | } |
385 | 723 | } | 726 | } |
386 | 724 | 727 | ||
387 | === added file 'test/t/bug1340717.sh' | |||
388 | --- test/t/bug1340717.sh 1970-01-01 00:00:00 +0000 | |||
389 | +++ test/t/bug1340717.sh 2014-08-17 09:44:59 +0000 | |||
390 | @@ -0,0 +1,35 @@ | |||
391 | 1 | ######################################################################## | ||
392 | 2 | # Test resurrect table locks | ||
393 | 3 | ######################################################################## | ||
394 | 4 | |||
395 | 5 | . inc/common.sh | ||
396 | 6 | |||
397 | 7 | require_server_version_higher_than 5.6.0 | ||
398 | 8 | |||
399 | 9 | ################################################################################ | ||
400 | 10 | # Start an uncommitted transaction pause "indefinitely" to keep the connection | ||
401 | 11 | # open | ||
402 | 12 | ################################################################################ | ||
403 | 13 | function start_uncomitted_transaction() | ||
404 | 14 | { | ||
405 | 15 | run_cmd $MYSQL $MYSQL_ARGS sakila <<EOF | ||
406 | 16 | START TRANSACTION; | ||
407 | 17 | DELETE FROM payment; | ||
408 | 18 | SELECT SLEEP(10000); | ||
409 | 19 | EOF | ||
410 | 20 | } | ||
411 | 21 | |||
412 | 22 | start_server | ||
413 | 23 | load_sakila | ||
414 | 24 | |||
415 | 25 | start_uncomitted_transaction & | ||
416 | 26 | job_master=$! | ||
417 | 27 | |||
418 | 28 | sleep 5; | ||
419 | 29 | |||
420 | 30 | innobackupex --no-timestamp --include="sakila.actor" $topdir/backup | ||
421 | 31 | |||
422 | 32 | kill -SIGKILL $job_master | ||
423 | 33 | stop_server | ||
424 | 34 | |||
425 | 35 | innobackupex --apply-log $topdir/backup |
http:// jenkins. percona. com/view/ PXB%202. 1/job/percona- xtrabackup- 2.1-param/ 584/
lots of Jenkins failures are due to migration. hopefully Alexey will fix it and I re-run it.