Details

    Description

      MySQL 8 has the RESTART statement. It would be useful to add to MariaDB for compatibility purposes, and is useful in its own right as a relative of the SHUTDOWN statement.

      See https://dev.mysql.com/doc/refman/8.0/en/restart.html

      Attachments

        Issue Links

          Activity

            Should a replica be restarted as well?

            nikitamalyavin Nikita Malyavin added a comment - Should a replica be restarted as well?

            I would like to do this.

            siakc Siavosh Kasravi added a comment - I would like to do this.

            In progress...

            siakc Siavosh Kasravi added a comment - In progress...

            Syntax is like SHUTDOWN. So it also supports WAIT FOR ALL SLAVES. It will exit with status code 16 so that monitoring/parent process can detect a restart request. Code logic checks to see if MARIADBD_PARENT_PID env is set and corresponding process is alive (linux only) before shutdown. It is compatible with mysql RESTART except that the name of the env has MARIADBD_ as the prefix instead of MYSQLD_.

            siakc Siavosh Kasravi added a comment - Syntax is like SHUTDOWN. So it also supports WAIT FOR ALL SLAVES. It will exit with status code 16 so that monitoring/parent process can detect a restart request. Code logic checks to see if MARIADBD_PARENT_PID env is set and corresponding process is alive (linux only) before shutdown. It is compatible with mysql RESTART except that the name of the env has MARIADBD_ as the prefix instead of MYSQLD_.

            Could you implement restart completely within the server executable, why does it need support from the calling process?

            serg Sergei Golubchik added a comment - Could you implement restart completely within the server executable, why does it need support from the calling process?
            siakc Siavosh Kasravi added a comment - - edited

            It is the way MySQL and MaxScale work and was discussed in its zuli thread.

            siakc Siavosh Kasravi added a comment - - edited It is the way MySQL and MaxScale work and was discussed in its zuli thread .
            serg Sergei Golubchik added a comment - - edited

            So, two approaches. Simply exit with a special return code or exec itself instead.

            Pro exit:

            • MySQL and MaxScale do it this way
            • allows to measure the uptime since the last restart
            • restores resources better (environment and file descriptors, although the server uses O_CLOEXEC anyway)

            Pro exec:

            • just works, on itself, does not require support in external tools (e.g. mariadbd-safe, systemd, or k8s)
            • doesn't restart the container
            serg Sergei Golubchik added a comment - - edited So, two approaches. Simply exit with a special return code or exec itself instead. Pro exit: MySQL and MaxScale do it this way allows to measure the uptime since the last restart restores resources better (environment and file descriptors, although the server uses O_CLOEXEC anyway) Pro exec: just works, on itself, does not require support in external tools (e.g. mariadbd-safe, systemd, or k8s) doesn't restart the container

            Okay, let's do exit(16) then

            serg Sergei Golubchik added a comment - Okay, let's do exit(16) then

            People

              Unassigned Unassigned
              greenman Ian Gilfillan
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.