diff options
author | Rajesh Joseph <rjoseph@redhat.com> | 2014-04-28 19:14:20 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-05-02 08:56:35 -0700 |
commit | b189bb33edc2582e53923dec51bdef0f118c3d36 (patch) | |
tree | 7dc60e1746435b0ed700922cd7e9a3a9b30337ac /xlators | |
parent | e14b100da9801f6f694763eae47e5412982856f0 (diff) |
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 <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/7582
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 18 |
1 files 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) |