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