diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-12-02 12:58:03 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-12-16 08:08:32 +0100 |
commit | fb50e08942f96b066449ee7c4e33cd73f6fcfcd7 (patch) | |
tree | a74266920e06f772b81a8c39b36e557707f4fb63 | |
parent | c56ce3d2f2a29fa5a888a69d7ab9beff02107f1a (diff) | |
download | samba-fb50e08942f96b066449ee7c4e33cd73f6fcfcd7.tar.gz samba-fb50e08942f96b066449ee7c4e33cd73f6fcfcd7.tar.xz samba-fb50e08942f96b066449ee7c4e33cd73f6fcfcd7.zip |
tools/ctdb: let "ctdb restoredb" and "ctdb wipedb" mark the db as healthy on all
nodes
metze
(This used to be ctdb commit d1b10b0c0c323c39742a18e98a1dab7e82ddc7be)
-rw-r--r-- | ctdb/tools/ctdb.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 937b544de6..e6ce72b217 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -3407,6 +3407,22 @@ static int control_restoredb(struct ctdb_context *ctdb, int argc, const char **a return -1; } + data.dptr = (void *)&ctdb_db->db_id; + data.dsize = sizeof(ctdb_db->db_id); + + /* mark the database as healthy */ + nodes = list_of_active_nodes(ctdb, nodemap, tmp_ctx, true); + if (ctdb_client_async_control(ctdb, CTDB_CONTROL_DB_SET_HEALTHY, + nodes, 0, + TIMELIMIT(), false, data, + NULL, NULL, + NULL) != 0) { + DEBUG(DEBUG_ERR, ("Failed to mark database as healthy.\n")); + ctdb_ctrl_setrecmode(ctdb, TIMELIMIT(), options.pnn, CTDB_RECOVERY_ACTIVE); + talloc_free(tmp_ctx); + return -1; + } + data.dptr = (void *)&generation; data.dsize = sizeof(generation); @@ -3571,6 +3587,22 @@ static int control_wipedb(struct ctdb_context *ctdb, int argc, return -1; } + data.dptr = (void *)&ctdb_db->db_id; + data.dsize = sizeof(ctdb_db->db_id); + + /* mark the database as healthy */ + nodes = list_of_active_nodes(ctdb, nodemap, tmp_ctx, true); + if (ctdb_client_async_control(ctdb, CTDB_CONTROL_DB_SET_HEALTHY, + nodes, 0, + TIMELIMIT(), false, data, + NULL, NULL, + NULL) != 0) { + DEBUG(DEBUG_ERR, ("Failed to mark database as healthy.\n")); + ctdb_ctrl_setrecmode(ctdb, TIMELIMIT(), options.pnn, CTDB_RECOVERY_ACTIVE); + talloc_free(tmp_ctx); + return -1; + } + data.dptr = (void *)&generation; data.dsize = sizeof(generation); |