ctdb-daemon: Do not update the VNN state on RELEASE_IP failure
authorMartin Schwenke <martin@meltin.net>
Sat, 30 Jul 2016 01:12:19 +0000 (11:12 +1000)
committerKarolin Seeger <kseeger@samba.org>
Tue, 13 Sep 2016 10:27:28 +0000 (12:27 +0200)
If RELEASE_IP fails then updating the VNN makes it inconsistent with
reality.  Instead, log the failure and move on to the next IP
address.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12158

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit ca22373231918dab4e94cf1bab03253aadd61993)

ctdb/server/ctdb_takeover.c

index e32dc1ac9c980625064e8625dca84c905ce62256..e37eb7a4ed538f59caf11ec200ef13639fabc955 100644 (file)
@@ -2369,9 +2369,21 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb)
                                    ctdb_vnn_iface_string(vnn)));
 
                ctdb_event_script_args(ctdb, CTDB_EVENT_RELEASE_IP, "%s %s %u",
-                                 ctdb_vnn_iface_string(vnn),
-                                 ctdb_addr_to_str(&vnn->public_address),
-                                 vnn->public_netmask_bits);
+                                      ctdb_vnn_iface_string(vnn),
+                                      ctdb_addr_to_str(&vnn->public_address),
+                                      vnn->public_netmask_bits);
+               /* releaseip timeouts are converted to success, so to
+                * detect failures just check if the IP address is
+                * still there...
+                */
+               if (ctdb_sys_have_ip(&vnn->public_address)) {
+                       DEBUG(DEBUG_ERR,
+                             (__location__
+                              " IP address %s not released\n",
+                              ctdb_addr_to_str(&vnn->public_address)));
+                       vnn->update_in_flight = false;
+                       continue;
+               }
 
                data.dptr = (uint8_t *)talloc_strdup(
                                vnn, ctdb_addr_to_str(&vnn->public_address));