wesql / wescale

WeScale is a Modern MySQL proxy that supports read-write-split, read-after-write-consistency, load balancing and OnlineDDL.
Apache License 2.0
196 stars 8 forks source link

[Bug Report] ddl execute timeout #279

Closed gerayking closed 9 months ago

gerayking commented 10 months ago

Overview of the Issue

Sometimes timeout occurs when executing ddl. After investigation, the problem is located in the line of code execDDL:result, err := qre.execStatefulConn(conn, sql, true).

Reproduction Steps

(base) ➜  ~ mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 8.0.30-Vitess Version: 16.0.0 (Git revision  branch '') built on  by @ using go1.20.4 darwin/arm64

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (1.18 sec)

mysql> create database test;
ERROR 1317 (70100): target: mysql.0.primary: vttablet: rpc error: code = Canceled desc = (errno 2013) due to context deadline exceeded, elapsed time: 59.744065458s, killing query ID 1821 (CallerID: userData1)

Binary Version

Version: 16.0.0 (Git revision 7f71ce9bca0a75b8121b6a49416b3d8f2bb93a25 branch 'feature/support_set_failpoint') built on Thu Sep  7 19:15:52 CST 2023 by geray@bogon using go1.20.4 darwin/arm64

Operating System and Environment details

Darwin 22.3.0

Log Fragments

No response

gerayking commented 10 months ago

It also happen when connecting mysql directly

(base) ➜  ~ mysql -u root -h127.0.0.1 -P17100

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2765
Server version: 8.0.33 Homebrew

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> create database test;

MySQL is not responding.The problem maybe in my enviroment, because mysql has not any response packet.