ctdb-banning: Do not freeze databases on ban in the daemon
authorAmitay Isaacs <amitay@gmail.com>
Wed, 16 Sep 2015 08:20:31 +0000 (18:20 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 7 Oct 2015 12:53:27 +0000 (14:53 +0200)
Once the node is marked as banned, the recovery daemon on that node will
start freezing the databases anyway.  This check happens every second
in recovery daemon, so the delay in freezing the databases on ban would
be a second.

The main reason for freezing databases is to prevent any database access
from samba clients.  However, banning code also drops the public IPs
and thus disconnecting the clients.  In addition, the generation gets
set to INVALID_GENERATION, thus database record migration requests on
that node will not be processed.

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

index 91064b4c516bb49f787a1886f5aa16c16e47a088..92026fd83ff71dcef63b24488a4f0b302cd35684 100644 (file)
@@ -50,10 +50,7 @@ ctdb_ban_node_event(struct event_context *ev, struct timed_event *te,
 
 void ctdb_local_node_got_banned(struct ctdb_context *ctdb)
 {
-       uint32_t i;
-
-       /* make sure we are frozen */
-       DEBUG(DEBUG_NOTICE,("This node has been banned - forcing freeze and recovery\n"));
+       DEBUG(DEBUG_NOTICE,("This node has been banned - forcing recovery\n"));
 
        /* Reset the generation id to 1 to make us ignore any
           REQ/REPLY CALL/DMASTER someone sends to us.
@@ -62,10 +59,9 @@ void ctdb_local_node_got_banned(struct ctdb_context *ctdb)
        */
        ctdb->vnn_map->generation = INVALID_GENERATION;
 
+       /* make sure we get frozen */
        ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
-       for (i=1; i<=NUM_DB_PRIORITIES; i++) {
-               ctdb_start_freeze(ctdb, i);
-       }
+
        ctdb_release_all_ips(ctdb);
 }