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);
}
}
/*
- 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) {
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
*/
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);
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);
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));
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 */
/*
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;
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));
}
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));
}
{ "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>" },