1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

- nicer message if freeze child dies

- change local generation count after recovery/freeze started

(This used to be ctdb commit d9768142797f083a8c09b55d6a8a93cc12089348)
This commit is contained in:
Andrew Tridgell 2007-05-12 15:59:49 +10:00
parent 2c90d9e794
commit 7dcf82cda4
2 changed files with 13 additions and 9 deletions

View File

@ -82,6 +82,12 @@ static void ctdb_freeze_lock_handler(struct event_context *ev, struct fd_event *
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;

View File

@ -330,6 +330,13 @@ static int do_recovery(struct ctdb_context *ctdb, struct event_context *ev,
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 @@ static int do_recovery(struct ctdb_context *ctdb, struct event_context *ev,
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) {