From e2bd0563a352e1d22a24f6a8a99beb4d4b8eb2ac Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Tue, 8 Mar 2016 16:38:34 +0530 Subject: TIER: stopping the tierd when the volume goes down back-port of : http://review.gluster.org/#/c/13646/ If there are large number of files to be migrated and by this time if the volume goes down, then the tierd has to be stopped. But on a huge query file list it keeps checking for each file before stopping. If the volume comes up before the old tierd dies then due to the presence of old tierd new one won't be created. After the old one completes the task, it dies and the status ends up as failed. This patch will check if the status is still running and then let it continue its work. Else it will stop running the tierd. >Change-Id: I6522a4e2919e84bf502b99b13873795b9274f3cd >BUG: 1315659 >Signed-off-by: hari gowtham >Reviewed-on: http://review.gluster.org/13646 >Tested-by: Dan Lambright >Smoke: Gluster Build System >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Dan Lambright Change-Id: I8326dbe5edaaea921e5401f39d148aac322c78d0 BUG: 1318498 Signed-off-by: hari Reviewed-on: http://review.gluster.org/13756 Smoke: Gluster Build System Tested-by: hari gowtham NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Dan Lambright --- xlators/cluster/dht/src/tier.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c index b9ed7550b2c..199a344754e 100644 --- a/xlators/cluster/dht/src/tier.c +++ b/xlators/cluster/dht/src/tier.c @@ -517,6 +517,15 @@ tier_migrate_using_query_file (void *_args) goto out; } + if (defrag->defrag_status != GF_DEFRAG_STATUS_STARTED) { + ret = -1; + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_LOG_TIER_ERROR, + "Exiting tier migration as" + "defrag status is not started"); + goto out; + } + ret = gettimeofday (¤t_time, NULL); if (ret < 0) { gf_msg (this->name, GF_LOG_ERROR, 0, -- cgit