summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-06-18 11:28:05 +0000
committerKaushal M <kaushal@redhat.com>2014-06-18 06:37:39 -0700
commit2b87e157a50953b542d5fc49fac84813ee116ce5 (patch)
tree1d421571377cf26b81b051f933c6a4077b4d610a /xlators/mgmt/glusterd
parent438234fccb41f9621e7506737438d77bc4f0d4f2 (diff)
glusterd/snapshot: Updating "global-option-version" in
/var/lib/glusterd/options When auto-delete option is set, we should update the "global-option-version" in /var/lib/glusterd/options to the next version. Change-Id: Ic561f33531a27cb8cca01d25632511205927268a BUG: 1104642 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/8099 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 7d1af47825b..ad322646eff 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -5468,6 +5468,15 @@ glusterd_snapshot_config_commit (dict_t *dict, char **op_errstr,
}
if (auto_delete) {
+ ret = dict_set_dynstr_with_alloc (conf->opts,
+ GLUSTERD_STORE_KEY_SNAP_AUTO_DELETE,
+ auto_delete);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "Could not "
+ "save auto-delete value in conf->opts");
+ goto out;
+ }
+
ret = glusterd_get_next_global_opt_version_str
(conf->opts, &next_version);
if (ret) {
@@ -5476,12 +5485,12 @@ glusterd_snapshot_config_commit (dict_t *dict, char **op_errstr,
goto out;
}
- ret = dict_set_dynstr_with_alloc (conf->opts,
- GLUSTERD_STORE_KEY_SNAP_AUTO_DELETE,
- auto_delete);
+ ret = dict_set_str (conf->opts,
+ GLUSTERD_GLOBAL_OPT_VERSION,
+ next_version);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Could not "
- "save auto-delete value in conf->opts");
+ gf_log (this->name, GF_LOG_ERROR, "Failed to "
+ "set next global opt-version");
goto out;
}