Skip to content

Commit 88b2ebf

Browse files
committed
add new statuses added in 8.4
1 parent eca2d17 commit 88b2ebf

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

cmd/mysql-state-monitor/main.go

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,61 @@ func parseDatum(datum string) state.MySQLState {
2525

2626
if strings.HasPrefix(lines[0], "STATUS=") {
2727
status := strings.TrimPrefix(lines[0], "STATUS=")
28+
2829
switch status {
2930
case "Server is operational":
3031
return state.MySQLReady
31-
case "Server shutdown in progress":
32+
case "Server shutdown in progress",
33+
"Forceful shutdown of connections in progress",
34+
"Graceful shutdown of connections in progress",
35+
"Components initialization unsuccessful",
36+
"Execution of SQL Commands from Init-file unsuccessful",
37+
"Initialization of dynamic plugins unsuccessful",
38+
"Initialization of MySQL system tables unsuccessful",
39+
"InnoDB crash recovery unsuccessful",
40+
"InnoDB initialization unsuccessful":
3241
return state.MySQLDown
3342
case "Server startup in progress",
34-
"Data Dictionary upgrade in progress",
35-
"Data Dictionary upgrade complete",
43+
"Server initialization in progress",
3644
"Server upgrade in progress",
3745
"Server upgrade complete",
3846
"Server downgrade in progress",
3947
"Server downgrade complete",
48+
"Data Dictionary upgrade in progress",
49+
"Data Dictionary upgrade complete",
4050
"Data Dictionary upgrade from MySQL 5.7 in progress",
4151
"Data Dictionary upgrade from MySQL 5.7 complete",
52+
"Components initialization in progress",
53+
"Components initialization successful",
54+
"Connection shutdown complete",
55+
"Execution of SQL Commands from Init-file successful",
56+
"Initialization of dynamic plugins in progress",
57+
"Initialization of dynamic plugins successful",
58+
"Initialization of MySQL system tables in progress",
59+
"Initialization of MySQL system tables successful",
60+
"InnoDB crash recovery in progress",
61+
"InnoDB crash recovery successful",
62+
"InnoDB initialization in progress",
63+
"InnoDB initialization successful",
64+
"Shutdown of plugins complete",
65+
"Shutdown of components in progress",
66+
"Shutdown of components successful",
67+
"Shutdown of plugins in progress",
68+
"Shutdown of replica threads in progress",
4269
"Server shutdown complete": // we treat this as startup because during init, MySQL notifies this even if it's up
4370
return state.MySQLStartup
4471
}
72+
73+
// these statuses have variables in it
74+
// that's why we're handling them separately
75+
switch {
76+
case strings.HasPrefix(status, "Pre DD shutdown of MySQL SE plugin"):
77+
return state.MySQLStartup
78+
case strings.HasPrefix(status, "Server shutdown complete"):
79+
return state.MySQLStartup
80+
case strings.HasPrefix(status, "Server initialization complete"):
81+
return state.MySQLStartup
82+
}
4583
}
4684

4785
return state.MySQLUnknown

0 commit comments

Comments
 (0)