test
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 26 Jun 2008 04:14:37 +0000 (14:14 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 26 Jun 2008 04:14:37 +0000 (14:14 +1000)
server/ctdb_freeze.c
server/ctdb_recover.c
server/ctdb_recoverd.c

index ba9e899b316f54c9f0dabfe473e0878033f980a2..47fb476b225799de3634fc52c7552687c251309f 100644 (file)
@@ -150,12 +150,13 @@ static struct ctdb_freeze_handle *ctdb_freeze_lock(struct ctdb_context *ctdb)
                        _exit(0);
                }
 
-               while (++count < 30) {
+               alarm(30);
+
+               while (count++ < 30) {
                        ret = write(fd[1], &ret, sizeof(ret));
                        if (ret == sizeof(ret)) {
                                break;
                        }
-
                        DEBUG(DEBUG_ERR, (__location__ " Failed to write to socket from freeze child. ret:%d errno:%u\n", ret, errno));
                        sleep (1);
                }
index 8ca3a8f70004f68f3fae3ce270c10cb8d76f936b..bef945193047cfe51cd0ed8647da3be236d652a8 100644 (file)
@@ -534,6 +534,12 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
        }
 
        /* some special handling when ending recovery mode */
+
+       /* force the databased to thaw */
+       if (ctdb->freeze_handle) {
+               ctdb_control_thaw(ctdb);
+       }
+
        state = talloc(ctdb, struct ctdb_set_recmode_state);
        CTDB_NO_MEMORY(ctdb, state);
 
index 6a0970f18bdd73f428f730b4273d40ccf1ea9f8d..76a6a122900cf185e4229f32866b42c5a6756300 100644 (file)
@@ -2842,7 +2842,7 @@ again:
        ret = update_flags_on_all_nodes(ctdb, nodemap);
        if (ret != 0) {
                DEBUG(DEBUG_ERR, (__location__ " Unable to update flags on all nodes\n"));
-               return -1;
+               goto again;
        }
 
        goto again;