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