a3470f
From 60575494a3b1ef52ea6374d62654693b6ee0d9bd Mon Sep 17 00:00:00 2001
a3470f
From: Sunny Kumar <sunkumar@redhat.com>
a3470f
Date: Fri, 16 Mar 2018 17:11:09 +0530
a3470f
Subject: [PATCH 188/201] georep : Pause/Resume of geo-replication with wrong
a3470f
 user
a3470f
a3470f
While performing pause/resume on geo-replication with wrong user
a3470f
(other user then you setup), always returns success. Which further
a3470f
leads to snapshot creation failure as it is detecting active
a3470f
geo-replication session.
a3470f
a3470f
upstream patch : https://review.gluster.org/#/c/19658/
a3470f
a3470f
>BUG: 1550936
a3470f
>Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
a3470f
a3470f
Change-Id: I6e96e8dd3e861348b057475387f0093cb903ae88
a3470f
BUG: 1557297
a3470f
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/132890
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
a3470f
---
a3470f
 xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 23 +++++++++++++++++++++++
a3470f
 1 file changed, 23 insertions(+)
a3470f
a3470f
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
a3470f
index 93d4516..dff8065 100644
a3470f
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
a3470f
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
a3470f
@@ -3641,6 +3641,18 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr)
a3470f
                                 if (path_list)
a3470f
                                         ret = -1;
a3470f
                         }
a3470f
+
a3470f
+                        /* Check for geo-rep session is active or not for
a3470f
+                         * configured user.*/
a3470f
+                        ret = glusterd_gsync_get_uuid (slave, volinfo, uuid);
a3470f
+                        if (ret) {
a3470f
+                                snprintf (errmsg, sizeof(errmsg),
a3470f
+                                          "Geo-replication session between %s "
a3470f
+                                          "and %s does not exist.",
a3470f
+                                          volinfo->volname, slave);
a3470f
+                                ret = -1;
a3470f
+                                goto out;
a3470f
+                        }
a3470f
                 }
a3470f
                 break;
a3470f
 
a3470f
@@ -3665,6 +3677,17 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr)
a3470f
                         }
a3470f
                 }
a3470f
 
a3470f
+                /* Check for geo-rep session is active or not
a3470f
+                 * for configured user.*/
a3470f
+                ret = glusterd_gsync_get_uuid (slave, volinfo, uuid);
a3470f
+                if (ret) {
a3470f
+                        snprintf (errmsg, sizeof(errmsg), "Geo-replication"
a3470f
+                                  " session between %s and %s does not exist.",
a3470f
+                                  volinfo->volname, slave);
a3470f
+                        ret = -1;
a3470f
+                        goto out;
a3470f
+                }
a3470f
+
a3470f
                 if (!is_force) {
a3470f
                         ret = gd_pause_resume_validation (type, volinfo, slave,
a3470f
                                                           statefile, op_errstr);
a3470f
-- 
a3470f
1.8.3.1
a3470f