diff options
author | Anand Avati <avati@gluster.com> | 2009-11-28 05:34:41 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-11-28 21:30:10 -0800 |
commit | 51600217be80dc9e1b1ad8bf20b7e5a95d31ec1c (patch) | |
tree | 0e5fc775d31048553e76639201006002d1a976bb /xlators/cluster/afr | |
parent | 1ec37aa78fccb45aa701a3380f6acf95819c7a39 (diff) |
afr: fix logic to break out of diff/checksum loop
When checksum fop returns error, mark for terminating the loop at the end
of the iteration (when all checksum calls of that iteration return) and
not immediately
Signed-off-by: Anand V. Avati <avati@blackhole.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')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-algorithm.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-algorithm.c b/xlators/cluster/afr/src/afr-self-heal-algorithm.c index b6fba9d1f..73a878247 100644 --- a/xlators/cluster/afr/src/afr-self-heal-algorithm.c +++ b/xlators/cluster/afr/src/afr-self-heal-algorithm.c @@ -698,16 +698,12 @@ sh_diff_checksum_cbk (call_frame_t *rw_frame, void *cookie, xlator_t *this, strerror (op_errno)); sh->op_failed = 1; - - sh_diff_loop_return (rw_frame, this, loop_state); - - return 0; + } else { + memcpy ((void *) sh_priv->checksum + loop_state->child_index * MD5_DIGEST_LEN, + strong_checksum, + MD5_DIGEST_LEN); } - memcpy ((void *) sh_priv->checksum + loop_state->child_index * MD5_DIGEST_LEN, - strong_checksum, - MD5_DIGEST_LEN); - call_count = afr_frame_return (rw_frame); if (call_count == 0) { @@ -732,7 +728,7 @@ sh_diff_checksum_cbk (call_frame_t *rw_frame, void *cookie, xlator_t *this, } } - if (write_needed) { + if (write_needed && !sh->op_failed) { sh_diff_read (rw_frame, this, loop_state); } else { sh->offset += sh_priv->block_size; |