summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
diff options
context:
space:
mode:
authorGauravKumarGarg <ggarg@redhat.com>2014-09-29 14:03:49 +0530
committerKaushal M <kaushal@redhat.com>2014-09-29 21:46:21 -0700
commit535c4259119ca3beef2fee1526930e8be42bdd5d (patch)
tree9b875edd24ae2a508dae65c9b84241b1a135d2d0 /xlators/mgmt/glusterd/src/glusterd-volume-ops.c
parent2736421b26ef03724297b62b4f07ad847c135709 (diff)
glusterd: Perform brick order check in originator node.
Currently in case of multi node cluster brick-order check for replicate volume done on every node. Its waste of time to perform brick order check on every node. This change will perform brick order check only at originator node. Change-Id: I8687fd28e587de8a280a9003b015ccd5729c9740 BUG: 1091935 Signed-off-by: ggarg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/8881 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index ac8407f077d..cde4bec844d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -1095,23 +1095,26 @@ glusterd_op_stage_create_volume (dict_t *dict, char **op_errstr,
/*Check brick order if the volume type is replicate or disperse. If
* force at the end of command not given then check brick order.
*/
- ret = dict_get_int32 (dict, "type", &type);
- if (ret) {
- snprintf (msg, sizeof (msg), "Unable to get type of volume %s",
- volname);
- gf_log (this->name, GF_LOG_WARNING, "%s", msg);
- goto out;
- }
+ if (is_origin_glusterd (dict)) {
+ ret = dict_get_int32 (dict, "type", &type);
+ if (ret) {
+ snprintf (msg, sizeof (msg), "Unable to get type of "
+ "volume %s", volname);
+ gf_log (this->name, GF_LOG_WARNING, "%s", msg);
+ goto out;
+ }
- if (!is_force) {
- if ((type == GF_CLUSTER_TYPE_REPLICATE) ||
- (type == GF_CLUSTER_TYPE_STRIPE_REPLICATE) ||
- (type == GF_CLUSTER_TYPE_DISPERSE)) {
- ret = glusterd_check_brick_order(dict, msg);
- if (ret) {
- gf_log(this->name, GF_LOG_ERROR, "Not creating "
- "volume because of bad brick order");
- goto out;
+ if (!is_force) {
+ if ((type == GF_CLUSTER_TYPE_REPLICATE) ||
+ (type == GF_CLUSTER_TYPE_STRIPE_REPLICATE) ||
+ (type == GF_CLUSTER_TYPE_DISPERSE)) {
+ ret = glusterd_check_brick_order(dict, msg);
+ if (ret) {
+ gf_log(this->name, GF_LOG_ERROR, "Not "
+ "creating volume because of bad "
+ "brick order");
+ goto out;
+ }
}
}
}