Closed ycyxuehan closed 2 weeks ago
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question
template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
libs: gorm.io/driver/mysql v1.5.6
gorm.io/gorm v1.25.10 gorm.io/plugin/dbresolver v1.5.2 go: 1.21 mysql: 8.0 dbconfigs: showLog: true maxLifeTime: 30 maxIdleTime: 30 maxOpenConnections: 1024 maxIdleConnections: 100 code:
err := c.db.Table(tablename).Where("u= ? AND bbb IN ? AND t = ?", u, bbb, t).Updates(updateCols).Error
Error 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
[51664.069ms] [rows:0] UPDATE
aaaa
SETenabled
=false WHERE u = 1 AND bbb IN (1) AND t = 0; but i use mysql client execut it in console, it success and very fast:Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0 in this time, not all update failed, only the updates call failed.
when i remove the slave codes, this error disappeared
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question
template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
libs: gorm.io/driver/mysql v1.5.6 gorm.io/gorm v1.25.10 gorm.io/plugin/dbresolver v1.5.2 go: 1.21 mysql: 8.0 dbconfigs: showLog: true maxLifeTime: 30 maxIdleTime: 30 maxOpenConnections: 1024 maxIdleConnections: 100
code:
err := c.db.Table(tablename).Where("u= ? AND bbb IN ? AND t = ?", u, bbb, t).Updates(updateCols).Error
Error 1205 (HY000): Lock wait timeout exceeded; try restarting transaction [51664.069ms] [rows:0] UPDATE
aaaa
SETenabled
=false WHERE u = 1 AND bbb IN (1) AND t = 0;but i use mysql client execut it in console, it success and very fast:
Query OK, 0 rows affected (0.00 sec) Rows matched: 0 Changed: 0 Warnings: 0
in this time, not all update failed, only the updates call failed.