Bug 768119

Summary: keepalived reload does not remove real server
Product: [Fedora] Fedora Reporter: Ryan O'Hara <rohara>
Component: keepalivedAssignee: Ryan O'Hara <rohara>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: matthias, rohara
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: keepalived-1.2.2-4.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-20 14:51:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix IPv4 address comparison routine. none

Description Ryan O'Hara 2011-12-15 19:42:53 UTC
Created attachment 547465 [details]
Fix IPv4 address comparison routine.

Description of problem:

Removing a real server from a virtual server in keepalived.conf and then reloading (eg. service keepalived reload) does not remove that real server from ipvs tables.

Version-Release number of selected component (if applicable):

keepalived-1.2.2-3 (F17)
keepalived-1.2.2-2 (EPEL6)

How reproducible:

Always

Steps to Reproduce:

1. Configure keepalived to have multiple real servers within a virtual server.
2. Start keepalived, verify all real servers are listed in ipvsadm output. For example:

# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.122.201:http rr
  -> 192.168.122.103:http         Route   1	 0          0
  -> 192.168.122.104:http         Route   1	 0          0
  -> 192.168.122.105:http         Route   1      0          0

3. Now edit keepalived.conf and remove a real server.
4. Run 'service keepalived reload'.
5. Check ipvsadm output. The real server removed in step #3 should no longer be listed.

Actual results:

The real server removed from keepalived.conf is still listed in ipvsadm output after a reload. For example, removing 192.168.122.105 from config file then reloading, 192.168.122.105 still shows up in ipvsadm.

Expected results:

The real server removed from keepalived.conf should not be listed in ipvsadm after keepalived reload. Removing 192.168.122.105 from config file then reloading should give this output from ipvsadm:

# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.122.201:http rr
  -> 192.168.122.103:http         Route   1	 0          0
  -> 192.168.122.104:http         Route   1	 0          0

Additional info:

This problem is due to a bug in keepalived where is compares two IPv4 addresses. I have tested a patch that fixes this problem. This bug exists in the upstream git repo (version 1.2.2) and is present in at least F17 and epel6. I've applied the patch, done a scratch build (epel6) and tested. Problem solved.

Comment 1 Ryan O'Hara 2012-03-20 14:38:05 UTC
Fixed in F16 (keepalived-1.2.2-4.fc16).
Fixed in F17 (keepalived-1.2.2-5.fc17).

Comment 2 Ryan O'Hara 2012-03-20 14:51:36 UTC
Fixed in EPEL6 (keepalived-1.2.2-3.el6)

Comment 3 Fedora Update System 2012-03-30 13:40:40 UTC
keepalived-1.2.2-5.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/keepalived-1.2.2-5.fc17

Comment 4 Fedora Update System 2012-03-30 13:41:41 UTC
keepalived-1.2.2-4.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/keepalived-1.2.2-4.fc16

Comment 5 Fedora Update System 2012-03-30 13:43:17 UTC
keepalived-1.2.2-3.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/keepalived-1.2.2-3.el6

Comment 6 Fedora Update System 2012-04-11 16:56:31 UTC
keepalived-1.2.2-4.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2012-04-12 03:22:38 UTC
keepalived-1.2.2-5.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2012-04-16 17:58:24 UTC
keepalived-1.2.2-3.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.