summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-06-30 07:20:46 +0000
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-04-09 11:33:49 +0000
commit3d03c4bf9b46fcbb26bdc1e06fb96099c1894871 (patch)
tree060ffb79774c9f03a8b48cec1fdaece3da0f294b /xlators/mgmt
parent8830e90fa1b131057e4ee1742cb83d78102714c0 (diff)
glusterd/geo-rep: Check if the state file is present or not.
Currently every geo-rep operation other than start and stop force, checks if the state-file is present or not before performing the operation. This check is done to confirm that the session on which the op is being performed is created. This patch makes the start command also perform the same check and accordingly display the correct error. Change-Id: Ifd8bdfa3f362e91f58ead3202e2ebdbd411080e5 BUG: 1114469 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/8202 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 58948b98584..a190e1c8aea 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -2586,11 +2586,7 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr)
/* Allowing stop force to bypass the statefile check
* as this command acts as a fail safe method to stop geo-rep
* session. */
- if ((type == GF_GSYNC_OPTION_TYPE_CONFIG) ||
- ((type == GF_GSYNC_OPTION_TYPE_STOP) && !is_force) ||
- (type == GF_GSYNC_OPTION_TYPE_DELETE) ||
- (type == GF_GSYNC_OPTION_TYPE_PAUSE) ||
- (type == GF_GSYNC_OPTION_TYPE_RESUME)) {
+ if (!((type == GF_GSYNC_OPTION_TYPE_STOP) && is_force)) {
ret = lstat (statefile, &stbuf);
if (ret) {
snprintf (errmsg, sizeof(errmsg), "Geo-replication"