gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gluster-devel] Load Banalancing in AFR


From: nicolas prochazka
Subject: [Gluster-devel] Load Banalancing in AFR
Date: Thu, 2 Apr 2009 15:13:33 +0200

Hello,
in afr.c i can read :

afr_first_up_child function which is always call, but if i understand,
there's no load balancing in afr, just the first child up is taken.
Can I just implement a Round Robin function to alternate between child
up or it's more complicated ?

Regards,
Nicolas Prochazka

 /*
  first_up_child - return the index of the first child that is up
 /

int
afr_first_up_child (afr_private_t *priv)
{
 xlator_t * children = NULL;
 int         ret      = -1;
 int         i        = 0;

 LOCK (&priv->lock);
 {
  children = priv->children;
  for (i = 0; i < priv->child_count; i++) {
   if (priv->child_up[i]) {
    ret = i;
    break;
   }
  }
 }
 UNLOCK (&priv->lock);

 return ret;
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]