[Gluster-users] Question on file reads from a distributed replicated volume
Krutika Dhananjay
kdhananj at redhat.com
Sat Apr 11 02:07:00 UTC 2015
----- Original Message -----
> From: "Bharathram Sivasubramanian" <Bharathram.Sivasubramanian at vantrix.com>
> To: "Krutika Dhananjay" <kdhananj at redhat.com>
> Cc: Gluster-users at gluster.org
> Sent: Saturday, April 11, 2015 7:26:27 AM
> Subject: Re: [Gluster-users] Question on file reads from a distributed
> replicated volume
> Thanks, Krutika!
> So, if I understand you correctly...if both Brick 1 and Brick 2 have a good
> copy of the file, then we can't tell for sure if the file will be read only
> from Brick 1 all the time and not Brick 2? in other words, for read#1, the
> file could be read from brick 2 and for another read which could happen a
> few minutes later, the file could be read from brick 1?
Nope. For a given file, read requests will always be served from the same brick. This means that in your example, both read #1 and read #2 will served from the same brick, which is the read child of the file. In 3.6.0 and above, the read child of a file is computed by applying a hash function on its GFID, which means it is always guaranteed to give the same value (because the gfid of a file will remain the same throughout its lifetime, needless to say).
-Krutika
> From: Krutika Dhananjay <kdhananj at redhat.com>
> Sent: Friday, April 10, 2015 9:30 PM
> To: Bharathram Sivasubramanian
> Cc: Gluster-users at gluster.org
> Subject: Re: [Gluster-users] Question on file reads from a distributed
> replicated volume
> ----- Original Message -----
> > From: "Bharathram Sivasubramanian" <Bharathram.Sivasubramanian at vantrix.com>
>
> > To: Gluster-users at gluster.org
>
> > Sent: Saturday, April 11, 2015 3:03:48 AM
>
> > Subject: [Gluster-users] Question on file reads from a distributed
> > replicated
> > volume
>
> > Let us assume that we have a distributed replicated gluster volume with 4
> > bricks. Brick 1 is replicating its data with Brick 2 and Brick 3 is
> > replicating its data with Brick 4. Suppose a file called aa.txt is present
> > and replicated on Bricks 1 & 2. A gluster client would like to read this
> > file. Which brick will the file come from? In other words:
>
> > - Will the file always be fetched from brick 1?
>
> > - Will the file always be fetched from brick 2?
>
> > - Will the file be fetched from brick 1 or 2 depending on the attempt? i.e.
> > is there some load balancing where sometimes the file comes from brick 1
> > and
> > at other times the file will come from brick 2?
>
> A given file will consistently be "read" from one of the N (in this case 2)
> replicas, as long as it holds a good copy of the file (that which does not
> need heal), even with client restart. We call it the "read child" of the
> file. Load balancing within a volume is done across different files wherein
> different files would have different but constant read children.
> -Krutika
> > _______________________________________________
>
> > Gluster-users mailing list
>
> > Gluster-users at gluster.org
>
> > http://www.gluster.org/mailman/listinfo/gluster-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gluster.org/pipermail/gluster-users/attachments/20150410/666600a6/attachment.html>
More information about the Gluster-users
mailing list