getaddrinfo failure
Bug #1250805 reported by
Raghavendra D Prabhu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL patches by Codership | Status tracked in 5.6 | |||||
5.6 |
Fix Released
|
Medium
|
Alex Yurchenko | |||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Fix Released
|
High
|
Raghavendra D Prabhu | |||
5.6 |
Fix Released
|
High
|
Unassigned |
Bug Description
wsrep_check_ip (added in wsrep-24 and wsrep-56) fails on Debian as:
2013-11-13 16:04:07 7627 [ERROR] WSREP: getaddrinfo() failed on '*': -2 (Name or service not known)
2013-11-13 16:04:07 7627 [ERROR] WSREP: Networking not configured, cannot receive state transfer.
This is because the default value of bind_address (if not set) is '*'
mysql> show global variables like '%bind_address%';
+------
| Variable_name | Value |
+------
| bind_address | * |
+------
1 row in set (0.01 sec)
=======
Note this won't occur if wsrep-node-address is provided.
Also, this didn't occur with wsrep-23 branch.
description: | updated |
To post a comment you must log in.
This is how the code looks in activate_tcp_port:
if (strcasecmp( my_bind_ addr_str, MY_BIND_ ALL_ADDRESSES) == 0)
{
/*
That's the case when bind-address is set to a special value ('*'),
meaning "bind to all available IP addresses". If the box supports
the IPv6 stack, that means binding to '::'. If only IPv4 is available,
bind to '0.0.0.0'.
*/
bool ipv6_available= false;
if (!getaddrinfo( ipv6_all_ addresses, port_buf, &hints, &ai))
{
/*
IPv6 might be available (the system might be able to resolve an IPv6
address, but not be able to create an IPv6-socket). Try to create a
dummy IPv6-socket. Do not instrument that socket by P_S.
*/
MYSQL_SOCKET s= mysql_socket_ socket( 0, AF_INET6, SOCK_STREAM, 0);
ipv6_ available= mysql_socket_ getfd(s) != INVALID_SOCKET;
mysql_ socket_ close(s) ;
}
if (ipv6_available) print_informati on("IPv6 is available.");
{
sql_
// Address info (ai) for IPv6 address is already set.
bind_ address_ str= ipv6_all_addresses; print_informati on("IPv6 is not available.");
}
else
{
sql_
// Retrieve address info (ai) for IPv4 address.
if (getaddrinfo( ipv4_all_ addresses, port_buf, &hints, &ai))
sql_perror( ER_DEFAULT( ER_IPSOCK_ ERROR)) ;
sql_print_ error(" Can't start server: cannot resolve hostname!");
unireg_ abort(1) ;
{
}
bind_ address_ str= ipv4_all_addresses; my_bind_ addr_str, port_buf, &hints, &ai)) perror( ER_DEFAULT( ER_IPSOCK_ ERROR)) ; /* purecov: tested */ print_error( "Can't start server: cannot resolve hostname!"); abort(1) ; /* purecov: tested */
}
}
else
{
if (getaddrinfo(
{
sql_
sql_
unireg_
}
bind_ address_ str= my_bind_addr_str;
}
======= ======= ======= ======= ======= ======= ======= ======= =====
It should be handled similarly in wsrep_check_ip.
======= ======= ======= ======= ======= ======= ======= ALL_ADDRESSES defines a special value for the bind-address option,
/**
MY_BIND_
which means that the server should listen to all available network addresses,
both IPv6 (if available) and IPv4.
Basically, this value instructs the server to make an attempt to bind the ALL_ADDRESSES= "*";
server socket to '::' address, and rollback to '0.0.0.0' if the attempt fails.
*/
const char *MY_BIND_
======= ======= ======= ======= ======= ======= ======= ====