d84cf8
From c184943bdf38de5b4cbf165fd1cd98ce7bd9e976 Mon Sep 17 00:00:00 2001
d84cf8
From: hari gowtham <hgowtham@redhat.com>
d84cf8
Date: Tue, 16 Jun 2020 14:47:53 +0530
d84cf8
Subject: [PATCH 452/456] Tier/DHT: Handle the pause case missed out
d84cf8
d84cf8
Problem: While backporting a change from master
d84cf8
the changes related to tier were removed. This started affecting
d84cf8
the tier pause functionality. Backporting it
d84cf8
to downstream left this usecase messed up as we still support tier.
d84cf8
patch that caused this: https://code.engineering.redhat.com/gerrit/#/c/202647/2
d84cf8
d84cf8
Fix: add the condition back for tier pause to work.
d84cf8
d84cf8
Label: DOWNSTREAM ONLY
d84cf8
d84cf8
BUG: 1844359
d84cf8
Change-Id: I46c6c179b09c7e1a729be9fd257fa4a490f0287e
d84cf8
Signed-off-by: hari gowtham <hgowtham@redhat.com>
d84cf8
Reviewed-on: https://code.engineering.redhat.com/gerrit/203560
d84cf8
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d84cf8
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
d84cf8
---
d84cf8
 xlators/cluster/dht/src/dht-rebalance.c | 9 +++++++++
d84cf8
 1 file changed, 9 insertions(+)
d84cf8
d84cf8
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
d84cf8
index e9974cd..abc10fc 100644
d84cf8
--- a/xlators/cluster/dht/src/dht-rebalance.c
d84cf8
+++ b/xlators/cluster/dht/src/dht-rebalance.c
d84cf8
@@ -1160,6 +1160,15 @@ __dht_rebalance_migrate_data(xlator_t *this, gf_defrag_info_t *defrag,
d84cf8
             break;
d84cf8
         }
d84cf8
 
d84cf8
+        if ((defrag && defrag->cmd == GF_DEFRAG_CMD_START_TIER) &&
d84cf8
+            (gf_defrag_get_pause_state(&defrag->tier_conf) != TIER_RUNNING)) {
d84cf8
+            gf_msg("tier", GF_LOG_INFO, 0, DHT_MSG_TIER_PAUSED,
d84cf8
+                   "Migrate file paused");
d84cf8
+            ret = -1;
d84cf8
+            break;
d84cf8
+        }
d84cf8
+
d84cf8
+
d84cf8
         offset += ret;
d84cf8
         total += ret;
d84cf8
 
d84cf8
-- 
d84cf8
1.8.3.1
d84cf8