1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

banning: Make ctdb_local_node_got_banned() a void function

When this function is called, we are already committed to banning
and there is no point in failing this function.  In case, freezing of
databases fails, it will be fixed from recovery daemon.

(This used to be ctdb commit bb178338658b4ae32382a1f62f7c21cee1d4878f)
This commit is contained in:
Amitay Isaacs 2013-06-28 14:04:18 +10:00
parent cf1d4bfde3
commit c6914e3891
3 changed files with 4 additions and 6 deletions

View File

@ -1440,7 +1440,7 @@ int ctdb_vacuum_init(struct ctdb_db_context *ctdb_db);
int32_t ctdb_control_enable_script(struct ctdb_context *ctdb, TDB_DATA indata);
int32_t ctdb_control_disable_script(struct ctdb_context *ctdb, TDB_DATA indata);
int32_t ctdb_local_node_got_banned(struct ctdb_context *ctdb);
void ctdb_local_node_got_banned(struct ctdb_context *ctdb);
int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata);
int32_t ctdb_control_get_ban_state(struct ctdb_context *ctdb, TDB_DATA *outdata);
int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata);

View File

@ -41,7 +41,7 @@ ctdb_ban_node_event(struct event_context *ev, struct timed_event *te,
}
}
int32_t ctdb_local_node_got_banned(struct ctdb_context *ctdb)
void ctdb_local_node_got_banned(struct ctdb_context *ctdb)
{
uint32_t i;
@ -60,8 +60,6 @@ int32_t ctdb_local_node_got_banned(struct ctdb_context *ctdb)
}
ctdb_release_all_ips(ctdb);
ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
return 0;
}
int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
@ -123,7 +121,7 @@ int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
event_add_timed(ctdb->ev, ctdb->banning_ctx, timeval_current_ofs(bantime->time,0), ctdb_ban_node_event, ctdb);
if (bantime->pnn == ctdb->pnn) {
return ctdb_local_node_got_banned(ctdb);
ctdb_local_node_got_banned(ctdb);
}
return 0;

View File

@ -491,7 +491,7 @@ int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata)
/* if we have become banned, we should go into recovery mode */
if ((node->flags & NODE_FLAGS_BANNED) && !(c->old_flags & NODE_FLAGS_BANNED) && (node->pnn == ctdb->pnn)) {
return ctdb_local_node_got_banned(ctdb);
ctdb_local_node_got_banned(ctdb);
}
return 0;