-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: Use authentication_policy to specify default auth plugin for MySQL 8.4 #16426
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
d5d9fae
to
d01d5a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish to offer an alternative approach. MySQL supports the special prefix loose_
to any variable. With that prefix, if the variable exists - fine; if not - it is silently ignored.
So we can support both pre-8.4 and post 8.4 at the same time like so:
loose_default_authentication_plugin = mysql_native_password
loose_authentication_policy = 'mysql_native_password'
WDYT?
d01d5a6
to
d19756b
Compare
One question: According to this: vitess/go/vt/mysqlctl/mysqld.go Lines 932 to 934 in b162048
... the file I understand that if users downgrade their If that is the intention, then we should prefix all auth-related options with Information and test results with MySQL 8.4:
I prefixed everything with [vitess@1e0457954056 vt_0000000100]# grep loose_ my.cnf
loose_mysql_native_password = ON
loose_authentication_policy = 'mysql_native_password'
loose_default_authentication_plugin = mysql_native_password
loose_rpl_semi_sync_source_timeout = 1000000000000000000
loose_rpl_semi_sync_source_wait_no_replica = 1
[vitess@1e0457954056 vt_0000000100]# tail error.log
[snip]
2024-07-18T08:45:00.233808Z 0 [Warning] [MY-000067] [Server] unknown variable 'loose_default_authentication_plugin=mysql_native_password'.
2024-07-18T08:45:00.260035Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.1' socket: '/vt/vt_0000000100/mysql.sock' port: 17100 MySQL Community Server - GPL. Local cluster using |
You're right. No, it's not required to support pre-8.4 versions. |
d19756b
to
d01d5a6
Compare
Got it, thanks for confirming, I reverted my change to the original simple one. I will mark this PR as |
Thank you for the contribution!
I'm curious, are you planning to go into production with Vitess + MySQL 8.4? Ideally we need to start running unit tests against 8.4 to see what works and what doesn't. Is that something you would be interested in contributing? |
The PR that added mysql84.cnf had this comment, but it looks like it wasn't done correctly?
|
Yeah, likely me testing and then not properly committing the final result amongst testing on different versions and no CI yet to catch those kinds of mistakes.
Yeah, this is needed regardless also to catch issues like this and there's potentially a whole bunch more we don't know about (yet). There's at least also things like function behavior changes that the |
Yeah, we only did some prep work and there's no official support in v20 and it's not something to backport. Doing all the work in one single release is not likely to happen with how much needs to happen, so the expectation also isn't that it's there all in one release. We could aim for support in v21 but that's something we'd need to explicitly commit to and there's no such plans yet at the moment that I know of. Help with stuff like this would increase those chances though, but we also need to have the CI setup etc. as well as a bare minimum. |
No, we do not plan to do this. My intention was to migrate from MySQL 5.7 to MySQL 8, along with the move to use Vitess v19. As 8.0 is supported, we will use that going forward.
No, I will not be able to commit to this. Sorry! (I have been going through this unit test workflow file in my free time. At work though, as we can use 8.0 in production, we will be doing that.) |
`default_authentication_plugin` was removed starting in MySQL 8.4.0: > The default_authentication_plugin system variable, deprecated in MySQL 8.0.27, is removed as of > MySQL 8.4.0. Use authentication_policy instead. > > -- https://dev.mysql.com/doc/refman/8.4/en/mysql-nutshell.html Signed-off-by: Siddharth Kannan <mail@siddharthkannan.in>
d01d5a6
to
ca346e1
Compare
Rebased the PR since somehow some checks didn't run in CI so it couldn't be merged. |
…QL 8.4 (vitessio#16426) Signed-off-by: Siddharth Kannan <mail@siddharthkannan.in> Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Description
Fixes #16425
default_authentication_plugin
was removed starting in MySQL 8.4.0:I used the same process for testing the new MySQL 8.4 configuration file as described in the issue #16425.
The binary versions were different:
When the same process is followed and the script
101_initial_cluster.sh
is run, the script worksand starts the mysqld process. This can be confirmed by looking at the output of
ps
as well as byconnecting directly to MySQL using the socket and the DBA user's name:
Justification for requesting backport to v20
v20 has been released already with the file (this commit).
EXTRA_MY_CNF
can not be used to override this default configuration file. This means that users must provide the completemy.cnf
file using the--mysqlctl_mycnf_template
argument tomysqlctld
. (Please correct me if I am wrong. I am using this part of the code to justify the need for backporting.)So, in order to support MySQL 8.4 starting in v20, this should be backported to a future release in the v20 series.
Related Issue(s)
Fixes #16425
Checklist
Deployment Notes
None.