From 4163a3f8fbcc5e0d84d955258161f3a6f7a86de8 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Fri, 23 Oct 2009 10:11:47 +0000 Subject: cluster/afr: Do self-heal in the background. This patch introduces a new option "background-self-heal-count", with a default value of 16. This means that upto {background-self-heal-count} number of files/directories will be healed in the background at any given time. If such number of self-heals are already in progress, further self-heals take place in the foreground. Signed-off-by: Anand V. Avati BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320 --- xlators/cluster/afr/src/afr-self-heal-data.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index d2224ec9263..718c716f55a 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -768,6 +768,10 @@ afr_sh_data_fix (call_frame_t *frame, xlator_t *this) sh->sources[i] = 0; } + if (sh->background) { + sh->unwind (frame, this); + } + afr_sh_data_sync_prepare (frame, this); return 0; -- cgit