mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
ctdb-recoverd: Drop function unban_all_nodes()
It hasn't worked since commit cda5f02c7c
in 2009, which reworked the banning code. Since then
ctdb_control_modflags() has contained a comment saying:
/* we don't let other nodes modify our BANNED status */
Unbanning all nodes originally occurred here when the recovery master
role moved to a new node. The logic could have been meant for the
case when the old recovery master was malfunctioning, so got banned.
If any other nodes had been banned by this recovery master then they
would be unbanned. However, this would also unban the old recovery
master, which is probably suboptimal. The logic would also trigger if
a node was banned for a good reason and then the recovery master was
stopped. So, apart from doing nothing, the logic is too simplistic so
might as well be removed.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
ad6685847b
commit
bd7c94d5ac
@ -2344,37 +2344,6 @@ static int send_election_request(struct ctdb_recoverd *rec, uint32_t pnn)
|
||||
return ctdb_client_send_message(ctdb, CTDB_BROADCAST_ALL, srvid, election_data);
|
||||
}
|
||||
|
||||
/*
|
||||
this function will unban all nodes in the cluster
|
||||
*/
|
||||
static void unban_all_nodes(struct ctdb_context *ctdb)
|
||||
{
|
||||
int ret, i;
|
||||
struct ctdb_node_map_old *nodemap;
|
||||
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
|
||||
|
||||
ret = ctdb_ctrl_getnodemap(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, tmp_ctx, &nodemap);
|
||||
if (ret != 0) {
|
||||
DEBUG(DEBUG_ERR,(__location__ " failed to get nodemap to unban all nodes\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0;i<nodemap->num;i++) {
|
||||
if ( (!(nodemap->nodes[i].flags & NODE_FLAGS_DISCONNECTED))
|
||||
&& (nodemap->nodes[i].flags & NODE_FLAGS_BANNED) ) {
|
||||
ret = ctdb_ctrl_modflags(ctdb, CONTROL_TIMEOUT(),
|
||||
nodemap->nodes[i].pnn, 0,
|
||||
NODE_FLAGS_BANNED);
|
||||
if (ret != 0) {
|
||||
DEBUG(DEBUG_ERR, (__location__ " failed to reset ban state\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
talloc_free(tmp_ctx);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
we think we are winning the election - send a broadcast election request
|
||||
*/
|
||||
@ -2725,7 +2694,6 @@ static void election_handler(uint64_t srvid, TDB_DATA data, void *private_data)
|
||||
timeval_current_ofs(0, 500000),
|
||||
election_send_request, rec);
|
||||
}
|
||||
/*unban_all_nodes(ctdb);*/
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2735,7 +2703,6 @@ static void election_handler(uint64_t srvid, TDB_DATA data, void *private_data)
|
||||
/* Release the recovery lock file */
|
||||
if (ctdb_recovery_have_lock(ctdb)) {
|
||||
ctdb_recovery_unlock(ctdb);
|
||||
unban_all_nodes(ctdb);
|
||||
}
|
||||
|
||||
clear_ip_assignment_tree(ctdb);
|
||||
|
Loading…
Reference in New Issue
Block a user