summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2010-11-10 14:47:28 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2010-11-10 14:55:25 +1100
commitdbcf0de18c16dfd41a363a77f84c52928261e89d (patch)
tree6775cbe3faa4611d59266a0c0a9bb1b7a1f9bd71
parent34958c284b29f02a4c4fb94025239a2488c0cb2a (diff)
downloadsamba-dbcf0de18c16dfd41a363a77f84c52928261e89d.tar.gz
samba-dbcf0de18c16dfd41a363a77f84c52928261e89d.tar.xz
samba-dbcf0de18c16dfd41a363a77f84c52928261e89d.zip
Dont exit the update ip function if the old and new interfaces are the same
since if they are the same for whatever reason this triggers the system to go into an infinite loop and is unrobust The scriptds have been changed instead to be able to cope with this situation for enhanced robustness During takeover_run and when merging all ip allocations across the cluster try to kepe track of when and which node currently hosts an ip address so that we avoid extra ip failovers between nodes (This used to be ctdb commit cf778b5aaf6356401e3985acccc7df9e08ab6930)
-rw-r--r--ctdb/server/ctdb_takeover.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index 27c9ac0723..d4958079d7 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -490,15 +490,6 @@ static int32_t ctdb_do_updateip(struct ctdb_context *ctdb,
return -1;
}
- if (vnn->iface == old) {
- DEBUG(DEBUG_ERR,("update of IP %s/%u trying to "
- "assin a same interface '%s'\n",
- ctdb_addr_to_str(&vnn->public_address),
- vnn->public_netmask_bits,
- old->name));
- return -1;
- }
-
state = talloc(vnn, struct ctdb_do_updateip_state);
CTDB_NO_MEMORY(ctdb, state);
@@ -610,7 +601,7 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
return -1;
}
- if (vnn->pnn != ctdb->pnn && have_ip) {
+ if (vnn->pnn != ctdb->pnn && have_ip && vnn->pnn != -1) {
DEBUG(DEBUG_CRIT,(__location__ " takeoverip of IP %s is known to the kernel, "
"and we have it on iface[%s], but it was assigned to node %d"
"and we are node %d, banning ourself\n",
@@ -896,7 +887,7 @@ static int ctdb_add_public_address(struct ctdb_context *ctdb,
vnn->public_netmask_bits = mask;
vnn->pnn = -1;
if (ctdb_sys_have_ip(addr)) {
- DEBUG(DEBUG_ERR,("We are already hosting public address '%s'\n", ctdb_addr_to_str(addr)));
+ DEBUG(DEBUG_ERR,("We are already hosting public address '%s'. setting PNN to ourself:%d\n", ctdb_addr_to_str(addr), ctdb->pnn));
vnn->pnn = ctdb->pnn;
}
@@ -1166,6 +1157,16 @@ static uint32_t *ip_key(ctdb_sock_addr *ip)
static void *add_ip_callback(void *parm, void *data)
{
+ struct ctdb_public_ip_list *this_ip = parm;
+ struct ctdb_public_ip_list *prev_ip = data;
+
+ if (prev_ip == NULL) {
+ return parm;
+ }
+ if (this_ip->pnn == -1) {
+ this_ip->pnn = prev_ip->pnn;
+ }
+
return parm;
}