Skip to content

Commit 698bea3

Browse files
committed
mysqlcluster: fix the bug about io hang xenon no switch leader #364
1 parent 4e2271e commit 698bea3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

mysqlcluster/container/mysql.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ func (c *mysql) getLivenessProbe() *corev1.Probe {
8888
return &corev1.Probe{
8989
Handler: corev1.Handler{
9090
Exec: &corev1.ExecAction{
91-
Command: []string{"pgrep", "mysqld"},
91+
Command: []string{
92+
"sh",
93+
"-c",
94+
"touch /var/lib/mysql/auto.cnf && pgrep mysqld",
95+
},
9296
},
9397
},
9498
InitialDelaySeconds: 30,

mysqlcluster/container/mysql_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ func TestGetMysqlLivenessProbe(t *testing.T) {
108108
livenessProbe := &corev1.Probe{
109109
Handler: corev1.Handler{
110110
Exec: &corev1.ExecAction{
111-
Command: []string{"pgrep", "mysqld"},
111+
Command: []string{
112+
"sh",
113+
"-c",
114+
"touch /var/lib/mysql/auto.cnf && pgrep mysqld",
115+
},
112116
},
113117
},
114118
InitialDelaySeconds: 30,

0 commit comments

Comments
 (0)