ctdb-daemon: Don't delete connection information for released IP
authorMartin Schwenke <martin@meltin.net>
Thu, 21 May 2015 14:13:48 +0000 (00:13 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 4 Dec 2015 08:17:17 +0000 (09:17 +0100)
As per the comment:

  If the IP address is hosted on this node then remove the connection.

  Otherwise this function has been called because the server IP
  address has been released to another node and the client has exited.
  This means that we should not delete the connection information.
  The takeover node processes connections too.

This doesn't matter at the moment, since the empty connection list for
an IP address that has been released will never be pushed to another
node.  However, it matters if the connection information is stored in
a real replicated database.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_takeover.c

index 9816d6a48cbf336773c15f84b7544f2b20b8977e..dd06de3257c5026e0d2996dfb49d942f32f01f67 100644 (file)
@@ -3188,7 +3188,17 @@ void ctdb_takeover_client_destructor_hook(struct ctdb_client *client)
                        continue;
                }
 
-               ctdb_remove_connection(vnn, conn);
+               /* If the IP address is hosted on this node then
+                * remove the connection. */
+               if (vnn->pnn == client->ctdb->pnn) {
+                       ctdb_remove_connection(vnn, conn);
+               }
+
+               /* Otherwise this function has been called because the
+                * server IP address has been released to another node
+                * and the client has exited.  This means that we
+                * should not delete the connection information.  The
+                * takeover node processes connections too. */
        }
 }