Subroutine add_ip does not check for failure

Bug #429651 reported by Saint Aardvark on 2009-09-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-mmm
High
Pascal Hofmann

Bug Description

In the latest version of mysql-mmm (rev. 95 in bzr), the subroutine add_ip() does not check for failure. From lib/Agent/Helpers/Network.pm:

----
 if ($OSNAME eq 'linux') {
  `/sbin/ip addr add $ip/32 dev $if`;
 }
----

The routine that calls add_ip() is configure_ip(), from lib/Agents/Helpers/Actions.pm:

----
 MMM::Agent::Helpers::Network::add_ip($if, $ip);
 MMM::Agent::Helpers::Network::send_arp($if, $ip);
----

By contrast, check_ips(), also in Network.pm, does check for errors:

----
 if ($OSNAME eq 'linux') {
  $output = `/sbin/ip addr show dev $if`;
 }
[snip]
 return ($output =~ /\D+$ip\D+/) ? 1 : 0;
----

At the very least, check_ip() should be called after add_ip() to make sure the address has been added successfully.

(This bug is also present in the 1.x series, where it caused problems for me; I will be filing a bug there shortly.)

summary: - Subroute add_ip does not check for failure
+ Subroutine add_ip does not check for failure
Walter Heck (walterheck) on 2009-10-04
Changed in mysql-mmm:
status: New → Confirmed
importance: Undecided → High
Walter Heck (walterheck) wrote :

Google code bug 48 is a direct result of this bug:
http://code.google.com/p/mysql-master-master/issues/detail?id=48

I just ran into the exact same problem. The bas thing about this bug is that mmm_control show thinks everything is peachy, while in reality your cluster is unreachable!
Besides adding that check after the call to add_ip, I think a checker should also be written to ping/mysql connect on the virtual ip. When that fails, there doesn't necessarily have to be anything wrong with the underlying machines, so other checks might not catch that.

Walter Heck (walterheck) wrote :

Check out this for instance on the active master (achieved by setting "debug 1" in mmm_agent.conf. Obviously I made a booboo while installing, but that is not the point ;) . The point is that the agent thinks all is peachy while it even gets an error (that, coincidentally, doesn't show up in the error logs, another bug).

2009/10/04 06:40:09 DEBUG Listener: Waiting for connection...
2009/10/04 06:40:12 DEBUG Listener: Waiting for connection...
2009/10/04 06:40:15 DEBUG Listener: Connect!
2009/10/04 06:40:15 DEBUG Daemon: Command = 'GET_AGENT_STATUS|1|db1'
2009/10/04 06:40:15 DEBUG Received Command GET_AGENT_STATUS|1|db1
2009/10/04 06:40:15 DEBUG Fetching uptime from /proc/uptime
2009/10/04 06:40:15 DEBUG Uptime is 223952.70
2009/10/04 06:40:15 DEBUG Daemon: Answer = 'OK: Returning status!|UNKNOWN||'
2009/10/04 06:40:15 DEBUG Listener: Disconnect!
2009/10/04 06:40:15 DEBUG Listener: Waiting for connection...
2009/10/04 06:40:15 DEBUG Listener: Connect!
2009/10/04 06:40:15 DEBUG Daemon: Command = 'GET_SYSTEM_STATUS|1|db1'
2009/10/04 06:40:15 DEBUG Received Command GET_SYSTEM_STATUS|1|db1
2009/10/04 06:40:15 DEBUG Executing /usr/local/mysql-mmm//agent/check_ip eth1 192.168.100.120
Can't exec "/usr/local/mysql-mmm//agent/check_ip": No such file or directory at /usr/lib/perl5/vendor_perl/5.8.8/MMM/Agent/Helpers.pm line 171, <GEN6> line 1.
2009/10/04 06:40:15 DEBUG Executing /usr/local/mysql-mmm//agent/mysql_may_write
Can't exec "/usr/local/mysql-mmm//agent/mysql_may_write": No such file or directory at /usr/lib/perl5/vendor_perl/5.8.8/MMM/Agent/Helpers.pm line 171, <GEN6> line 1.
2009/10/04 06:40:15 DEBUG Fetching uptime from /proc/uptime
2009/10/04 06:40:15 DEBUG Uptime is 223952.71
2009/10/04 06:40:15 DEBUG Daemon: Answer = 'OK: Returning status!||'
2009/10/04 06:40:15 DEBUG Listener: Disconnect!
2009/10/04 06:40:15 DEBUG Listener: Waiting for connection...
2009/10/04 06:40:18 DEBUG Listener: Waiting for connection...

Changed in mysql-mmm:
assignee: nobody → Pascal Hofmann (pascalhofmann)
status: Confirmed → In Progress
Changed in mysql-mmm:
status: In Progress → Fix Committed
Changed in mysql-mmm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.