cybozu-go / moco

MySQL operator on Kubernetes using GTID-based semi-synchronous replication.
https://cybozu-go.github.io/moco/
Apache License 2.0
269 stars 22 forks source link

Do not kill system user #710

Closed shunki-fujita closed 2 months ago

shunki-fujita commented 2 months ago

Describe the bug KillConnections function also terminates system user processes. https://github.com/cybozu-go/moco/blob/c545ebbbab9e92aaf9b07c42263464d9faec50f9/pkg/dbop/kill.go#L19-L30

mysql> SELECT * FROM information_schema.PROCESSLIST WHERE USER="system user";
+----+-------------+-----------------+------+---------+------+----------------------------------------------------------+------+
| ID | USER        | HOST            | DB   | COMMAND | TIME | STATE                                                    | INFO |
+----+-------------+-----------------+------+---------+------+----------------------------------------------------------+------+
| 16 | system user | connecting host | NULL | Connect | 3747 | Waiting for source to send event                         | NULL |
| 17 | system user |                 | NULL | Query   |    1 | Replica has read all relay log; waiting for more updates | NULL |
| 18 | system user |                 | NULL | Query   |    1 | Waiting for an event from Coordinator                    | NULL |
| 19 | system user |                 | NULL | Query   |  347 | Waiting for an event from Coordinator                    | NULL |
| 20 | system user |                 | NULL | Connect | 3747 | Waiting for an event from Coordinator                    | NULL |
| 21 | system user |                 | NULL | Connect | 3747 | Waiting for an event from Coordinator                    | NULL |
+----+-------------+-----------------+------+---------+------+----------------------------------------------------------+------+
6 rows in set (0.00 sec)

mysql>

These processes should not kill. If killed, data inconsistencies could occur.