diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-12-01 06:11:04 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-12-01 06:30:00 -0800 |
commit | ab99355f55ce8a55d5c9b339ced830723be5f213 (patch) | |
tree | e2f76ee57c7d653e41ae929fba0638c78fdba502 /xlators/cluster/afr/src/afr-self-heal-common.c | |
parent | d2a30ec4aaeaa546f6370a1377c44574ada5edbc (diff) |
cluster/afr: Set the self-heal "source" as read subvolume even when not doing self-heal.
This patch sets the read-subvolume equal to the self-heal "source"
even if we're not doing self-heal (because some one else is already
doing it).
Signed-off-by: Vikas Gorur <vikas@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 320 (Improve self-heal performance)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index a8160f4e26b..327cab032f7 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -364,10 +364,13 @@ afr_sh_mark_if_size_differs (afr_self_heal_t *sh, int child_count) for (i = 0; i < child_count; i++) { for (j = 0; j < child_count; j++) { + if (!sh->buf) + break; + if (SIZE_DIFFERS (&sh->buf[i], &sh->buf[j]) && (pending_matrix[i][j] == 0) && (pending_matrix[j][i] == 0)) { - + pending_matrix[i][j] = 1; pending_matrix[j][i] = 1; @@ -387,7 +390,7 @@ afr_sh_mark_biggest_fool_as_source (afr_self_heal_t *sh, { int i = 0; int biggest = 0; - + for (i = 0; i < child_count; i++) { if (characters[i].type == AFR_NODE_FOOL) { biggest = i; @@ -398,7 +401,10 @@ afr_sh_mark_biggest_fool_as_source (afr_self_heal_t *sh, for (i = 0; i < child_count; i++) { if (characters[i].type != AFR_NODE_FOOL) continue; - + + if (!sh->buf) + break; + if (SIZE_GREATER (&sh->buf[i], &sh->buf[biggest])) { biggest = i; } @@ -417,6 +423,9 @@ afr_sh_mark_biggest_as_source (afr_self_heal_t *sh, int child_count) int i; for (i = 0; i < child_count; i++) { + if (!sh->buf) + break; + if (SIZE_GREATER (&sh->buf[i], &sh->buf[biggest])) { biggest = i; } |