From: Ronnie Sahlberg Date: Wed, 23 May 2007 22:08:45 +0000 (+1000) Subject: add a new command for ctdb_control to trigger a recovery X-Git-Tag: tevent-0.9.20~348^2~2694^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2aface246ef1250c97fa84eaf8bbab80ae9f35d8;p=thirdparty%2Fsamba.git add a new command for ctdb_control to trigger a recovery (This used to be ctdb commit 6da2a4ab1b9c955d55a1c6817506a74539623892) --- 2aface246ef1250c97fa84eaf8bbab80ae9f35d8 diff --cc ctdb/tools/ctdb_control.c index 992991c2324,fd564fda701..8b765fe1219 --- a/ctdb/tools/ctdb_control.c +++ b/ctdb/tools/ctdb_control.c @@@ -59,7 -59,8 +59,9 @@@ static void usage(void " setmonmode set monitoring mode\n" " attach attach a database\n" " getpid get the pid of a ctdb daemon\n" + " dumpmemory dump memory map to log\n" " shutdown shutdown a remote ctdb\n" ++ " recovery trigger a recovery\n" " freeze freeze a node\n" " thaw thaw a node\n" ); @@@ -372,6 -373,6 +374,28 @@@ static int control_shutdown(struct ctdb return 0; } ++/* ++ trigger a recovery ++ */ ++static int control_recovery(struct ctdb_context *ctdb, int argc, const char **argv) ++{ ++ int ret; ++ ++ ++ ret = ctdb_ctrl_freeze(ctdb, timeval_current_ofs(timelimit, 0), CTDB_CURRENT_NODE); ++ if (ret != 0) { ++ printf("Unable to freeze node\n"); ++ return ret; ++ } ++ ret = ctdb_ctrl_setrecmode(ctdb, timeval_current_ofs(timelimit, 0), CTDB_CURRENT_NODE, CTDB_RECOVERY_ACTIVE); ++ if (ret != 0) { ++ printf("Unable to set recovery mode\n"); ++ return ret; ++ } ++ ++ return 0; ++} ++ /* display recovery mode of a remote node */ @@@ -1055,6 -1056,6 +1079,7 @@@ int main(int argc, const char *argv[] { "dumpmemory", control_dumpmemory }, { "getpid", control_getpid }, { "shutdown", control_shutdown }, ++ { "recovery", control_recovery }, { "freeze", control_freeze }, { "thaw", control_thaw }, };