mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
get rid of the control to set the monitoring mode.
monitoring should always be enabled (though a node may want to temporarily disable running the "monitor" event scripts but can do so internally without the need for this control) (This used to be ctdb commit e3a33618026823e6af845fd8513cddb08e6b5584)
This commit is contained in:
parent
192ba82b73
commit
0eb6c04dc1
@ -1931,29 +1931,6 @@ int ctdb_ctrl_getpnn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
set the monitoring mode of a remote node
|
||||
*/
|
||||
int ctdb_ctrl_setmonmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t monmode)
|
||||
{
|
||||
int ret;
|
||||
TDB_DATA data;
|
||||
int32_t res;
|
||||
|
||||
data.dsize = sizeof(uint32_t);
|
||||
data.dptr = (uint8_t *)&monmode;
|
||||
|
||||
ret = ctdb_control(ctdb, destnode, 0,
|
||||
CTDB_CONTROL_SET_MONMODE, 0, data,
|
||||
NULL, NULL, &res, &timeout, NULL);
|
||||
if (ret != 0 || res != 0) {
|
||||
DEBUG(0,(__location__ " ctdb_control for setmonmode failed\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
get the monitoring mode of a remote node
|
||||
*/
|
||||
|
@ -349,10 +349,6 @@ int ctdb_ctrl_setrecmode(struct ctdb_context *ctdb, struct timeval timeout, uint
|
||||
get the monitoring mode of a remote node
|
||||
*/
|
||||
int ctdb_ctrl_getmonmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *monmode);
|
||||
/*
|
||||
set the monitoringmode of a remote node
|
||||
*/
|
||||
int ctdb_ctrl_setmonmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t monmode);
|
||||
|
||||
/*
|
||||
get the recovery master of a remote node
|
||||
|
@ -452,7 +452,7 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS = 0,
|
||||
CTDB_CONTROL_GET_PNN = 35,
|
||||
CTDB_CONTROL_SHUTDOWN = 36,
|
||||
CTDB_CONTROL_GET_MONMODE = 37,
|
||||
CTDB_CONTROL_SET_MONMODE = 38,
|
||||
/* #38 removed */
|
||||
CTDB_CONTROL_MAX_RSN = 39,
|
||||
CTDB_CONTROL_SET_RSN_NONEMPTY = 40,
|
||||
CTDB_CONTROL_DELETE_LOW_RSN = 41,
|
||||
|
@ -223,15 +223,6 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
||||
CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));
|
||||
return ctdb_control_set_recmode(ctdb, c, indata, async_reply, errormsg);
|
||||
|
||||
case CTDB_CONTROL_SET_MONMODE:
|
||||
CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));
|
||||
if (*(uint32_t *)indata.dptr == CTDB_MONITORING_ACTIVE) {
|
||||
ctdb_start_monitoring(ctdb);
|
||||
} else {
|
||||
ctdb_stop_monitoring(ctdb);
|
||||
}
|
||||
return 0;
|
||||
|
||||
case CTDB_CONTROL_GET_MONMODE:
|
||||
return ctdb->monitoring_mode;
|
||||
|
||||
|
@ -753,29 +753,6 @@ static int control_getmonmode(struct ctdb_context *ctdb, int argc, const char **
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
set the monitoring mode of a remote node
|
||||
*/
|
||||
static int control_setmonmode(struct ctdb_context *ctdb, int argc, const char **argv)
|
||||
{
|
||||
uint32_t monmode;
|
||||
int ret;
|
||||
|
||||
if (argc < 1) {
|
||||
usage();
|
||||
}
|
||||
|
||||
monmode = strtoul(argv[0], NULL, 0);
|
||||
|
||||
ret = ctdb_ctrl_setmonmode(ctdb, TIMELIMIT(), options.pnn, monmode);
|
||||
if (ret != 0) {
|
||||
DEBUG(0, ("Unable to set monmode on node %u\n", options.pnn));
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
display remote list of keys/data for a db
|
||||
*/
|
||||
@ -1082,7 +1059,6 @@ static const struct {
|
||||
{ "getdbmap", control_getdbmap, true, "show the database map" },
|
||||
{ "catdb", control_catdb, true, "dump a database" , "<dbname>"},
|
||||
{ "getmonmode", control_getmonmode, true, "show monitoring mode" },
|
||||
{ "setmonmode", control_setmonmode, true, "set monitoring mode", "<0|1>" },
|
||||
{ "setdebug", control_setdebug, true, "set debug level", "<debuglevel>" },
|
||||
{ "getdebug", control_getdebug, true, "get debug level" },
|
||||
{ "attach", control_attach, true, "attach to a database", "<dbname>" },
|
||||
|
Loading…
x
Reference in New Issue
Block a user