From 5906be31845f6a63ff9d5cd15ad0c13af51b81ea Mon Sep 17 00:00:00 2001 From: Sachin Pandit Date: Wed, 4 Jun 2014 03:41:35 +0530 Subject: glusterd/snapshot : Store the global snapshot config limit in options. Problem : Initially we used to save the global config limit in glusterd.info, The problem with that approach was glusterd.info is local to a particular glusterd and hence is not synced during the handshake of glusterds. Solution : Store the global snapshot config in options, which is synced during handshake. Change-Id: I4c688bb4052a57df28aadba8581b14e2ddb510ef BUG: 1104642 Signed-off-by: Sachin Pandit Reviewed-on: http://review.gluster.org/7971 Reviewed-by: Rajesh Joseph Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-store.c | 40 ------------------------------ 1 file changed, 40 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 7efa9fb6d17..a243a1365d3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -1784,24 +1784,6 @@ glusterd_store_global_info (xlator_t *this) goto out; } - snprintf (buf, sizeof (buf), "%"PRIu64, conf->snap_max_hard_limit); - ret = gf_store_save_value (handle->fd, - GLUSTERD_STORE_KEY_SNAP_MAX_HARD_LIMIT, buf); - if (ret) { - gf_log (this->name, GF_LOG_ERROR, - "Storing snap-max-hard-limit failed ret = %d", ret); - goto out; - } - - snprintf (buf, sizeof (buf), "%"PRIu64, conf->snap_max_soft_limit); - ret = gf_store_save_value (handle->fd, - GLUSTERD_STORE_KEY_SNAP_MAX_SOFT_LIMIT, buf); - if (ret) { - gf_log (this->name, GF_LOG_ERROR, - "Storing snap-max-soft-limit failed ret = %d", ret); - goto out; - } - ret = gf_store_rename_tmppath (handle); out: if (handle) { @@ -1940,28 +1922,6 @@ glusterd_restore_op_version (xlator_t *this) conf = this->private; - ret = glusterd_retrieve_sys_snap_max_limit (this, - &conf->snap_max_hard_limit, - GLUSTERD_STORE_KEY_SNAP_MAX_HARD_LIMIT); - if (ret) { - gf_log (this->name, GF_LOG_WARNING, - "Unable to retrieve system snap-max-hard-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, - &conf->snap_max_soft_limit, - GLUSTERD_STORE_KEY_SNAP_MAX_SOFT_LIMIT); - if (ret) { - gf_log (this->name, GF_LOG_WARNING, - "Unable to retrieve system snap-max-soft-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); if (!ret) { if ((op_version < GD_OP_VERSION_MIN) || -- cgit