Bug #96933 Com_restart is not documented
Submitted: 18 Sep 2019 14:57 Modified: 1 Oct 2019 17:35
Reporter: Tibor Korocz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0.17 OS:Any
Assigned to: CPU Architecture:Any

[18 Sep 2019 14:57] Tibor Korocz
Description:
There is a new status parameter called Co_restart:

mysql [localhost:8017] {msandbox} ((none)) > show global status like '%restart%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_restart   | 0     |
+---------------+-------+
1 row in set (0.01 sec)

But it is not documented anywhere:
https://dev.mysql.com/doc/refman/8.0/en/restart.html
or
https://dev.mysql.com/doc/refman/8.0/en/server-status-variable-reference.html

I am not sure in the purpose of this status parameter.
When is this Com_restart is going to be anything else than 0?
This should be increasing and show how many times the server was restarted? (Status metrics should cleared during restart, if I am correct)

How to repeat:
mysql [localhost:8017] {msandbox} ((none)) > show global status like '%restart%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_restart   | 0     |
+---------------+-------+
1 row in set (0.01 sec)

mysql [localhost:8017] {msandbox} ((none)) > restart;
Query OK, 0 rows affected (0.00 sec)

mysql [localhost:8017] {msandbox} ((none)) > show global status like '%restart%';
ERROR 1053 (08S01): Server shutdown in progress
mysql [localhost:8017] {msandbox} ((none)) > show global status like '%restart%';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    8
Current database: *** NONE ***

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_restart   | 0     |
+---------------+-------+
1 row in set (0.01 sec)

Suggested fix:
Add this parameter to the documentation and clarify the purpose of the it and if this should be increasing with ever restart then the code needs changes.
[18 Sep 2019 15:40] MySQL Verification Team
Thank you for the bug report.
[1 Oct 2019 17:35] Paul DuBois
Posted by developer:
 
Added this note to https://dev.mysql.com/doc/refman/8.0/en/restart.html:

The Com_restart status variable tracks the number of RESTART
statements. Because status variables are initialized for each server
startup and do not persist across restarts, Com_restart normally has
a value of zero, but can be nonzero if RESTART statements were
executed but failed.

(Also added a similar note for the SHUTDOWN statement.)