diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 58cac17..d0edf9a 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -1806,7 +1806,7 @@ dict_table_rename_in_cache( } bool success = fil_rename_tablespace( - table->space, old_path, new_name, new_path); + table->space, old_path, new_name, new_path, true/* must succeed */); ut_free(old_path); ut_free(new_path); diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index d1fed30..c6d7200 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -3364,7 +3364,8 @@ fil_rename_tablespace( ulint id, const char* old_path, const char* new_name, - const char* new_path_in) + const char* new_path_in, + bool must_succeed) { bool sleep = false; bool flush = false; @@ -3401,7 +3402,7 @@ func_exit: return(false); } - if (count > 25000) { + if (count > 25000 && !must_succeed) { space->stop_ios = false; goto func_exit; } diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 3b030fe..50125bd 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1018,13 +1018,15 @@ The tablespace must exist in the memory cache. databasename/tablename format @param[in] new_path_in new file name, or NULL if it is located in the normal data directory +@param[in] whether loop at most 25000 times retrying. @return true if success */ bool fil_rename_tablespace( ulint id, const char* old_path, const char* new_name, - const char* new_path_in); + const char* new_path_in, + bool must_succeed); /*******************************************************************//** Allocates and builds a file name from a path, a table or tablespace name