Hello Folks,
I have a proxysql setup in GKE, The proxysql run behind a network load balancer.
The backend is CloudSQL with mysql 5.7.
I got "General error: 1205 Lock wait timeout exceeded; try restarting transaction" for some queries to several tables.
When this happen, no long running to the impacted table. I suspect there the previous query which still hold the lock is part of a transaction but somehow the transaction is never finished, thus the lock is not released yet.
Even if we manually run the query after 1 hours, the lock is still there.
- mysql-max_transaction_time
- mysql-max_transaction_idle_time
The default value for both is 4 hours. Some developers mention they can manually run the query after 4-5 hours.
My questions are:
1. I plan to reduce both params above so the lock will be released earlier since the transaction is cancelled. The number of lock wait timeout will be reduced.
2. If updating the config above can solve the lock wait timeout issue. What is the best practice / rule of thumb on lowering the value? Are there any settings on MySQL side that I also need to adjust?
Thank you.
Regards,
Panji