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