[Commits] 245bfc5: MDEV-8669 MTR client connections on Windows became much slower.

wlad at mariadb.com wlad at mariadb.com
Tue Nov 3 18:47:40 EET 2015


revision-id: 245bfc52fc869ce095534b3f0d1f9f559e96d703 (mariadb-10.0.22-5-g245bfc5)
parent(s): fa1438cbf4307731a54ea4137d5f7d4b744cdfbc
committer: Vladislav Vaintroub
timestamp: 2015-11-03 17:41:06 +0100
message:

MDEV-8669 MTR client connections on Windows became much slower.
The regression is caused by change bind-address server parameter
in MDEV-8083, so now server listens on IPv4 only by default.

The problem however is that on Windows, connection to server on localhost
appears to be much faster, if server listens on IPv6/dual stack.
mysql_real_connect() would try to connect to IPv6 loopback  first,
and if this fails, the failing connect() call takes several seconds.

To fix, use bind-address=* on Windows, and 127.0.0.1 elsewhere

---
 mysql-test/include/default_mysqld.cnf | 1 -
 mysql-test/lib/My/ConfigFactory.pm    | 8 ++++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index 0432147..3388166 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -31,7 +31,6 @@ debug-no-sync
 
 # Retry bind as this may fail on busy server
 port-open-timeout=10
-bind-address=127.0.0.1
 
 log-bin-trust-function-creators=1
 key_buffer_size=            1M
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index 4e8507a..57734fd 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -169,6 +169,13 @@ sub fix_log {
   return "$dir/mysqld.log";
 }
 
+sub fix_bind_address {
+  if (IS_WINDOWS) {
+    return "*";
+  } else {
+    return "127.0.0.1";
+  }
+}
 sub fix_log_slow_queries {
   my ($self, $config, $group_name, $group)= @_;
   my $dir= dirname($group->value('datadir'));
@@ -251,6 +258,7 @@ my @mysqld_rules=
  { 'ssl-ca' => \&fix_ssl_ca },
  { 'ssl-cert' => \&fix_ssl_server_cert },
  { 'ssl-key' => \&fix_ssl_server_key },
+ { 'bind-address' => \&fix_bind_address },
   );
 
 if (IS_WINDOWS)


More information about the commits mailing list