(8.4) PXC-4558: mysql cannot connect to mysql-server in post-processing, if the host is not localhost in the .mylogin.cnf #1989
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://perconadev.atlassian.net/browse/PXC-4558
Problem:
If .mylogin.cnf file is present and it contains 'host' specified which is
not localhost, the SST script is not able to connect to post-processing
(post-sst) mysqld instance and SST fails.
Cause:
SST script, on both sides, donor and joiner, uses socket protocol to
connect to the local mysqld instance (mysql, mysqladmin, pxb).
If .mylogin.cnf file is present and contains 'host' parameter, it takes
precedence over command line options, even if `--protocol=SOCKET' is
specified explicitly. On joiner side, after SST, so-called
post-processing mysqld instance is started. It has networking disabled,
the only way to connect is via socket. Having .mylogin.cnf file in place
causes mysql and mysqladmin to try TCP transport instead of the socket
and SST fails.
As donor instance has networking enabled, this issue unlikely to be
visible on that side. However, if .mylogin.cnf file is present and
contains 'host' and not correct 'port', the donor side will fail as well
Solution:
For SST environment (SST script), override .mylogin.cnf by exporting
MYSQL_TEST_LOGIN_FILE env variable.