mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 06:44:16 +01:00
branches/zip: Merge r2213:2236 from branches/5.1.
Forward port of r2236 Introduce retry/sleep logic as a workaround for a transient bug where ::open fails for partitioned tables randomly if we are using one file per table. (Bug #33349) Reviewed by: Heikki
This commit is contained in:
parent
d6a0577994
commit
286c499884
1 changed files with 22 additions and 2 deletions
|
@ -2389,6 +2389,8 @@ ha_innobase::open(
|
|||
dict_table_t* ib_table;
|
||||
char norm_name[1000];
|
||||
THD* thd;
|
||||
ulint retries = 0;
|
||||
char* is_part = NULL;
|
||||
|
||||
DBUG_ENTER("ha_innobase::open");
|
||||
|
||||
|
@ -2422,11 +2424,29 @@ ha_innobase::open(
|
|||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
/* We look for pattern #P# to see if the table is partitioned
|
||||
MySQL table. The retry logic for partitioned tables is a
|
||||
workaround for http://bugs.mysql.com/bug.php?id=33349. Look
|
||||
at support issue https://support.mysql.com/view.php?id=21080
|
||||
for more details. */
|
||||
is_part = strstr(norm_name, "#P#");
|
||||
retry:
|
||||
/* Get pointer to a table object in InnoDB dictionary cache */
|
||||
|
||||
ib_table = dict_table_get(norm_name, TRUE);
|
||||
|
||||
|
||||
if (NULL == ib_table) {
|
||||
if (is_part && retries < 10) {
|
||||
++retries;
|
||||
os_thread_sleep(100000);
|
||||
goto retry;
|
||||
}
|
||||
|
||||
if (is_part) {
|
||||
sql_print_error("Failed to open table %s after "
|
||||
"%lu attemtps.\n", norm_name,
|
||||
retries);
|
||||
}
|
||||
|
||||
sql_print_error("Cannot find or open table %s from\n"
|
||||
"the internal data dictionary of InnoDB "
|
||||
"though the .frm file for the\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue