<html><body><div style="font-family: garamond,new york,times,serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Bharathram Sivasubramanian" &lt;Bharathram.Sivasubramanian@vantrix.com&gt;<br><b>To: </b>"Krutika Dhananjay" &lt;kdhananj@redhat.com&gt;<br><b>Cc: </b>Gluster-users@gluster.org<br><b>Sent: </b>Saturday, April 11, 2015 7:26:27 AM<br><b>Subject: </b>Re: [Gluster-users] Question on file reads from a distributed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replicated volume<br><div><br></div><style style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; } @font-face { font-family: Wingdings; } @font-face { font-family: 'Cambria Math'; } @font-face { font-family: Calibri; } p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; } a:link, span.MsoHyperlink { color: rgb(5, 99, 193); text-decoration: underline; } a:visited, span.MsoHyperlinkFollowed { color: rgb(149, 79, 114); text-decoration: underline; } p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph { margin: 0cm 0cm 0.0001pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; } span.EmailStyle17 { font-family: Calibri, sans-serif; color: windowtext; } .MsoChpDefault { font-family: Calibri, sans-serif; } @page WordSection1 { margin: 72pt; } ol { margin-bottom: 0cm; } ul { margin-bottom: 0cm; }--></style><p>Thanks, Krutika!<br></p><p><br></p><p>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?</p></blockquote><div>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).</div><div><br></div><div>-Krutika</div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><p><br></p><div style="color: rgb(33, 33, 33);"><hr style="display:inline-block; width:98%"><div id="divRplyFwdMsg" dir="ltr"><span face="Calibri, sans-serif" color="#000000" data-mce-style="font-size: 11pt; color: #000000; font-family: Calibri, sans-serif;" style="font-size: 11pt; color: #000000; font-family: Calibri, sans-serif;"><b>From:</b> Krutika Dhananjay &lt;kdhananj@redhat.com&gt;<br>
<b>Sent:</b> Friday, April 10, 2015 9:30 PM<br>
<b>To:</b> Bharathram Sivasubramanian<br>
<b>Cc:</b> Gluster-users@gluster.org<br>
<b>Subject:</b> Re: [Gluster-users] Question on file reads from a distributed replicated volume</span></div><div><div style="font-family:garamond,new york,times,serif; font-size:12pt; color:#000000"><div><br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF; margin-left:5px; padding-left:5px; color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt"><b>From: </b>"Bharathram Sivasubramanian" &lt;Bharathram.Sivasubramanian@vantrix.com&gt;<br><b>To: </b>Gluster-users@gluster.org<br><b>Sent: </b>Saturday, April 11, 2015 3:03:48 AM<br><b>Subject: </b>[Gluster-users] Question on file reads from a distributed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replicated volume<br><div><br></div><style>
<!--
@font-face
        {font-family:Wingdings}
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:#954F72;
        text-decoration:underline}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
span.EmailStyle17
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.MsoChpDefault
        {font-family:"Calibri",sans-serif}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
ol
        {margin-bottom:0cm}
ul
        {margin-bottom:0cm}
-->
</style><div class="WordSection1"><p class="MsoNormal">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 &amp; 2. A gluster client would like to read this file. Which brick will the file come from? In other words:</p><p class="MsoListParagraph" style="text-indent:-18.0pt"><span style="">-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>Will the file always be fetched from brick 1?</p><p class="MsoListParagraph" style="text-indent:-18.0pt"><span style="">-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>Will the file always be fetched from brick 2?</p><p class="MsoListParagraph" style="text-indent:-18.0pt"><span style="">-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>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?</p></div></blockquote><div>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.&nbsp;<span style="font-size:12pt">Load
 balancing within a volume is done across different files wherein different files would have different but constant read children.</span></div><div><span style="font-size:12pt"><br>
</span></div><div><span style="font-size:12pt">-Krutika</span></div><blockquote style="border-left:2px solid #1010FF; margin-left:5px; padding-left:5px; color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
_______________________________________________<br>
Gluster-users mailing list<br>
Gluster-users@gluster.org<br>
http://www.gluster.org/mailman/listinfo/gluster-users</blockquote><div><br></div></div></div></div></blockquote><div><br></div></div></body></html>