ctdb-takeover: Don't release IPs from nodes where they are not known
authorMartin Schwenke <martin@meltin.net>
Tue, 7 Feb 2017 04:30:08 +0000 (15:30 +1100)
committerMartin Schwenke <martins@samba.org>
Fri, 24 Feb 2017 10:50:36 +0000 (11:50 +0100)
This avoids confusing log messages like:

  ctdbd[21635]: releaseip called for an ip '10.1.1.1' that is not a public address

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Feb 24 11:50:36 CET 2017 on sn-devel-144

ctdb/server/ctdb_takeover_helper.c
ctdb/tests/takeover_helper/031.sh

index af8656900e7998b5ce5fcc9e92519edc0bc0627f..5efd61983940bcd56e26f64c4c83a71b43b3fd4d 100644 (file)
@@ -301,6 +301,12 @@ static struct tevent_req *release_ip_send(TALLOC_CTX *mem_ctx,
 
                for (i = 0; i < count; i++) {
                        uint32_t pnn = pnns[i];
+
+                       /* Skip this node if IP is not known */
+                       if (! bitmap_query(tmp_ip->known_on, pnn)) {
+                               continue;
+                       }
+
                        /* If pnn is not the node that should be
                         * hosting the IP then add it to the list of
                         * nodes that need to do a release. */
index 435cd499d6f8946dacdabad8220656b40a23c83f..13005ee538bfb4fdef01330ebb2f83c3bdaa3361 100755 (executable)
@@ -33,10 +33,10 @@ Fetched public IPs from node 2
  10.0.0.33 -> 2 [+0]
  10.0.0.31 -> 0 [+14884]
  10.0.0.32 -> 2 [+16129]
-RELEASE_IP 10.0.0.34 succeeded on 2 nodes
-RELEASE_IP 10.0.0.33 succeeded on 2 nodes
-RELEASE_IP 10.0.0.32 succeeded on 2 nodes
-RELEASE_IP 10.0.0.31 succeeded on 2 nodes
+RELEASE_IP 10.0.0.34 succeeded on 1 nodes
+RELEASE_IP 10.0.0.33 succeeded on 1 nodes
+RELEASE_IP 10.0.0.32 succeeded on 1 nodes
+RELEASE_IP 10.0.0.31 succeeded on 1 nodes
 TAKEOVER_IP 10.0.0.34 succeeded on node 0
 TAKEOVER_IP 10.0.0.33 succeeded on node 2
 TAKEOVER_IP 10.0.0.32 succeeded on node 2