From b189bb33edc2582e53923dec51bdef0f118c3d36 Mon Sep 17 00:00:00 2001 From: Rajesh Joseph Date: Mon, 28 Apr 2014 19:14:20 +0530 Subject: glusterd/snapshot: Move read-only xlator to client graph read-only xlator is moved from server graph to client graph so that AFR & DHT healing can take place at server Change-Id: I140ec962330c59d3b44f9bc8084a1544a1fd6c54 BUG: 1061685 Signed-off-by: Rajesh Joseph Reviewed-on: http://review.gluster.org/7582 Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Sachin Pandit Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 197e4b9ecdb..ecc8f7cafe6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -1744,8 +1744,7 @@ server_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, } /* Check for read-only volume option, and add it to the graph */ - if (dict_get_str_boolean (set_dict, "features.read-only", 0) - || volinfo -> is_snap_volume) { + if (dict_get_str_boolean (set_dict, "features.read-only", 0)){ xl = volgen_graph_add (graph, "features/read-only", volname); if (!xl) { ret = -1; @@ -2644,6 +2643,21 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, if (ret == -1) goto out; + /* As of now snapshot volume is read-only. Read-only xlator is loaded + * in client graph so that AFR & DHT healing can be done in server. + */ + if (volinfo->is_snap_volume) { + xl = volgen_graph_add (graph, "features/read-only", volname); + if (!xl) { + gf_log (this->name, GF_LOG_ERROR, "Failed to add " + "read-only feature to the graph of %s " + "snapshot with %s origin volume", + volname, volinfo->parent_volname); + ret = -1; + goto out; + } + } + /* Check for compress volume option, and add it to the graph on client side */ ret = dict_get_str_boolean (set_dict, "network.compression", 0); if (ret == -1) -- cgit