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