21ab4e
From 4e395d1bdc3f1349b6b2ee1ecc306f975b6cc4d9 Mon Sep 17 00:00:00 2001
21ab4e
From: Ashish Pandey <aspandey@redhat.com>
21ab4e
Date: Tue, 4 Jul 2017 16:18:20 +0530
21ab4e
Subject: [PATCH 543/557] cluster/ec : Don't try to heal when no sink is UP
21ab4e
21ab4e
Problem:
21ab4e
4 + 2 EC volume configuration.
21ab4e
If untar of linux is going on and we kill a brick,
21ab4e
indices will be created for the files/dir which need
21ab4e
to be healed. ec_shd_index_sweep spawns threads to
21ab4e
scan these entries and start heal. If in the middle
21ab4e
of this we kill one more brick, we end up in a
21ab4e
situation where we can not heal an entry as there
21ab4e
are only "ec->fragment" number of bricks are UP.
21ab4e
However, the scan will be continued and it will
21ab4e
trigger the heal for those entries.
21ab4e
21ab4e
Solution:
21ab4e
When a heal is triggered for an entry, check if it
21ab4e
*CAN* be healed or not. If not come out with ENOTCONN.
21ab4e
21ab4e
>Change-Id: I305be7701c289f36bd7bde22491b71074771424f
21ab4e
>BUG: 1464359
21ab4e
>Signed-off-by: Ashish Pandey <aspandey@redhat.com>
21ab4e
>Reviewed-on: https://review.gluster.org/17692
21ab4e
>Smoke: Gluster Build System <jenkins@build.gluster.org>
21ab4e
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
21ab4e
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
21ab4e
>Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
21ab4e
>Reviewed-by: Sunil Kumar Acharya <sheggodu@redhat.com>
21ab4e
>Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
21ab4e
>Signed-off-by: Ashish Pandey <aspandey@redhat.com>
21ab4e
21ab4e
Change-Id: I305be7701c289f36bd7bde22491b71074771424f
21ab4e
BUG: 1464336
21ab4e
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
21ab4e
Reviewed-on: https://code.engineering.redhat.com/gerrit/111303
21ab4e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
---
21ab4e
 xlators/cluster/ec/src/ec-heald.c | 6 ++++++
21ab4e
 1 file changed, 6 insertions(+)
21ab4e
21ab4e
diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c
21ab4e
index ffb78d5..2e8ece8 100644
21ab4e
--- a/xlators/cluster/ec/src/ec-heald.c
21ab4e
+++ b/xlators/cluster/ec/src/ec-heald.c
21ab4e
@@ -199,6 +199,9 @@ ec_shd_index_heal (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent,
21ab4e
         int                  ret     = 0;
21ab4e
 
21ab4e
         ec = healer->this->private;
21ab4e
+        if (ec->xl_up_count <= ec->fragments) {
21ab4e
+                return -ENOTCONN;
21ab4e
+        }
21ab4e
         if (!ec->shd.enabled)
21ab4e
                 return -EBUSY;
21ab4e
 
21ab4e
@@ -281,6 +284,9 @@ ec_shd_full_heal (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent,
21ab4e
         int                  ret    = 0;
21ab4e
 
21ab4e
         ec = this->private;
21ab4e
+        if (ec->xl_up_count <= ec->fragments) {
21ab4e
+                return -ENOTCONN;
21ab4e
+        }
21ab4e
         if (!ec->shd.enabled)
21ab4e
                 return -EBUSY;
21ab4e
 
21ab4e
-- 
21ab4e
1.8.3.1
21ab4e