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

add config option for disabling bans

(This used to be ctdb commit 153b911f7f957d4c564b04f5aa878033a02da9e4)
This commit is contained in:
Andrew Tridgell 2007-10-15 13:22:58 +10:00
parent 011a205b86
commit 174879621e
3 changed files with 8 additions and 1 deletions

View File

@ -87,6 +87,7 @@ struct ctdb_tunable {
uint32_t recovery_ban_period;
uint32_t database_hash_size;
uint32_t rerecovery_timeout;
uint32_t enable_bans;
};
/*

View File

@ -59,7 +59,7 @@ static void ctdb_unban_node(struct ctdb_recoverd *rec, uint32_t pnn)
struct ctdb_context *ctdb = rec->ctdb;
if (!ctdb_validate_pnn(ctdb, pnn)) {
DEBUG(0,("Bad pnn %u in ctdb_ban_node\n", pnn));
DEBUG(0,("Bad pnn %u in ctdb_unban_node\n", pnn));
return;
}
@ -99,6 +99,11 @@ static void ctdb_ban_node(struct ctdb_recoverd *rec, uint32_t pnn, uint32_t ban_
return;
}
if (0 == ctdb->tunable.enable_bans) {
DEBUG(0,("Bans are disabled - ignoring ban of node %u\n", pnn));
return;
}
if (pnn == ctdb->pnn) {
DEBUG(0,("self ban - lowering our election priority\n"));
/* banning ourselves - lower our election priority */

View File

@ -43,6 +43,7 @@ static const struct {
{ "RecoveryBanPeriod", 300, offsetof(struct ctdb_tunable, recovery_ban_period) },
{ "DatabaseHashSize", 10000, offsetof(struct ctdb_tunable, database_hash_size) },
{ "RerecoveryTimeout", 10, offsetof(struct ctdb_tunable, rerecovery_timeout) },
{ "EnableBans", 1, offsetof(struct ctdb_tunable, enable_bans) },
};
/*