------------------------------------------------------------
revno: 337
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Thu 2007-05-24 10:10:02 +1000
message:
  merge from ronnie
modified:
  tools/ctdb_control.c           
ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1
    ------------------------------------------------------------
    revno: 326.1.5
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-24 08:08:45 +1000
    message:
      add a new command for ctdb_control to trigger a recovery
    ------------------------------------------------------------
    revno: 326.1.4
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-24 07:33:04 +1000
    message:
      merge from tridge
=== modified file 'tools/ctdb_control.c'
--- a/tools/ctdb_control.c      2007-05-23 10:06:37 +0000
+++ b/tools/ctdb_control.c      2007-05-23 22:08:45 +0000
@@ -61,6 +61,7 @@
                "  getpid <vnn>                       get the pid of a ctdb 
daemon\n"
                "  dumpmemory <vnn|all>               dump memory map to log\n"
                "  shutdown <vnn>                     shutdown a remote ctdb\n"
+               "  recovery <vnn>                     trigger a recovery\n"
                "  freeze <vnn|all>                   freeze a node\n"
                "  thaw <vnn|all>                     thaw a node\n"
        );
@@ -374,6 +375,28 @@
 }
 
 /*
+  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
  */
 static int control_getrecmode(struct ctdb_context *ctdb, int argc, const char 
**argv)
@@ -1056,6 +1079,7 @@
                { "dumpmemory", control_dumpmemory },
                { "getpid", control_getpid },
                { "shutdown", control_shutdown },
+               { "recovery", control_recovery },
                { "freeze", control_freeze },
                { "thaw", control_thaw },
        };

Reply via email to