Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4356

MariaDB will not bind to "localhost" if localhost is both IPv4/IPv6 enabled

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.1, 5.5.30
    • Fix Version/s: 5.5.31
    • Component/s: None
    • Labels:
      None
    • Environment:
      Linux 2.6, with "localhost" being defined as both 127.0.0.1 and ::1

      Description

      If a host is configured with both an IPv6 and an IPv4 address, MariaDB will not start up. This was reported against mysql in http://bugs.mysql.com/bug.php?id=61713, and was later fixed. This fix is not in MariaDB.

      I would also note that the mysql folks fixed it incorrectly. Please see http://bugs.mysql.com/bug.php?id=65122 for the follow up.

      We are looking at migrating from MySQL to using MariaDB, but this inability to properly support IPv6 means that migration is a no-starter. I am astonished that since this was already at least partially fixed in MySQL it is not already in MariaDB.

      zimbra@zre-ldap003:~$ cat /etc/hosts
      127.0.0.1       localhost
      10.137.242.53   zre-ldap003.eng.vmware.com      zre-ldap003
      
      # The following lines are desirable for IPv6 capable hosts
      ::1     localhost ip6-localhost ip6-loopback
      fc00:10:137:242::53     zre-ldap003.eng.vmware.com      zre-ldap003
      fe00::0 ip6-localnet
      ff00::0 ip6-mcastprefix
      ff02::1 ip6-allnodes
      ff02::2 ip6-allrouters
      
      130402 16:51:24 mysqld_safe mysqld from pid file /opt/zimbra/db/mysql.pid ended
      130402 16:56:53 mysqld_safe Starting mysqld daemon with databases from /opt/zimbra/db/data
      130402 16:56:53 [ERROR] Can't start server: bind-address refers to multiple interfaces!
      130402 16:56:53 [ERROR] Aborting
      

        Gliffy Diagrams

          Attachments

            Activity

            Show
            quanah Quanah Gibson-Mount added a comment - Brad, see https://mariadb.atlassian.net/browse/MDEV-4379
            Hide
            wlad Vladislav Vaintroub added a comment -

            So, the dual-stack is bad and multiple sockets, one per IPvX are good? I never heard "dual socket" , but multiple listening sockets is what you mean, right?

            Show
            wlad Vladislav Vaintroub added a comment - So, the dual-stack is bad and multiple sockets, one per IPvX are good? I never heard "dual socket" , but multiple listening sockets is what you mean, right?
            Hide
            brad0 Brad Smith added a comment -

            Correct and yes I basically mean multiple listening sockets. I say dual sockets because for a lot of apps they just want to use both v4 and v6 so that would result in only two sockets (.e.g. * and :, but other apps sometimes want to listen to a bunch of specific IP addresses whether v4 or v6 and being a mix of the two and that could result in many sockets.

            Show
            brad0 Brad Smith added a comment - Correct and yes I basically mean multiple listening sockets. I say dual sockets because for a lot of apps they just want to use both v4 and v6 so that would result in only two sockets (.e.g. * and : , but other apps sometimes want to listen to a bunch of specific IP addresses whether v4 or v6 and being a mix of the two and that could result in many sockets.
            Hide
            ebyrob Robert Eby added a comment -

            I thought MariaDB, like MySQL, was bind "all or one"? Why do internal adapters get preferential treatment? (binding wildcard * allows access to both IPv4 and IPv6)

            Is this actually in the code-base? I downloaded 10.0.9 source and don't see any evidence of binding to multiple IP addresses in /sql/mysqld.cc, specifically near line 2440 which seems to bind to only one addrinfo::ai_addr.

            Note: If just clearing IPV6_V6ONLY is supporting this on UNIX, it certainly doesn't work on Windows 7 et al.

            Show
            ebyrob Robert Eby added a comment - I thought MariaDB, like MySQL, was bind "all or one"? Why do internal adapters get preferential treatment? (binding wildcard * allows access to both IPv4 and IPv6) Is this actually in the code-base? I downloaded 10.0.9 source and don't see any evidence of binding to multiple IP addresses in /sql/mysqld.cc, specifically near line 2440 which seems to bind to only one addrinfo::ai_addr. Note: If just clearing IPV6_V6ONLY is supporting this on UNIX, it certainly doesn't work on Windows 7 et al.
            Hide
            quanah Quanah Gibson-Mount added a comment -

            @Roberty Eby: You're looking for https://mariadb.atlassian.net/browse/MDEV-4379

            Show
            quanah Quanah Gibson-Mount added a comment - @Roberty Eby: You're looking for https://mariadb.atlassian.net/browse/MDEV-4379

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                quanah Quanah Gibson-Mount
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d