-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Intermittent error - sql: driver does not support non-default isolation level #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This driver needs to implement https://godoc.org/database/sql/driver#ConnBeginTx to support non-default isolation levels. |
@kardianos That is supported by this library and it works most of the time. This issue is regarding an intermittent error when using the isolation options. |
Can you test with Go1.10? A beta will probably be cut today or tomorrow. Or test from Go master? I really don't know why or how that could happen intermittently. |
If you can't test Go1.10, you could also just vendor the "database/sql/..." packages and it will override the stdlib packages. |
Yeah, we can run some tests with the new |
Hmm, also, do you have a canary running with the race detector on? |
No, but I could try that and hope that it triggers. |
I'm getting this error as well, but consistently. It looks like the requisite |
@jmalloc Of course. BeginTx is new API from Go 1.8. |
@derekperkins Would you add this log line before the line?
|
When I add that logging, I get this:
I should note, in case others encounter this, that this was a package vendored with I then added a constraint so [[constraint]]
name = "github.com/go-sql-driver/mysql"
branch = "master" After updating the dependencies, I no longer get Perhaps it's time to tag a new release? |
@dcormier it's not relating this issue, completely. |
As far as I can tell, switching to the master branch has fixed this for me. So I'd also say it's time for a new release :) [[constraint]]
name = "github.com/go-sql-driver/mysql"
- version = "1.3.0"
+ branch = "master" |
I have the same experience as @wayneashleyberry. We first started to notice the error after moving to go 1.10. Changing the dependency to master works, but we would like to be back on a stable version as soon as possible. Thanks! |
There's a tracking PR for the next release if anyone's interested. |
FWIW, we're still experiencing the issue with Go 1.11 and driver version 99ff426. I apologize that I haven't had the time to really dig in and debug it. |
@methane @kardianos I just deployed a vendored copy of |
Issue description
We're pushing on average ~5k QPS and we see intermittent spurts of errors when we try to begin a transaction. We've seen this error happen a few hundred thousand times over the last 24 hours. It will appear and then resolve itself typically within an hour if we don't catch it first. It is happening across multiple handlers, and we still have millions of transactions starting within that same hour. We are also able to successfully use other isolation levels most of the time.
It feels like there is either a race condition somewhere or there is another transient error happening that is triggering the wrong error value. I can't reliably reproduce it, but it has been happening for a few weeks on multiple versions of the driver.
The issue began when we started explicitly passing in
sql.TxOptions
. We mitigated the problem by sending innil
when we're usingREPEATABLE READ
, since that is the driver default and accounts for > 99% of our transaction volume.I'm not super familiar with the stdlib <-> driver interaction, but I'm happy to help debug where I can help. Thanks for a great driver!
Example code
Error log
Configuration
Driver version (or git SHA):
9181e3a
fade210
Go version: run
go version
in your console1.9.2
Server version: E.g. MySQL 5.6, MariaDB 10.0.20
5.7.20
Server OS: E.g. Debian 8.1 (Jessie), Windows 10
Debian 8.9
cc @kardianos @josephbergevin
The text was updated successfully, but these errors were encountered: