diff options
author | Inaam Rana <inaam.rana@oracle.com> | 2012-01-31 09:31:31 -0500 |
---|---|---|
committer | Inaam Rana <inaam.rana@oracle.com> | 2012-01-31 09:31:31 -0500 |
commit | 63769afc52adaba998771a8780388781cf7defd4 (patch) | |
tree | 175db8b8a0a0a9084cee5c43c44a90a18d428e2a /storage/innobase/fil | |
parent | 9ac635321b80ccadcc73d6db98378f4828fc6928 (diff) | |
download | mariadb-git-63769afc52adaba998771a8780388781cf7defd4.tar.gz |
Bug#13636122 THE ORIGINAL TABLE MISSING WHILE EXECUTE THE DDL 'ALTER TABLE ADD COLUMN
rb://914
approved by: Marko Makela
Poll in fil_rename_tablespace() after setting ::stop_ios flag can
result in a hang because the other thread actually dispatching the IO
won't wake IO helper threads or flush the tablespace before starting
wait in fil_mutex_enter_and_prepare_for_io().
Diffstat (limited to 'storage/innobase/fil')
-rw-r--r-- | storage/innobase/fil/fil0fil.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c index 6ca8381ebdf..1d3cdc6e227 100644 --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -772,11 +772,6 @@ retry: return; } - if (system->n_open < system->max_n_open) { - - return; - } - HASH_SEARCH(hash, system->spaces, space_id, space, space->id == space_id); if (space != NULL && space->stop_ios) { @@ -793,6 +788,18 @@ retry: mutex_exit(&(system->mutex)); +#ifndef UNIV_HOTBACKUP + /* Wake the i/o-handler threads to make sure pending + i/o's are performed */ + os_aio_simulated_wake_handler_threads(); + + os_thread_sleep(20000); +#endif /* UNIV_HOTBACKUP */ + + /* Flush tablespaces so that we can close modified + files in the LRU list */ + fil_flush_file_spaces(FIL_TABLESPACE); + os_thread_sleep(20000); count2++; @@ -800,6 +807,11 @@ retry: goto retry; } + if (system->n_open < system->max_n_open) { + + return; + } + /* If the file is already open, no need to do anything; if the space does not exist, we handle the situation in the function which called this function */ @@ -2290,7 +2302,7 @@ fil_rename_tablespace( retry: count++; - if (count > 1000) { + if (!(count % 1000)) { ut_print_timestamp(stderr); fputs(" InnoDB: Warning: problems renaming ", stderr); ut_print_filename(stderr, old_name); |