Skip to content

Commit

Permalink
MDEV-26717 mysql_upgrade_service/mariadb-upgrade-service -avoid slow …
Browse files Browse the repository at this point in the history
…shutdown

Apparently, slow shutdown is not necessary anymore after MDEV-15912 fix
  • Loading branch information
vaintroub committed Sep 29, 2021
1 parent 1f09941 commit a135287
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sql/mysql_upgrade_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -492,20 +492,22 @@ 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",
GetCurrentProcessId());

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)
Expand Down

0 comments on commit a135287

Please sign in to comment.