** Description changed:

- There are at least 2 identified problems with keepalived on Precise when
- trying to reload the configuration (/etc/keepalived/keepalived.conf):
+ [Impact]
+ There are at least 2 identified problems with keepalived on Precise when 
trying to reload the configuration (/etc/keepalived/keepalived.conf):
  
  (a) The removal of a server from the cluster does not work when the port
  of that server is in use by another member server
  
  (b) The change of weight of a cluster member does not work
  
  Reload is done by either:
  
  1. sudo service keepalived reload
  2. sudo kill -HUP `pidof keepalived`
  
  The upstream devel list suggests that issue (a) [1] has been resolved in
  version 1.2.3 which is currently only in Debian unstable via version
  1.2.7.  I can't find the actual bug supposedly filed by 'Ronie Gilberto
  Henrich'.  I have not tested 1.2.7 as it is not easily available to me.
  
  The pertinent entry for (a) in the upstream changelog [2] I believe is
  here:
  
  {{{ * check : Fix IPv4 address comparison routine. }}}
  
  This bug is a request to have fixes for both issues ([3] for (a))
  introduced into Ubuntu 12.04.
  
  [1]: http://comments.gmane.org/gmane.linux.keepalived.devel/3708
  [2]: http://www.keepalived.org/changelog.html
  [3]: 
https://github.com/acassen/keepalived/commit/e7931c851ecd359379c6bbc5b39287e36cbfbf25
+ 
+ [Test Case]
+ (a) Stop keepalived
+ 
+ $ sudo service keepalived stop
+ 
+ (b) Begin with a simple configuration file (attached: keepalived.conf)
+ 
+ $ cat keepalived.conf | sudo tee /etc/keepalived/keepalived.conf
+ $ sudo service keepalived start
+ $ sudo ipvsadm -Ln
+ 
+ IP Virtual Server version 1.2.1 (size=4096)
+ Prot LocalAddress:Port Scheduler Flags
+   -> RemoteAddress:Port Forward Weight ActiveConn InActConn
+ TCP 192.168.0.100:80 wrr
+   -> 192.168.1.101:8080 Masq 1 0 0
+   -> 192.168.1.102:8080 Masq 1 0 0
+ 
+ (c) Add a stanza to the configuration file (a server with a port that is
+ in use by another server)
+ 
+ --------------
+     real_server 192.168.1.103 8080 {
+         weight 1
+         inhibit_on_failure
+     }
+ --------------
+ 
+ (d) Reload the configuration
+ 
+ $ sudo service keepalived reload
+ $ sudo ipvsadm -Ln
+ 
+ --------------
+ IP Virtual Server version 1.2.1 (size=4096)
+ Prot LocalAddress:Port Scheduler Flags
+   -> RemoteAddress:Port Forward Weight ActiveConn InActConn
+ TCP 192.168.0.100:80 wrr
+   -> 192.168.1.101:8080 Masq 1 0 0
+   -> 192.168.1.102:8080 Masq 1 0 0
+   -> 192.168.1.103:8080 Masq 1 0 0
+ --------------
+ 
+ (e) Remove the .103 stanza
+ (f) Perform step (d) above
+ 
+ --------------
+ IP Virtual Server version 1.2.1 (size=4096)
+ Prot LocalAddress:Port Scheduler Flags
+   -> RemoteAddress:Port Forward Weight ActiveConn InActConn
+ TCP 192.168.0.100:80 wrr
+   -> 192.168.1.101:8080 Masq 1 0 0
+   -> 192.168.1.102:8080 Masq 1 0 0
+   -> 192.168.1.103:8080 Masq 1 0 0
+ --------------
+ 
+ Note the .103 server remains.
+ 
+ 4B. Steps to Reproduce issue #2:
+ 
+ (a) Perform steps (a) and (b) from 4A
+ (b) Edit a stanza in the configuration file (change weight from '1' to '0' in 
the .102 server)
+ 
+ --------------
+     real_server 192.168.1.102 8080 {
+         weight 0
+         inhibit_on_failure
+     }
+ --------------
+ 
+ (c) Perform step (d) from 4A
+ 
+ --------------
+ P Virtual Server version 1.2.1 (size=4096)
+ Prot LocalAddress:Port Scheduler Flags
+   -> RemoteAddress:Port Forward Weight ActiveConn InActConn
+ TCP 192.168.0.100:80 wrr
+   -> 192.168.1.101:8080 Masq 1 0 0
+   -> 192.168.1.102:8080 Masq 1 0 0
+ --------------
+ 
+ Note the original weight of '1' for .102 server remains.
+ 
+ 4C. Steps to Counterprove issue #1:
+ 
+ (a) Perform steps (a) and (b) from 4A
+ (b) Add a stanza to the configuration file (a server with a port that is not 
in use by another server)
+ 
+ --------------
+     real_server 192.168.1.103 8081 {
+         weight 1
+         inhibit_on_failure
+     }
+ --------------
+ 
+ (c) Perform step (d) from 4A
+ 
+ --------------
+ IP Virtual Server version 1.2.1 (size=4096)
+ Prot LocalAddress:Port Scheduler Flags
+   -> RemoteAddress:Port Forward Weight ActiveConn InActConn
+ TCP 192.168.0.100:80 wrr
+   -> 192.168.1.101:8080 Masq 1 0 0
+   -> 192.168.1.102:8080 Masq 1 0 0
+   -> 192.168.1.103:8081 Masq 1 0 0
+ --------------
+ 
+ (d) Remove the .103 stanza from the configuration file
+ (e) Perform step (d) from 4A
+ 
+ --------------
+ IP Virtual Server version 1.2.1 (size=4096)
+ Prot LocalAddress:Port Scheduler Flags
+   -> RemoteAddress:Port Forward Weight ActiveConn InActConn
+ TCP 192.168.0.100:80 wrr
+   -> 192.168.1.101:8080 Masq 1 0 0
+   -> 192.168.1.102:8080 Masq 1 0 0
+ --------------
+ 
+ Note the .103 server does not remain.
+ 
+ 5. Known Workaround:
+ 
+ - Restart the daemon:
+ 
+ $ sudo service keepalived restart
+ 
+ OR
+ 
+ - Manage the daemon with ipvsadm:
+ 
+ (a) Add a server
+ 
+ $ sudo ipvsadm -a -t 192.168.0.100:80 -r 192.168.1.103:8080 -m
+ 
+ (b) Edit a server (change weight)
+ 
+ $ sudo ipvsadm -e -t 192.168.0.100:80 -r 192.168.1.103:8080 -m -w 0
+ 
+ (c) Delete a server
+ 
+ $ sudo ipvsadm -d -t 192.168.0.100:80 -r 192.168.1.103:8080
+ 
+ [Regression Potential]
+ This introduces the proper behavior for comparing ipv4 addresses. We may see 
issues where keepalived was working in an environment and after upgrade fails. 
This probably indicates that the environment may have issues outside of 
keepalived as the previous behavior was incorrect.

** Patch added: "keepalived_1.2.2-3ubuntu1.1.precise.debdiff"
   
https://bugs.launchpad.net/ubuntu/+source/keepalived/+bug/1211876/+attachment/3845140/+files/keepalived_1.2.2-3ubuntu1.1.precise.debdiff

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to keepalived in Ubuntu.
https://bugs.launchpad.net/bugs/1211876

Title:
  keepalived reload buggy due to improper ipv4 address comparison

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/keepalived/+bug/1211876/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to