summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2018-03-12 11:47:30 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-03-20 07:27:16 +0000
commitccd7825334f294918f895768fbebf825084f2e5d (patch)
tree47304ce4c8300238a524bb7aa5adf55cdf285ab8 /xlators/mgmt
parentcf06dd544004701ef43fa81c5b7a95353d5c1d65 (diff)
georep : Pause/Resume of geo-replication with wrong user
While performing pause/resume on geo-replication with wrong user (other user then you setup), always returns success. Which further leads to snapshot creation failure as it is detecting active geo-replication session. Change-Id: I6e96e8dd3e861348b057475387f0093cb903ae88 BUG: 1550936 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 154ac146c46..a7b56617df0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -3651,6 +3651,18 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr)
if (path_list)
ret = -1;
}
+
+ /* Check for geo-rep session is active or not for
+ * configured user.*/
+ ret = glusterd_gsync_get_uuid (slave, volinfo, uuid);
+ if (ret) {
+ snprintf (errmsg, sizeof(errmsg),
+ "Geo-replication session between %s "
+ "and %s does not exist.",
+ volinfo->volname, slave);
+ ret = -1;
+ goto out;
+ }
}
break;
@@ -3675,6 +3687,17 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr)
}
}
+ /* Check for geo-rep session is active or not
+ * for configured user.*/
+ ret = glusterd_gsync_get_uuid (slave, volinfo, uuid);
+ if (ret) {
+ snprintf (errmsg, sizeof(errmsg), "Geo-replication"
+ " session between %s and %s does not exist.",
+ volinfo->volname, slave);
+ ret = -1;
+ goto out;
+ }
+
if (!is_force) {
ret = gd_pause_resume_validation (type, volinfo, slave,
statefile, op_errstr);