From 4d37476f264bdb7e213f302840ac3238dc6d9791 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 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 --- xlators/cluster/dht/src/tier.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c index f35787ec010..007cfc60c5a 100644 --- a/xlators/cluster/dht/src/tier.c +++ b/xlators/cluster/dht/src/tier.c @@ -512,6 +512,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