diff options
author | Kaushal M <kaushal@redhat.com> | 2013-09-26 18:07:51 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-10-24 13:31:49 -0700 |
commit | 04181ad37d522d658373da03d99f32822d30bc88 (patch) | |
tree | 68797fdc2c4444d421bbcfca6feda4cf37b10392 | |
parent | 437d51f42813299435c297e9c0a1312dcaf0a6f4 (diff) |
glusterd: Fix storing volumes on setting global opts
Glusterd would not store all the volumes when a global options were set.
When setting a global option, like 'nfs.*' options, glusterd used to
modify the volinfo for all the volumes, but would store only the volinfo
for the named volume. This lead to mismatch in the persisted and the
in-memory representation of those volumes, which lead to problems like
peers being rejected because of volume mismatches.
BUG: 1012400
Change-Id: I49903baaa4c93088d7c0d03553ccab37036b5426
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/6029
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 7c7dcda618e..f7950da530a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1466,6 +1466,7 @@ glusterd_op_set_volume (dict_t *dict) char str[50] = {0, }; char *op_errstr = NULL; gf_boolean_t global_opt = _gf_false; + gf_boolean_t global_opts_set = _gf_false; glusterd_volinfo_t *voliter = NULL; int32_t dict_count = 0; gf_boolean_t check_op_version = _gf_false; @@ -1526,7 +1527,6 @@ glusterd_op_set_volume (dict_t *dict) for (count = 1; ret != -1 ; count++) { - global_opt = _gf_false; sprintf (str, "key%d", count); ret = dict_get_str (dict, str, &key); if (ret) @@ -1574,8 +1574,11 @@ glusterd_op_set_volume (dict_t *dict) } } - if (glusterd_check_globaloption (key)) + global_opt = _gf_false; + if (glusterd_check_globaloption (key)) { global_opt = _gf_true; + global_opts_set = _gf_true; + } if (!global_opt) value = gf_strdup (value); @@ -1631,7 +1634,7 @@ glusterd_op_set_volume (dict_t *dict) } } - if (!global_opt) { + if (!global_opts_set) { gd_update_volume_op_versions (volinfo); ret = glusterd_create_volfiles_and_notify_services (volinfo); if (ret) { |