Aiven-Open / myhoard

MySQL Backup and Point-in-time Recovery service
Apache License 2.0
93 stars 20 forks source link

Ensure MySQL is only restarted once before starting streaming changes #190

Closed packi closed 4 weeks ago

packi commented 4 weeks ago

In some rare cases MySQL takes a long time to start accepting queries. When that happens, the server may take several minutes to do some initial processing, after which it starts responding normally again and subsequent restarts are fast. Restarting it before it has finished the processing causes the operation to never complete so avoid doing that so that the system does not go to never ending restart loop.

rdunklau commented 4 weeks ago

The restart case for systemd looks fine, as the commands are checked, but I'm worried about the _restart_process case: the command output is not checked for, so a failure to start here will be silenced. I wouldn't matter with the previous code, as we would restart it anyway on the next try.

rdunklau commented 4 weeks ago

After discussing with @packi the use without systemd is supposed to be for testing purposes only.