return 0;
}
+
+/*
+ get the name of the reclock file
+ */
+int ctdb_ctrl_getreclock(struct ctdb_context *ctdb, struct timeval timeout,
+ uint32_t destnode, TALLOC_CTX *mem_ctx,
+ const char **name)
+{
+ int ret;
+ int32_t res;
+ TDB_DATA data;
+
+ ret = ctdb_control(ctdb, destnode, 0,
+ CTDB_CONTROL_GET_RECLOCK_FILE, 0, tdb_null,
+ mem_ctx, &data, &res, &timeout, NULL);
+ if (ret != 0 || res != 0) {
+ return -1;
+ }
+
+ *name = discard_const(data.dptr);
+
+ return 0;
+}
CTDB_CONTROL_GET_EVENT_SCRIPT_STATUS = 96,
CTDB_CONTROL_TRAVERSE_KILL = 97,
CTDB_CONTROL_RECD_RECLOCK_LATENCY = 98,
+ CTDB_CONTROL_GET_RECLOCK_FILE = 99,
};
/*
CHECK_CONTROL_DATA_SIZE(sizeof(double));
ctdb_reclock_latency(ctdb, "recd reclock", &ctdb->statistics.reclock.recd, *((double *)indata.dptr));
return 0;
+ case CTDB_CONTROL_GET_RECLOCK_FILE:
+ CHECK_CONTROL_DATA_SIZE(0);
+ if (ctdb->recovery_lock_file != NULL) {
+ outdata->dptr = discard_const(ctdb->recovery_lock_file);
+ outdata->dsize = strlen(ctdb->recovery_lock_file) + 1;
+ }
+ return 0;
default:
DEBUG(DEBUG_CRIT,(__location__ " Unknown CTDB control opcode %u\n", opcode));
return -1;
return 0;
}
+/*
+ display reclock file of a node
+ */
+static int control_getreclock(struct ctdb_context *ctdb, int argc, const char **argv)
+{
+ int ret;
+ const char *reclock;
+
+ ret = ctdb_ctrl_getreclock(ctdb, TIMELIMIT(), options.pnn, ctdb, &reclock);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR, ("Unable to get reclock file from node %u\n", options.pnn));
+ return ret;
+ } else {
+ if (reclock == NULL) {
+ printf("No reclock file used.\n");
+ } else {
+ printf("Reclock file:%s\n", reclock);
+ }
+ }
+ return 0;
+}
/*
set debug level on a node or all nodes
{ "scriptstatus", control_scriptstatus, false, false, "show the status of the monitoring scripts"},
{ "natgwlist", control_natgwlist, false, false, "show the nodes belonging to this natgw configuration"},
{ "xpnn", control_xpnn, true, true, "find the pnn of the local node without talking to the daemon (unreliable)" },
+ { "getreclock", control_getreclock, false, false, "Show the reclock file of a node"},
};
/*