ctdb-daemon: Free up record data if a call request is deferred
authorAmitay Isaacs <amitay@gmail.com>
Mon, 11 Sep 2017 05:59:19 +0000 (15:59 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 14 Sep 2017 12:49:15 +0000 (14:49 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13029

If a call request for a key (migration request) is in flight, then all
the subsequent call requests for the same key are deferred.  In that case,
the data corresponding to key read from the local tdb is useless and there
is no need to keep it around.  Once the deferred call is reprocessed,
the data corresponding to that key will be fetched again.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/server/ctdb_daemon.c

index 7fceed0a2393de983ebc760ae2ea97d360186d94..8ae43517a8563ea99e084f525e991b76bde9ef3c 100644 (file)
@@ -646,6 +646,7 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
                                DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
                        }
                        CTDB_DECREMENT_STAT(ctdb, pending_calls);
+                       talloc_free(data.dptr);
                        return;
                }
        }