MySQL storage - Take 2#1485
Conversation
srenatus
left a comment
There was a problem hiding this comment.
Thanks for your contribution, and thanks for picking up where this was left off. (Also thanks to @pborzenkov)
I know that maintaining a storage backend takes a lot of time, I can offer my help (becoming a maintainer if needed/acceptable).
I think that might be a good idea -- @JoelSpeed, what do you think?
There was a problem hiding this comment.
IIRC the problem is the timeout. If a test times out, the t.Fatal(...) output will be lost. If it doesn't timeout, you'll see it just fine.
There was a problem hiding this comment.
Should I just change it back? TBH I haven't had issues with Fatal.
There was a problem hiding this comment.
It's fine, we can revisit that some other time 👍
There was a problem hiding this comment.
Why do we need this? I haven't dug into this code in a while, but I'd think we could wrap stuff in BEGIN; ... COMMIT;, maybe? What's wrong with the ; concatenation? 🤔I guess it's difficult to spot what's wrong; transactions-wise, I think it should not matter, should it?
There was a problem hiding this comment.
The issue here is that MySQL driver by default doesn't support multiple statements in one execution, in my original implementation I have used https://github.com/go-sql-driver/mysql#multistatements and this change is not needed. If you think that using that is better I can use that version.
There was a problem hiding this comment.
[nit] If we do this as multiple calls to tx.Exec, we don't need the ending ;, I think.
There was a problem hiding this comment.
Correct me if I'm wrong, but if this change has nothing to do with the mysql backend, I'd rather split it off... 😃
There was a problem hiding this comment.
This is because of the multistatement stuff :)
There was a problem hiding this comment.
👍 It's about time this happens.
|
The Postgres backend uses strict SSL verification by default, should this backend have the same semantics? |
I think that would be fair. 🤔 |
|
I made MySQL |
|
@bonifaido would you mind squashing these? maybe one commit per author? |
It will be shared by both Postgres and MySQL configs. Signed-off-by: Pavel Borzenkov <[email protected]>
|
Rebase done! 👍 |
srenatus
left a comment
There was a problem hiding this comment.
Thank you, @pborzenkov and @bonifaido! 🎉 👏
MySQL storage - Take 2
|
Question: Is there anything that specifically requires MySQL 5.7, or would 5.6 work? I'd like to run it against an Amazon Aurora Serverless database, and they claim they are compatible with MySQL 5.6. |
|
Hi @forsberg, the only issue that comes into my mind is the https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_transaction_isolation
So we need to add some kind of logic to detect MySQL 5.6 and use But, I just checked and AWS Aurora supports 5.7 today: https://aws.amazon.com/about-aws/whats-new/2018/02/amazon-aurora-is-compatible-with-mysql-5-7/ It would be nice to run some tests on Aurora first since they say that SERIALIZABLE isolation level is not supported, but I have no idea if it is or not, and that is a hard requirement by Dex currently, please see: #1370 (comment) |
|
Okay, I just created an AWS Aurora instance for a quick check with MySQL 5.7 (Aurora version of the db was 2.04.6) and the transaction_isolation variable is still unavailable, probably this version is not MySQL 5.7.20. |
|
AWS Aurora does indeed support what they call 5.7, but AWS Aurora Serverless (where you don't have to run instances yourself) only support 5.6. This is pretty hard to find in the documentation, but is documented in the FAQ. |
This PR tries to continue where #924 dropped off, namely on the work of @pborzenkov, I have changed the following stuff:
Tested with MySQL 5.7 and 8.0.
I know that maintaining a storage backend takes a lot of time, I can offer my help (becoming a maintainer if needed/acceptable).