diff options
author | Poornima G <pgurusid@redhat.com> | 2016-06-05 00:06:11 -0400 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-06-10 04:03:40 -0700 |
commit | 3bc419d8014877f64e57dc3368b0609396ec0d12 (patch) | |
tree | 54b658168400585a1e6d9848c6355d462603a9c2 /xlators/protocol | |
parent | a837357c5c7873bf19155e76bf6c251fa799a605 (diff) |
protocol: Add framework to send transaction id with recall
Issue:
The upcall(cache invalidation/recall) event is sent from the bricks
to clients. In AFR/EC setup, it can so happen that all the bricks
will send the upcall for the same event, and if AFR/EC doesn't filter
out these duplicate notifications, the logic above cluster xlators
can fail.
Solution:
Use transaction id to filter out duplicate notifications.
This patch adds framework for duplicate notifications.
AFR/EC can build up on this patch for deduping the notifications
Change-Id: I66b08e63b8799bc5932f2b2545376138a5701168
BUG: 1319992
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/14647
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r-- | xlators/protocol/client/src/client-callback.c | 11 | ||||
-rw-r--r-- | xlators/protocol/server/src/server.c | 9 |
2 files changed, 18 insertions, 2 deletions
diff --git a/xlators/protocol/client/src/client-callback.c b/xlators/protocol/client/src/client-callback.c index bedc8f6ec2b..134044015e4 100644 --- a/xlators/protocol/client/src/client-callback.c +++ b/xlators/protocol/client/src/client-callback.c @@ -63,7 +63,10 @@ client_cbk_recall_lease (struct rpc_clnt *rpc, void *mydata, void *data) } upcall_data.data = &rl_data; - gf_proto_recall_lease_to_upcall (&recall_lease, &upcall_data); + ret = gf_proto_recall_lease_to_upcall (&recall_lease, &upcall_data); + if (ret < 0) + goto out; + upcall_data.event_type = GF_UPCALL_RECALL_LEASE; gf_msg_trace (THIS->name, 0, "Upcall gfid = %s, ret = %d", @@ -72,6 +75,12 @@ client_cbk_recall_lease (struct rpc_clnt *rpc, void *mydata, void *data) default_notify (THIS, GF_EVENT_UPCALL, &upcall_data); out: + if (recall_lease.xdata.xdata_val) + free (recall_lease.xdata.xdata_val); + + if (rl_data.dict) + dict_unref (rl_data.dict); + return ret; } diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 0e8b28899bc..269d5f3bffd 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -1210,7 +1210,11 @@ server_process_event_upcall (xlator_t *this, void *data) xdrproc = (xdrproc_t)xdr_gfs3_cbk_cache_invalidation_req; break; case GF_UPCALL_RECALL_LEASE: - gf_proto_recall_lease_from_upcall (&gf_recall_lease, upcall_data); + ret = gf_proto_recall_lease_from_upcall (this, &gf_recall_lease, + upcall_data); + if (ret < 0) + goto out; + up_req = &gf_recall_lease; cbk_procnum = GF_CBK_RECALL_LEASE; xdrproc = (xdrproc_t)xdr_gfs3_recall_lease_req; @@ -1248,6 +1252,9 @@ out: if ((gf_c_req.xdata).xdata_val) GF_FREE ((gf_c_req.xdata).xdata_val); + if ((gf_recall_lease.xdata).xdata_val) + GF_FREE ((gf_recall_lease.xdata).xdata_val); + return ret; } |