[Gluster-devel] self heal problem

Stephan von Krawczynski skraw at ithnet.com
Wed Mar 24 15:17:25 UTC 2010


On Wed, 24 Mar 2010 08:46:37 -0600 (CST)
"Tejas N. Bhise" <tejas at gluster.com> wrote:

> Hi Stephan,
> [...]
> If not hand crafted, then please give the detailed testcase which can 
> lead to this situation based on just filesize.

Yet again, lets make the situation completely clear and transparent:
Is it true that there is code inside the fs (be it the one I pointed to or
elsewhere) that influences a self-heal decision based on the file size?

What is the use of this code concerning self heal:

static int
afr_sh_mark_biggest_as_source (afr_self_heal_t *sh, int child_count)
{
        int biggest = 0;
        int i;
   
        for (i = 0; i < child_count; i++) {
                if (SIZE_GREATER (&sh->buf[i], &sh->buf[biggest])) {
                        biggest = i;
                }
        }
 
        sh->sources[biggest] = 1;

        return 1;
}

xlators/cluster/afr/src/afr-self-heal.h:
#define SIZE_GREATER(buf1,buf2) ((((struct stat *)buf1)->st_size > (((struct stat *)buf2)->st_size)))

--
Regards,
Stephan







More information about the Gluster-devel mailing list