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)
committerStefan Metzmacher <metze@samba.org>
Sat, 16 Sep 2017 07:24:13 +0000 (09:24 +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>
(cherry picked from commit 77c17b03cfc4734142fd86ba3cdd9663e75f34e3)

ctdb/server/ctdb_daemon.c

index 7f088f037e8eb957ba02e763ed69fffeed4ff33e..90f0e546831a0ca5034e615eb0e70c4bc09f7d42 100644 (file)
@@ -676,6 +676,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;
                }
        }