diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2021-09-29 12:29:17 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2021-09-29 12:29:17 +0200 |
commit | a1352870a21aceb004d5d4677c5a107e43c589b3 (patch) | |
tree | 054efdc8da288ad65aa9c75113662872b5eba296 | |
parent | 1f099418b6cce00b72f601288735bd7454d037cd (diff) | |
download | mariadb-git-a1352870a21aceb004d5d4677c5a107e43c589b3.tar.gz |
MDEV-26717 mysql_upgrade_service/mariadb-upgrade-service -avoid slow shutdown
Apparently, slow shutdown is not necessary anymore after MDEV-15912 fix
-rw-r--r-- | sql/mysql_upgrade_service.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc index b3683618e6e..8e2b394594b 100644 --- a/sql/mysql_upgrade_service.cc +++ b/sql/mysql_upgrade_service.cc @@ -271,7 +271,7 @@ void stop_mysqld_service() } /* - Remeber initial state of the service, we will restore it on + Remember initial state of the service, we will restore it on exit. */ if(initial_service_state == UINT_MAX) @@ -492,8 +492,10 @@ int main(int argc, char **argv) CopyFile(service_properties.inifile, my_ini_bck, FALSE); upgrade_config_file(service_properties.inifile); - log("Phase %d/%d: Ensuring innodb slow shutdown%s", ++phase, max_phases, - old_mysqld_exe_exists?",this can take some time":"(skipped)"); + bool do_start_stop_server = old_mysqld_exe_exists && initial_service_state != SERVICE_RUNNING; + + log("Phase %d/%d: Start and stop server in the old version, to avoid crash recovery %s", ++phase, max_phases, + do_start_stop_server?",this can take some time":"(skipped)"); char socket_param[FN_REFLEN]; sprintf_s(socket_param, "--socket=mysql_upgrade_service_%d", @@ -501,11 +503,11 @@ int main(int argc, char **argv) DWORD start_duration_ms = 0; - if (old_mysqld_exe_exists) + if (do_start_stop_server) { - /* Start/stop server with --loose-innodb-fast-shutdown=0 */ + /* Start/stop server with --loose-innodb-fast-shutdown=1 */ mysqld_process = (HANDLE)run_tool(P_NOWAIT, service_properties.mysqld_exe, - defaults_file_param, "--loose-innodb-fast-shutdown=0", "--skip-networking", + defaults_file_param, "--loose-innodb-fast-shutdown=1", "--skip-networking", "--enable-named-pipe", socket_param, "--skip-slave-start", NULL); if (mysqld_process == INVALID_HANDLE_VALUE) |