21ab4e
From 4153c6b3a334be7514b4002ca848a74e38036e72 Mon Sep 17 00:00:00 2001
21ab4e
From: Gaurav Yadav <gyadav@redhat.com>
21ab4e
Date: Mon, 13 Feb 2017 15:46:24 +0530
21ab4e
Subject: [PATCH 333/361] glusterd : Fix for error mesage while detaching peers
21ab4e
21ab4e
When peer is detached from a cluster, an error log is being
21ab4e
generated in glusterd.log -"Failed to reconfigure all daemon
21ab4e
services". This log is seen in the originator node where the
21ab4e
detach is issued.
21ab4e
21ab4e
This happens in two cases.
21ab4e
Case 1: Detach peer with no volume been created in cluster.
21ab4e
Case 2: Detach peer after deleting all the volumes which were
21ab4e
created but never started.
21ab4e
In any one of the above two cases, in glusterd_check_files_identical()
21ab4e
GlusterD fails to retrieve nfs-server.vol file from /var/lib/glusterd/nfs
21ab4e
which gets created only when a volume is in place and and is started.
21ab4e
21ab4e
With this fix both the above cases have been handled by added
21ab4e
validation to skip reconfigure if there is no volume in started
21ab4e
state.
21ab4e
21ab4e
mainline:
21ab4e
> BUG: 1421607
21ab4e
> Reviewed-on: https://review.gluster.org/16607
21ab4e
> Smoke: Gluster Build System <jenkins@build.gluster.org>
21ab4e
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
21ab4e
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
21ab4e
> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
> Tested-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
(cherry picked from commit 9c231c845e715b5180b1b046da2cd2bde872f208)
21ab4e
21ab4e
BUG: 1383979
21ab4e
Change-Id: I039c0840e3d61ab54575e1e00c6a6a00874d84c0
21ab4e
Signed-off-by: Gaurav Yadav <gyadav@redhat.com>
21ab4e
Reviewed-on: https://code.engineering.redhat.com/gerrit/101314
21ab4e
Tested-by: Milind Changire <mchangir@redhat.com>
21ab4e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
---
21ab4e
 xlators/mgmt/glusterd/src/glusterd-nfs-svc.c | 15 +++++++++++++++
21ab4e
 1 file changed, 15 insertions(+)
21ab4e
21ab4e
diff --git a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
21ab4e
index c6ab0c5..da34342 100644
21ab4e
--- a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
21ab4e
+++ b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
21ab4e
@@ -145,17 +145,32 @@ glusterd_nfssvc_reconfigure ()
21ab4e
         xlator_t        *this            = NULL;
21ab4e
         glusterd_conf_t *priv            = NULL;
21ab4e
         gf_boolean_t     identical       = _gf_false;
21ab4e
+        gf_boolean_t     vol_started     = _gf_false;
21ab4e
+        glusterd_volinfo_t *volinfo      = NULL;
21ab4e
 
21ab4e
         this = THIS;
21ab4e
         GF_VALIDATE_OR_GOTO (this->name, this, out);
21ab4e
 
21ab4e
         priv = this->private;
21ab4e
         GF_VALIDATE_OR_GOTO (this->name, priv, out);
21ab4e
+
21ab4e
+        cds_list_for_each_entry (volinfo, &priv->volumes, vol_list) {
21ab4e
+                if (GLUSTERD_STATUS_STARTED == volinfo->status) {
21ab4e
+                        vol_started = _gf_true;
21ab4e
+                        break;
21ab4e
+                }
21ab4e
+        }
21ab4e
+        if (!vol_started) {
21ab4e
+                ret = 0;
21ab4e
+                goto out;
21ab4e
+        }
21ab4e
+
21ab4e
         /*
21ab4e
          * Check both OLD and NEW volfiles, if they are SAME by size
21ab4e
          * and cksum i.e. "character-by-character". If YES, then
21ab4e
          * NOTHING has been changed, just return.
21ab4e
          */
21ab4e
+
21ab4e
         ret = glusterd_svc_check_volfile_identical (priv->nfs_svc.name,
21ab4e
                                                     build_nfs_graph,
21ab4e
                                                     &identical);
21ab4e
-- 
21ab4e
1.8.3.1
21ab4e