From 9b907536fb657fa15c02858caf0ffff633ecd478 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 22 Jan 2014 13:30:47 +1100 Subject: ctdb/daemon: Make delete IP wait until the IP is released reloadips really expects deleted IPs to be released before completing. Otherwise the recovery daemon starts failing the local IP check. The races that follow can cause a node to be banned. To make the error handling simple, do the actual deletion in release_ip_callback(). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/include/ctdb_private.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ctdb/include/ctdb_private.h') diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index b95b2c7b84..8ed867d510 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -212,6 +212,11 @@ struct ctdb_vnn { /* Set to true any time an update to this VNN is in flight. This helps to avoid races. */ bool update_in_flight; + + /* If CTDB_CONTROL_DEL_PUBLIC_IP is received for this IP + * address then this flag is set. It will be deleted in the + * release IP callback. */ + bool delete_pending; }; /* @@ -1264,7 +1269,9 @@ int32_t ctdb_control_list_tunables(struct ctdb_context *ctdb, TDB_DATA *outdata) int32_t ctdb_control_try_delete_records(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DATA *outdata); int32_t ctdb_control_receive_records(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DATA *outdata); int32_t ctdb_control_add_public_address(struct ctdb_context *ctdb, TDB_DATA indata); -int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb, TDB_DATA indata); +int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb, + struct ctdb_req_control *c, + TDB_DATA recdata, bool *async_reply); void ctdb_tunables_set_defaults(struct ctdb_context *ctdb); -- cgit