Revert "uptade the freeze/thaw commands to be able to send the requested database...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 13 Oct 2009 09:55:43 +0000 (20:55 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 13 Oct 2009 09:55:43 +0000 (20:55 +1100)
This reverts commit a92210bc9572851df327862b325376d56470823c.

client/ctdb_client.c
include/ctdb.h
include/ctdb_private.h
server/ctdb_control.c
server/ctdb_freeze.c
tools/ctdb.c

index b27086b579e463d168beed2aeb6c8cf9eb651b0d..7ca589703c8c399baade1e5c0ff1a6ec5ceab1f4 100644 (file)
@@ -1943,9 +1943,9 @@ int ctdb_ctrl_getpid(struct ctdb_context *ctdb, struct timeval timeout, uint32_t
   async freeze send control
  */
 struct ctdb_client_control_state *
-ctdb_ctrl_freeze_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode, uint32_t priority)
+ctdb_ctrl_freeze_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode)
 {
-       return ctdb_control_send(ctdb, destnode, priority
+       return ctdb_control_send(ctdb, destnode, 0
                           CTDB_CONTROL_FREEZE, 0, tdb_null, 
                           mem_ctx, &timeout, NULL);
 }
@@ -1968,36 +1968,30 @@ int ctdb_ctrl_freeze_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct
 }
 
 /*
-  freeze databases of a certain priority
+  freeze a node
  */
-int ctdb_ctrl_freeze_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t priority)
+int ctdb_ctrl_freeze(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
 {
        TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
        struct ctdb_client_control_state *state;
        int ret;
 
-       state = ctdb_ctrl_freeze_send(ctdb, tmp_ctx, timeout, destnode, priority);
+       state = ctdb_ctrl_freeze_send(ctdb, tmp_ctx, timeout, destnode);
        ret = ctdb_ctrl_freeze_recv(ctdb, tmp_ctx, state);
        talloc_free(tmp_ctx);
 
        return ret;
 }
 
-/* Freeze all databases */
-int ctdb_ctrl_freeze(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
-{
-       return ctdb_ctrl_freeze_priority(ctdb, timeout, destnode, 0);
-}
-
 /*
-  thaw databases of a certain priority
+  thaw a node
  */
-int ctdb_ctrl_thaw_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t priority)
+int ctdb_ctrl_thaw(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
 {
        int ret;
        int32_t res;
 
-       ret = ctdb_control(ctdb, destnode, priority
+       ret = ctdb_control(ctdb, destnode, 0
                           CTDB_CONTROL_THAW, 0, tdb_null, 
                           NULL, NULL, &res, &timeout, NULL);
        if (ret != 0 || res != 0) {
@@ -2008,12 +2002,6 @@ int ctdb_ctrl_thaw_priority(struct ctdb_context *ctdb, struct timeval timeout, u
        return 0;
 }
 
-/* thaw all databases */
-int ctdb_ctrl_thaw(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
-{
-       return ctdb_ctrl_thaw_priority(ctdb, timeout, destnode, 0);
-}
-
 /*
   get pnn of a node, or -1
  */
index 34d30805ba52dea5430a3532ed5fa2562ee5140a..5f1699024ef1e078fb9f7a09a48a1ccf034ffa0e 100644 (file)
@@ -453,18 +453,14 @@ int ctdb_ctrl_getpid(struct ctdb_context *ctdb, struct timeval timeout, uint32_t
 
 int ctdb_ctrl_freeze(struct ctdb_context *ctdb, struct timeval timeout, 
                        uint32_t destnode);
-int ctdb_ctrl_freeze_priority(struct ctdb_context *ctdb, struct timeval timeout, 
-                             uint32_t destnode, uint32_t priority);
 
 struct ctdb_client_control_state *
 ctdb_ctrl_freeze_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, 
-                     struct timeval timeout, uint32_t destnode,
-                     uint32_t priority);
+                       struct timeval timeout, uint32_t destnode);
 
 int ctdb_ctrl_freeze_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, 
                        struct ctdb_client_control_state *state);
 
-int ctdb_ctrl_thaw_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t priority);
 int ctdb_ctrl_thaw(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
 
 int ctdb_ctrl_getpnn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
index 774a36603061e088b3534f11d4fb524bba5063e9..da6a40632333530559fb12e147b08afb26c53ef9 100644 (file)
@@ -1172,7 +1172,7 @@ void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_contr
                                TDB_DATA *outdata, int32_t status, const char *errormsg);
 
 int32_t ctdb_control_freeze(struct ctdb_context *ctdb, struct ctdb_req_control *c, bool *async_reply);
-int32_t ctdb_control_thaw(struct ctdb_context *ctdb, struct ctdb_req_control *c);
+int32_t ctdb_control_thaw(struct ctdb_context *ctdb);
 
 int ctdb_start_recoverd(struct ctdb_context *ctdb);
 void ctdb_stop_recoverd(struct ctdb_context *ctdb);
index 2f0b94072a04376cbeb38ea0ef34a8079fa3ce82..997b100f49e7bdd02e38ab353544576c11ef518b 100644 (file)
@@ -249,7 +249,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
 
        case CTDB_CONTROL_THAW:
                CHECK_CONTROL_DATA_SIZE(0);
-               return ctdb_control_thaw(ctdb, c);
+               return ctdb_control_thaw(ctdb);
 
        case CTDB_CONTROL_SET_RECMODE:
                CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));              
index ed0bbe8d6cb64e60b1c2668ba8039d7712598264..c9499c85a13c23ea0052485a582b3fbb0a72bd33 100644 (file)
@@ -243,9 +243,6 @@ void ctdb_start_freeze(struct ctdb_context *ctdb)
 int32_t ctdb_control_freeze(struct ctdb_context *ctdb, struct ctdb_req_control *c, bool *async_reply)
 {
        struct ctdb_freeze_waiter *w;
-       uint32_t priority;
-
-       priority = (uint32_t)c->srvid;
 
        if (ctdb->freeze_mode == CTDB_FREEZE_FROZEN) {
                /* we're already frozen */
@@ -289,12 +286,8 @@ bool ctdb_blocking_freeze(struct ctdb_context *ctdb)
 /*
   thaw the databases
  */
-int32_t ctdb_control_thaw(struct ctdb_context *ctdb, struct ctdb_req_control *c)
+int32_t ctdb_control_thaw(struct ctdb_context *ctdb)
 {
-       uint32_t priority;
-
-       priority = (uint32_t)c->srvid;
-
        /* cancel any pending transactions */
        if (ctdb->freeze_handle && ctdb->freeze_handle->transaction_started) {
                struct ctdb_db_context *ctdb_db;
index fc1dda8643924617c0c2b553fa29b45f116e96fb..6f4725f9460c1be872d1b0c63faa220b8cb2ff9c 100644 (file)
@@ -2250,16 +2250,8 @@ static int control_setdebug(struct ctdb_context *ctdb, int argc, const char **ar
 static int control_freeze(struct ctdb_context *ctdb, int argc, const char **argv)
 {
        int ret;
-       uint32_t priority;
-       
-       if (argc == 1) {
-               priority = strtol(argv[0], NULL, 0);
-       } else {
-               priority = 0;
-       }
-       DEBUG(DEBUG_ERR,("Freeze by priority %u\n", priority));
 
-       ret = ctdb_ctrl_freeze_priority(ctdb, TIMELIMIT(), options.pnn, priority);
+       ret = ctdb_ctrl_freeze(ctdb, TIMELIMIT(), options.pnn);
        if (ret != 0) {
                DEBUG(DEBUG_ERR, ("Unable to freeze node %u\n", options.pnn));
        }               
@@ -2272,16 +2264,8 @@ static int control_freeze(struct ctdb_context *ctdb, int argc, const char **argv
 static int control_thaw(struct ctdb_context *ctdb, int argc, const char **argv)
 {
        int ret;
-       uint32_t priority;
-       
-       if (argc == 1) {
-               priority = strtol(argv[0], NULL, 0);
-       } else {
-               priority = 0;
-       }
-       DEBUG(DEBUG_ERR,("Thaw by priority %u\n", priority));
 
-       ret = ctdb_ctrl_thaw_priority(ctdb, TIMELIMIT(), options.pnn, priority);
+       ret = ctdb_ctrl_thaw(ctdb, TIMELIMIT(), options.pnn);
        if (ret != 0) {
                DEBUG(DEBUG_ERR, ("Unable to thaw node %u\n", options.pnn));
        }               
@@ -2943,8 +2927,8 @@ static const struct {
        { "unban",           control_unban,             true,   false,  "unban a node from the cluster" },
        { "shutdown",        control_shutdown,          true,   false,  "shutdown ctdbd" },
        { "recover",         control_recover,           true,   false,  "force recovery" },
-       { "freeze",          control_freeze,            true,   false,  "freeze databases", "[priority:1-3]" },
-       { "thaw",            control_thaw,              true,   false,  "thaw databases", "[priority:1-3]" },
+       { "freeze",          control_freeze,            true,   false,  "freeze all databases" },
+       { "thaw",            control_thaw,              true,   false,  "thaw all databases" },
        { "isnotrecmaster",  control_isnotrecmaster,    false,  false,  "check if the local node is recmaster or not" },
        { "killtcp",         kill_tcp,                  false,  false, "kill a tcp connection.", "<srcip:port> <dstip:port>" },
        { "gratiousarp",     control_gratious_arp,      false,  false, "send a gratious arp", "<ip> <interface>" },