From 9156a743aa76c955d18c9bfcb7c1a38ba00da890 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Mon, 3 Jul 2017 13:13:35 +0530 Subject: cluster/dht: Use size to calculate estimates The earlier approach of using the number of files to determine when the rebalance would complete did not work well when file sizes differed widely. The new approach now gets the total data size and uses that information to determine how long the rebalance is expected to take. Change-Id: I84e80a0893efab72ff06130e4596fa71c9c8c868 BUG: 1467209 Signed-off-by: N Balachandran Reviewed-on: https://review.gluster.org/17668 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: MOHIT AGRAWAL Reviewed-by: Raghavendra G --- xlators/cluster/dht/src/dht-shared.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/cluster/dht/src/dht-shared.c') diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c index a75c61190df..0373ebffe5a 100644 --- a/xlators/cluster/dht/src/dht-shared.c +++ b/xlators/cluster/dht/src/dht-shared.c @@ -742,6 +742,9 @@ dht_init (xlator_t *this) pthread_cond_init (&defrag->rebalance_crawler_alarm, 0); pthread_cond_init (&defrag->df_wakeup_thread, 0); + pthread_mutex_init (&defrag->fc_mutex, 0); + pthread_cond_init (&defrag->fc_wakeup_cond, 0); + defrag->global_error = 0; } -- cgit