mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
ctdb-daemon: Drop implementation of {GET,SET}_RECMASTER controls
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
193b624d26
commit
a76374070d
@ -299,7 +299,6 @@ struct ctdb_context {
|
||||
struct ctdb_statistics statistics_history[MAX_STAT_HISTORY];
|
||||
struct ctdb_vnn_map *vnn_map;
|
||||
uint32_t num_clients;
|
||||
uint32_t recovery_master;
|
||||
struct ctdb_client_ip *client_ip_list;
|
||||
bool do_checkpublicip;
|
||||
bool do_setsched;
|
||||
@ -825,8 +824,6 @@ int32_t ctdb_control_get_capabilities(struct ctdb_context *ctdb,
|
||||
TDB_DATA *outdata);
|
||||
|
||||
int32_t ctdb_control_recd_ping(struct ctdb_context *ctdb);
|
||||
int32_t ctdb_control_set_recmaster(struct ctdb_context *ctdb,
|
||||
uint32_t opcode, TDB_DATA indata);
|
||||
|
||||
void ctdb_node_become_inactive(struct ctdb_context *ctdb);
|
||||
|
||||
|
@ -332,12 +332,11 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
||||
return ctdb->recovery_mode;
|
||||
}
|
||||
|
||||
case CTDB_CONTROL_SET_RECMASTER: {
|
||||
return ctdb_control_set_recmaster(ctdb, opcode, indata);
|
||||
}
|
||||
case CTDB_CONTROL_SET_RECMASTER:
|
||||
return control_not_implemented("SET_RECMASTER", NULL);
|
||||
|
||||
case CTDB_CONTROL_GET_RECMASTER:
|
||||
return ctdb->recovery_master;
|
||||
return control_not_implemented("GET_RECMASTER", NULL);
|
||||
|
||||
case CTDB_CONTROL_GET_PID:
|
||||
return getpid();
|
||||
|
@ -1179,31 +1179,6 @@ int32_t ctdb_control_recd_ping(struct ctdb_context *ctdb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int32_t ctdb_control_set_recmaster(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA indata)
|
||||
{
|
||||
uint32_t new_recmaster;
|
||||
|
||||
CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));
|
||||
new_recmaster = ((uint32_t *)(&indata.dptr[0]))[0];
|
||||
|
||||
if (ctdb->pnn != new_recmaster && ctdb->recovery_master == ctdb->pnn) {
|
||||
DEBUG(DEBUG_ERR,
|
||||
("Remote node (%u) is now the recovery master\n",
|
||||
new_recmaster));
|
||||
}
|
||||
|
||||
if (ctdb->pnn == new_recmaster && ctdb->recovery_master != new_recmaster) {
|
||||
DEBUG(DEBUG_ERR,
|
||||
("This node (%u) is now the recovery master\n",
|
||||
ctdb->pnn));
|
||||
}
|
||||
|
||||
ctdb->recovery_master = new_recmaster;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ctdb_node_become_inactive(struct ctdb_context *ctdb)
|
||||
{
|
||||
struct ctdb_db_context *ctdb_db;
|
||||
|
@ -121,7 +121,6 @@ static struct ctdb_context *ctdb_init(struct tevent_context *ev)
|
||||
gettimeofday(&ctdb->last_recovery_finished, NULL);
|
||||
|
||||
ctdb->recovery_mode = CTDB_RECOVERY_NORMAL;
|
||||
ctdb->recovery_master = (uint32_t)-1;
|
||||
|
||||
ctdb->upcalls = &ctdb_upcalls;
|
||||
|
||||
|
@ -2173,23 +2173,6 @@ static void control_get_pid(TALLOC_CTX *mem_ctx,
|
||||
client_send_control(req, header, &reply);
|
||||
}
|
||||
|
||||
static void control_get_recmaster(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_req *req,
|
||||
struct ctdb_req_header *header,
|
||||
struct ctdb_req_control *request)
|
||||
{
|
||||
struct client_state *state = tevent_req_data(
|
||||
req, struct client_state);
|
||||
struct ctdbd_context *ctdb = state->ctdb;
|
||||
struct ctdb_reply_control reply;
|
||||
|
||||
reply.rdata.opcode = request->opcode;
|
||||
reply.status = ctdb->node_map->recmaster;
|
||||
reply.errmsg = NULL;
|
||||
|
||||
client_send_control(req, header, &reply);
|
||||
}
|
||||
|
||||
static void control_get_pnn(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_req *req,
|
||||
struct ctdb_req_header *header,
|
||||
@ -4177,10 +4160,6 @@ static void client_process_control(struct tevent_req *req,
|
||||
control_get_pid(mem_ctx, req, &header, &request);
|
||||
break;
|
||||
|
||||
case CTDB_CONTROL_GET_RECMASTER:
|
||||
control_get_recmaster(mem_ctx, req, &header, &request);
|
||||
break;
|
||||
|
||||
case CTDB_CONTROL_GET_PNN:
|
||||
control_get_pnn(mem_ctx, req, &header, &request);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user