diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-05-19 16:07:42 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-05-31 16:53:50 -0700 |
commit | a5b8c32afba6509c4de4ec08830f5833fcbdaf1a (patch) | |
tree | 5c4cb640e01a070afe27ffe05c891894c7d7cfc1 /xlators/mgmt | |
parent | 4bc0fa312f8a64c7ee0f52e5635d7f082454aaa2 (diff) |
mgmt/glusterd: Do shd validation for replicate volumes
Staging needs to build graphs for replicate volumes in stopped
state as well.
Change-Id: I6474cd0fc43c9fa1916826d4a452f301fe7fe811
BUG: 823128
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3489
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index cae93fbd486..fdbc8c4945d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -2784,6 +2784,7 @@ build_shd_graph (volgen_graph_t *graph, dict_t *mod_dict) xlator_t *iostxl = NULL; int rclusters = 0; int replica_count = 0; + gf_boolean_t graph_check = _gf_false; this = THIS; priv = this->private; @@ -2794,6 +2795,7 @@ build_shd_graph (volgen_graph_t *graph, dict_t *mod_dict) goto out; } + graph_check = dict_get_str_boolean (mod_dict, "graph-check", 0); iostxl = volgen_graph_add_as (graph, "debug/io-stats", "glustershd"); if (!iostxl) { ret = -1; @@ -2801,7 +2803,8 @@ build_shd_graph (volgen_graph_t *graph, dict_t *mod_dict) } list_for_each_entry (voliter, &priv->volumes, vol_list) { - if (voliter->status != GLUSTERD_STATUS_STARTED) + if (!graph_check && + (voliter->status != GLUSTERD_STATUS_STARTED)) continue; if (!glusterd_is_volume_replicate (voliter)) @@ -3447,6 +3450,13 @@ validate_shdopts (glusterd_volinfo_t *volinfo, graph.errstr = op_errstr; + if (!glusterd_is_volume_replicate (volinfo)) { + ret = 0; + goto out; + } + ret = dict_set_str (val_dict, "graph-check", "on"); + if (ret) + goto out; ret = build_shd_graph (&graph, val_dict); if (!ret) ret = graph_reconf_validateopt (&graph.graph, op_errstr); @@ -3454,6 +3464,8 @@ validate_shdopts (glusterd_volinfo_t *volinfo, volgen_graph_free (&graph); gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret); +out: + dict_del (val_dict, "graph-check"); return ret; } |