summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/glusterfs
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2019-07-05 20:12:59 +0530
committerAmar Tumballi <amarts@gmail.com>2019-09-05 16:14:44 +0000
commit43635716e6bd5bd5925fa9194b0853ee919a742d (patch)
tree985078d45437b1a74f119c762072fe333e92ce06 /libglusterfs/src/glusterfs
parentd026f0bcfd301712e4f0671ccf238f43f2e6dd30 (diff)
graph/cleanup: Fix race in graph cleanup
We were unconditionally cleaning up the grap when we get child_down followed by parent_down. But this is prone to race condition when some of the bricks are already disconnected. In this case, even before the last child down is executed in the client xlator code,we might have freed the graph. Because the child_down event is alreadt recevied. To fix this race, we have introduced a check to see if all client xlator have cleared thier reconnect chain, and called the child_down for last time. Change-Id: I7d02813bc366dac733a836e0cd7b14a6fac52042 fixes: bz#1727329 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'libglusterfs/src/glusterfs')
-rw-r--r--libglusterfs/src/glusterfs/glusterfs.h1
-rw-r--r--libglusterfs/src/glusterfs/xlator.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h
index 01262dcd9f5..155bf435386 100644
--- a/libglusterfs/src/glusterfs/glusterfs.h
+++ b/libglusterfs/src/glusterfs/glusterfs.h
@@ -594,6 +594,7 @@ struct _glusterfs_graph {
in client multiplexed code path */
pthread_mutex_t mutex;
pthread_cond_t child_down_cond; /* for broadcasting CHILD_DOWN */
+ int parent_down;
char graph_uuid[128];
};
typedef struct _glusterfs_graph glusterfs_graph_t;
diff --git a/libglusterfs/src/glusterfs/xlator.h b/libglusterfs/src/glusterfs/xlator.h
index 6449e59f484..6608d6cdf0d 100644
--- a/libglusterfs/src/glusterfs/xlator.h
+++ b/libglusterfs/src/glusterfs/xlator.h
@@ -1095,4 +1095,6 @@ mgmt_is_multiplexed_daemon(char *name);
gf_boolean_t
xlator_is_cleanup_starting(xlator_t *this);
+int
+graph_total_client_xlator(glusterfs_graph_t *graph);
#endif /* _XLATOR_H */