[MDEV-30813] RESTART statement Created: 2023-03-08 Updated: 2024-01-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Ian Gilfillan | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | beginner-friendly, compat80 | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| 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 |
| Comments |
| Comment by Nikita Malyavin [ 2023-04-17 ] |
|
Should a replica be restarted as well? |
| Comment by Siavosh Kasravi [ 2024-01-05 ] |
|
I would like to do this. |
| Comment by Siavosh Kasravi [ 2024-01-11 ] |
|
In progress... |
| Comment by Siavosh Kasravi [ 2024-01-12 ] |
|
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_. |
| Comment by Sergei Golubchik [ 2024-01-12 ] |
|
Could you implement restart completely within the server executable, why does it need support from the calling process? |
| Comment by Siavosh Kasravi [ 2024-01-13 ] |
|
It is the way MySQL and MaxScale work and was discussed in its zuli thread. |
| Comment by Sergei Golubchik [ 2024-01-30 ] |
|
So, two approaches. Simply exit with a special return code or exec itself instead. Pro exit:
Pro exec:
|
| Comment by Sergei Golubchik [ 2024-01-30 ] |
|
Okay, let's do exit(16) then |