From ccd7825334f294918f895768fbebf825084f2e5d Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Mon, 12 Mar 2018 11:47:30 +0530 Subject: 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 --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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); -- cgit