Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 168701 - sys-cluster/heartbeat does not correctly deactivate 802.1q interfaces on failover
Summary: sys-cluster/heartbeat does not correctly deactivate 802.1q interfaces on fail...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-28 10:54 UTC by Alun Jones
Modified: 2011-10-18 17:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alun Jones 2007-02-28 10:54:48 UTC
We have two servers acting as an LVS cluster with heartbeat. They are running on 802.1q VLANs, and this means that the interface names for virtual IP addresses end up in the form eth0.116:0 

However, ifconfig has a fixed field width and chops off the final character. This means that when heartbeat fails over, it doesn't correctly bring down the virtual IP off the original server. We've done some detective work and the problem lies in /usr/lib/ocf/heartbeat/IPaddr, in the function find_interface_generic, which parses the output of ifconfig to find the name of the interface.

We've hacked around this for now by installing iproute2 and writing a simple find_interface_iproute2 function which is as follows:

find_interface_iproute2() {
    ipaddr="$1"
    /sbin/ip addr show | /bin/fgrep "inet $1/" | /usr/bin/awk '{ print $NF; }'
}

We call this from find_interface() if we detect we're running Linux. This is a bit of a hack at the moment, as it assumes the existence of iproute2. Would appreciate feedback on this, as we intend to use it in front of a fairly large part of our infrastructure here.

I would have reported this upstream, but their Bugzilla is in a dodgy state at the moment...
Comment 1 Peter Alfredsen (RETIRED) gentoo-dev 2007-02-28 11:28:15 UTC
Debian already has a bug and proposed workaround:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=344633
--------
> I'd suggest switching the default ip script to IPaddr2 on linux platforms 
> which uses ip and doesn't have this limitation.

Yes, please specify IPaddr2 in your haresources file instead of IPaddr.
--------

Does this work for you?
Comment 2 Alun Jones 2007-02-28 13:19:58 UTC
Yes, works fine. I did look at IPaddr2 - just not carefully enough. Thanks!
Comment 3 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2011-10-18 17:29:06 UTC
+  18 Oct 2011; Kacper Kowalik <xarthisius@gentoo.org> -heartbeat-1.2.5.ebuild,
+  -heartbeat-1.2.5-r1.ebuild, -heartbeat-2.0.7-r2.ebuild,
+  -files/heartbeat-2.0.7-update-resources-failcount.patch,
+  -heartbeat-2.0.8.ebuild, -files/heartbeat-2.0.8-asneeded.patch,
+  -files/heartbeat-2.0.8-crm-assert.patch,
+  -files/heartbeat-2.0.8-crm-leaks.patch, -files/heartbeat-2.0.8-delay.patch,
+  -files/heartbeat-2.0.8-glibc.patch, -files/heartbeat-2.0.8-install_fix.patch,
+  -heartbeat-3.0.4-r1.ebuild:
+  Drop ancient and unusable versions of heartbeat-{1,2} since we have
+  heartbeat-3 stable