summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2013-12-18 01:01:47 +0000
committerAvra Sengupta <asengupt@redhat.com>2014-01-07 15:26:25 +0530
commit4afa88d6cc39be11f122489900af07b57a50fcc4 (patch)
treed7a829bc7be6e98a2979ff35410ddccd674395bb /xlators/mgmt/glusterd/src/glusterd-store.c
parenta783136347ed2716f3f0ee0ca284f291f4e29652 (diff)
glusterd/snapshot: Defining snap-max-soft-limit as a percentage of snap-max-hard-limit.
This patch also prohibits configuration of snap-max-hard-limit and snap-max-soft-limit for snap volumes. Also displaying the snapshot configs by reading data only from local node, as all config data will be in sync across the cluster. Change-Id: I635b925c02ed5b108cd10c7193b154ad82d5afad BUG: 1043792 Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index f37ad9bec..1a00aac88 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -712,15 +712,6 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo)
goto out;
}
- snprintf (buf, sizeof (buf), "%"PRIu64, volinfo->snap_max_soft_limit);
- ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_SNAP_MAX_SOFT_LIMIT,
- buf);
- if (ret) {
- gf_log (THIS->name, GF_LOG_ERROR,
- "Unable to write snap-max-soft-limit");
- goto out;
- }
-
out:
if (ret)
gf_log (THIS->name, GF_LOG_ERROR, "Unable to write volume "
@@ -2228,7 +2219,6 @@ glusterd_restore_op_version (xlator_t *this)
glusterd_conf_t *conf = NULL;
int ret = 0;
int op_version = 0;
- int snap_max_limit = GLUSTERD_SNAPS_MAX_LIMIT;
conf = this->private;
@@ -2238,8 +2228,9 @@ glusterd_restore_op_version (xlator_t *this)
if (ret) {
gf_log (this->name, GF_LOG_WARNING,
"Unable to retrieve system snap-max-hard-limit, "
- "setting it to %d", snap_max_limit);
- conf->snap_max_hard_limit = GLUSTERD_SNAPS_MAX_LIMIT;
+ "setting it to default value(%d)",
+ GLUSTERD_SNAPS_MAX_HARD_LIMIT);
+ conf->snap_max_hard_limit = GLUSTERD_SNAPS_MAX_HARD_LIMIT;
}
ret = glusterd_retrieve_sys_snap_max_limit (this,
@@ -2248,8 +2239,9 @@ glusterd_restore_op_version (xlator_t *this)
if (ret) {
gf_log (this->name, GF_LOG_WARNING,
"Unable to retrieve system snap-max-soft-limit, "
- "setting it to %d", snap_max_limit);
- conf->snap_max_soft_limit = GLUSTERD_SNAPS_MAX_LIMIT;
+ "setting it to default value(%d)",
+ GLUSTERD_SNAPS_DEF_SOFT_LIMIT_PERCENT);
+ conf->snap_max_soft_limit = GLUSTERD_SNAPS_DEF_SOFT_LIMIT_PERCENT;
}
ret = glusterd_retrieve_op_version (this, &op_version);
@@ -2799,9 +2791,6 @@ glusterd_store_retrieve_volume (char *volname, glusterd_snap_t *snap)
} else if (!strncmp (key, GLUSTERD_STORE_KEY_SNAP_MAX_HARD_LIMIT,
strlen (GLUSTERD_STORE_KEY_SNAP_MAX_HARD_LIMIT))) {
volinfo->snap_max_hard_limit = (uint64_t) atoll (value);
- } else if (!strncmp (key, GLUSTERD_STORE_KEY_SNAP_MAX_SOFT_LIMIT,
- strlen (GLUSTERD_STORE_KEY_SNAP_MAX_SOFT_LIMIT))) {
- volinfo->snap_max_soft_limit = (uint64_t) atoll (value);
} else if (!strncmp (key, GLUSTERD_STORE_KEY_PARENT_VOLNAME,
strlen (GLUSTERD_STORE_KEY_PARENT_VOLNAME))) {
strncpy (volinfo->parent_volname, value, sizeof(volinfo->parent_volname) - 1);