test
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 26 Jun 2008 03:51:18 +0000 (13:51 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 26 Jun 2008 03:51:18 +0000 (13:51 +1000)
(This used to be ctdb commit f71287a28d66db202fe52f9a43b6daf2389d7f66)

ctdb/server/ctdb_freeze.c
ctdb/server/ctdb_recover.c

index ba9e899b316f54c9f0dabfe473e0878033f980a2..591b81ca407e70531d907edad1b506d521b30774 100644 (file)
@@ -150,13 +150,11 @@ static struct ctdb_freeze_handle *ctdb_freeze_lock(struct ctdb_context *ctdb)
                        _exit(0);
                }
 
-               while (++count < 30) {
+               while (count++ < 30) {
                        ret = write(fd[1], &ret, sizeof(ret));
-                       if (ret == sizeof(ret)) {
-                               break;
+                       if (ret != sizeof(ret)) {
+                               DEBUG(DEBUG_ERR, (__location__ " Failed to write to socket from freeze child. ret:%d errno:%u\n", ret, errno));
                        }
-
-                       DEBUG(DEBUG_ERR, (__location__ " Failed to write to socket from freeze child. ret:%d errno:%u\n", ret, errno));
                        sleep (1);
                }
                if (count >= 30) {
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);