From 44a0466ac1c69fe9f0734a6225c1a1a38e48299a Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 22 Nov 2013 13:57:03 +1100 Subject: [PATCH] ctdb-recoverd: Only respond to currently queued ipreallocated requests Otherwise new requests can come in during the latter parts of the takeover run when the IP allocation algorithm has already run, and the new requests will be dequeued even though they haven't really be processed. Signed-off-by: Martin Schwenke Pair-programmed-with: Amitay Isaacs Reviewed-by: Michael Adam --- ctdb/server/ctdb_recoverd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 70ed87e355a..c5cd36cfa92 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -2606,9 +2606,18 @@ static void process_ipreallocate_requests(struct ctdb_context *ctdb, TDB_DATA result; int32_t ret; uint32_t culprit; + struct srvid_requests *current; DEBUG(DEBUG_INFO, ("recovery master forced ip reallocation\n")); + /* Only process requests that are currently pending. More + * might come in while the takeover run is in progress and + * they will need to be processed later since they might + * be in response flag changes. + */ + current = rec->reallocate_requests; + rec->reallocate_requests = NULL; + /* update the list of public ips that a node can handle for all connected nodes */ @@ -2629,7 +2638,7 @@ static void process_ipreallocate_requests(struct ctdb_context *ctdb, result.dsize = sizeof(int32_t); result.dptr = (uint8_t *)&ret; - srvid_requests_reply(ctdb, &rec->reallocate_requests, result); + srvid_requests_reply(ctdb, ¤t, result); } -- 2.11.4.GIT