From 57372682b174c1483c41e8bc2474dcfebf0b86df Mon Sep 17 00:00:00 2001 From: Poornima G Date: Sun, 5 Jun 2016 00:06:11 -0400 Subject: protocol: Add framework to send transaction id with recall Backport of: http://review.gluster.org/#/c/14647/ 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: 1337638 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/14648 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra G --- xlators/protocol/server/src/server.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'xlators/protocol/server/src') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 99874acae72..10009e2b4a7 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -1208,7 +1208,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; @@ -1243,6 +1247,9 @@ server_process_event_upcall (xlator_t *this, void *data) pthread_mutex_unlock (&conf->mutex); ret = 0; out: + if ((gf_recall_lease.xdata).xdata_val) + GF_FREE ((gf_recall_lease.xdata).xdata_val); + return ret; } -- cgit