Revert "ctdb:recoverd: fix endless banning due to non-frozen DBs."
authorMichael Adam <obnox@samba.org>
Wed, 1 Jun 2016 02:23:52 +0000 (04:23 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 1 Jun 2016 02:23:52 +0000 (04:23 +0200)
This reverts commit da4e8d4f49e6a5177dcc26dc9107861ef5c3c564.

ctdb/server/ctdb_recoverd.c

index 001d32e19df4694817e3946b9254cb4086556eca..09940dc32f881b05a277b5299510fa9bf576e8f0 100644 (file)
@@ -3542,9 +3542,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
                        DEBUG(DEBUG_ERR,(__location__ " Failed to read recmode from local node\n"));
                }
                if (ctdb->recovery_mode == CTDB_RECOVERY_NORMAL) {
-                       DEBUG(DEBUG_ERR, ("Node is stopped or banned but "
-                             "recovery mode is not active. "
-                             "Activate recovery.\n"));
+                       DEBUG(DEBUG_ERR,("Node is stopped or banned but recovery mode is not active. Activate recovery mode and lock databases\n"));
 
                        ret = ctdb_ctrl_setrecmode(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, CTDB_RECOVERY_ACTIVE);
                        if (ret != 0) {
@@ -3552,20 +3550,11 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 
                                return;
                        }
-               }
-
-               /*
-                * Make sure that the databases get frozen or we will
-                * never come out of banning!
-                * We currently have no way of telling whether freezing
-                * has completed here in the recovery daemon, so we just
-                * send the freeze out unconditionally. A banned node
-                * does not have anything useful to do anyways...
-                */
-               ret = ctdb_ctrl_freeze(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE);
-               if (ret != 0) {
-                       DEBUG(DEBUG_ERR,(__location__ " Failed to freeze node in STOPPED or BANNED state\n"));
-                       return;
+                       ret = ctdb_ctrl_freeze(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE);
+                       if (ret != 0) {
+                               DEBUG(DEBUG_ERR,(__location__ " Failed to freeze node in STOPPED or BANNED state\n"));
+                               return;
+                       }
                }
 
                /* If this node is stopped or banned then it is not the recovery