------------------------------------------------------------ revno: 285 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell <[EMAIL PROTECTED]> branch nick: tridge timestamp: Sat 2007-05-12 15:59:49 +1000 message: - nicer message if freeze child dies - change local generation count after recovery/freeze started modified: common/ctdb_freeze.c ctdb_freeze.c-20070512051503-935zdtyuqknqnhmo-1 direct/ctdb_recoverd.c recoverd.c-20070503213540-bvxuyd9jm1f7ig90-1 === modified file 'common/ctdb_freeze.c' --- a/common/ctdb_freeze.c 2007-05-12 05:44:35 +0000 +++ b/common/ctdb_freeze.c 2007-05-12 05:59:49 +0000 @@ -82,6 +82,12 @@ int32_t status; struct ctdb_freeze_waiter *w; + if (h->ctdb->freeze_mode == CTDB_FREEZE_FROZEN) { + DEBUG(0,("freeze child died - unfreezing\n")); + talloc_free(h); + return; + } + if (read(h->fd, &status, sizeof(status)) != sizeof(status)) { DEBUG(0,("read error from freeze lock child\n")); status = -1;
=== modified file 'direct/ctdb_recoverd.c' --- a/direct/ctdb_recoverd.c 2007-05-12 05:15:27 +0000 +++ b/direct/ctdb_recoverd.c 2007-05-12 05:59:49 +0000 @@ -330,6 +330,13 @@ DEBUG(0, (__location__ " Recovery initiated\n")); + /* set recovery mode to active on all nodes */ + ret = set_recovery_mode(ctdb, nodemap, CTDB_RECOVERY_ACTIVE); + if (ret!=0) { + DEBUG(0, (__location__ " Unable to set recovery mode to active on cluster\n")); + return -1; + } + /* pick a new generation number */ generation = random(); @@ -350,15 +357,6 @@ return -1; } - - /* set recovery mode to active on all nodes */ - ret = set_recovery_mode(ctdb, nodemap, CTDB_RECOVERY_ACTIVE); - if (ret!=0) { - DEBUG(0, (__location__ " Unable to set recovery mode to active on cluster\n")); - return -1; - } - - /* get a list of all databases */ ret = ctdb_ctrl_getdbmap(ctdb, timeval_current_ofs(1, 0), vnn, mem_ctx, &dbmap); if (ret != 0) {