[Gluster-devel] Patch for "Striped" read from AFR volumes

Krishna Srinivas krishna at zresearch.com
Tue Jan 1 06:14:56 UTC 2008


It is possible to include Gergo's patch and give it as a feature.
Gergo/Szekelyi are you interested in making this change to the latest TLA source
and test out the results? (because we need to make sure that
we have a test case where the change has advantages)

The change is pretty simple, just see the way afrfdp->rchild is
used to decide on the read() child.

in afr_readv():

  i = afrfdp->rchild;
  if (i == -1 || afrfdp->fdstate[i] == 0) {
    for (i = 0; i < child_count; i++) {
      if (afrfdp->fdstate[i] && pvt->state[i])
	break;
    }
  }
// ADD THESE 4 LINES
  if (i != child_count) {
    /* on the next readv call, readv from next child */
    afrfdp->rchild = (i + 1) % child_count;
  }
  GF_DEBUG (this, "reading from child %d", i);

Regards,
Krishna

On Jan 1, 2008 1:36 AM, Székelyi Szabolcs <cc at avaxio.hu> wrote:
> Krishna Srinivas wrote:
> > No, even for large files associating a file with a node will be better
> > conceptually.
> > (we need to take advantage of kernel read ahead algorithm)
> >
> > The case where this will fail is if majority of the files that are opened get
> > scheduled to the same node (as we decide the read child based on the
> > inode number)
> > But by taking the "law of averages" this is fine and will work quite well.
>
> Yes, as long as you have several files to read from. But in the case of
> a few big files -- such as a typical database or videos for a streaming
> application -- it could be better to let all nodes cache the same file
> and do rr-reads.
>
> Isn't it possible to include Gergo's patch as a feature that can be
> enabled or disabled in the volume specification file?
>
> Regards,
> --
> cc
>
>





More information about the Gluster-devel mailing list