1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

ctdb-takeover: Inform clients when dropping all IP addresses

CTDB releases all IPs in following cases: starting up, shutting down,
node gets banned, node does not come out of recovery for a long time.
Always inform samba when CTDB releases IP addresses.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-03-05 14:05:21 +11:00 committed by Martin Schwenke
parent b8272d835d
commit 00b9e76904

View File

@ -2353,6 +2353,7 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb)
{
struct ctdb_vnn *vnn;
int count = 0;
TDB_DATA data;
if (ctdb->tunable.disable_ip_failover == 1) {
return;
@ -2390,6 +2391,16 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb)
ctdb_vnn_iface_string(vnn),
ctdb_addr_to_str(&vnn->public_address),
vnn->public_netmask_bits);
data.dptr = (uint8_t *)talloc_strdup(
vnn, ctdb_addr_to_str(&vnn->public_address));
if (data.dptr != NULL) {
data.dsize = strlen((char *)data.dptr) + 1;
ctdb_daemon_send_message(ctdb, ctdb->pnn,
CTDB_SRVID_RELEASE_IP, data);
talloc_free(data.dptr);
}
ctdb_vnn_unassign_iface(ctdb, vnn);
vnn->update_in_flight = false;
count++;