xen-org/xen-api — pull request #558 by robhoes (2012-04-26 09:02:53+00:00)
Title: CA-74937: Reset master (remote DB) connection for any dom0 IP address change

This prevents the master connection from getting "stuck" when:
1. A slave has two NICs, with management on eth0.
2. An IP address is put on eth1, and management is moved to it.
3. The IP address of eth0 is removed.

After step 1, the slave has a master connection with as local (socket)
address the IP of eth0. After step 2, the master connection is reset, but
it may still get the same local address (eth0's IP), since there are now
two routes to the master, and it is up to dom0's kernel to pick one.
After step 3, however, this routes breaks, but the master connection was
not reset. This patch causes the connection to be reset in this case as well.

In the "stuck" state, DB calls may still arrive at the master (and other slave
operations may still work), but the master would send replies to the old IP,
which would never arrive. I believe the slave would eventually realise this
and reset the connection, but only after a very long timeout. I think that
the situation is different when the master goes offline, because the MAC layer
would cause the TCP connection to break immediately, after which the slave
automatically resets the master connection, and keeps trying until the master
is back.

Signed-off-by: Rob Hoes