Replies inline<br><br><div class="gmail_quote">On Mon Dec 15 2014 at 12:46:41 PM Shyam &lt;<a href="mailto:srangana@redhat.com">srangana@redhat.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With the changes present in [1] and [2],<br>
<br>
A short explanation of the change would be, we encode the subvol ID in<br>
the d_off, losing &#39;n + 1&#39; bits in case the high order n+1 bits of the<br>
underlying xlator returned d_off is not free. (Best to read the commit<br>
message for [1] :) )<br>
<br>
Although not related to the latest patch, here is something to consider<br>
for the future:<br>
<br>
We now have DHT, AFR, EC(?), DHT over DHT (Tier) which need subvol<br>
encoding in the returned readdir offset. Due to this, the loss in bits<br>
_may_ cause unwanted offset behavior, when used in the current scheme.<br>
As we would end up eating more bits than what we do at present.<br>
<br>
Or IOW, we could be invalidating the assumption &quot;both EXT4/XFS are<br>
tolerant in terms of the accuracy of the value presented<br>
back in seekdir().</blockquote><div><br></div><div>XFS has not been a problem, since it always returns 32bit d_off. With Ext4, it has been noted that it is tolerant to sacrificing the lower bits in accuracy.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> i.e, a seekdir(val) actually seeks to the entry which<br>
has the &quot;closest&quot; true offset.&quot;<br>
<br>
Should we reconsider an in memory _cookie_ like approach that can help<br>
in this case?<br>
<br>
It would invalidate (some or all based on the implementation) the<br>
following constraints that the current design resolves, (from, [1])<br>
- Nothing to &quot;remember in memory&quot; or evict &quot;old entries&quot;.<br>
- Works fine across NFS server reboots and also NFS head failover.<br>
- Tolerant to seekdir() to arbitrary locations.<br>
<br>
But, would provide a more reliable readdir offset for use (when valid<br>
and not evicted, say).<br>
<br>
How would NFS adapt to this? Does Ganesha need a better scheme when<br>
doing multi-head NFS fail over?<br></blockquote><div><br></div><div>Ganesha just offloads the responsibility to the FSAL layer to give stable dir cookies (as it rightly should)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thoughts?<br>
<br></blockquote><div><br></div><div>I think we need to analyze the actual assumption/problem here. Remembering things in memory comes with the limitations you note above, and may after all, still not be necessary. Let&#39;s look at the two approaches taken:</div><div><br></div><div>- Small backend offsets: like XFS, the offsets fit in 32bits, and we are left with another 32bits of freedom to encode what we want. There is no problem here until our nested encoding requirements cross 32bits of space. So let&#39;s ignore this for now.</div><div><br></div><div>- Large backend offsets: Ext4 being the primary target. Here we observe that the backend filesystem is tolerant to sacrificing the accuracy of lower bits. So we overwrite the lower bits with our subvolume encoding information, and the number of bits used to encode is implicit in the subvolume cardinality of that translator. While this works fine with a single transformation, it is clearly a problem when the transformation is nested with the same algorithm. The reason is quite simple: while the lower bits were disposable when the cookie was taken fresh from Ext4, once transformed the same lower bits are now &quot;holy&quot; and cannot be overwritten carelessly, at least without dire consequences. The higher level xlators need to take up the &quot;next higher bits&quot;, past the previous transformation boundary, to encode the next subvolume information. Once the d_off transformation algorithms are fixed to give such due &quot;respect&quot; to the lower layer&#39;s transformation and use a different real estate, we might actually notice that the problem may not need such a deep redesign after all.</div><div><br></div><div>Hope that helps</div><div>Thanks</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Shyam<br>
[1] <a href="http://review.gluster.org/#/c/4711/" target="_blank">http://review.gluster.org/#/c/<u></u>4711/</a><br>
[2] <a href="http://review.gluster.org/#/c/8201/" target="_blank">http://review.gluster.org/#/c/<u></u>8201/</a><br>
______________________________<u></u>_________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="http://supercolony.gluster.org/mailman/listinfo/gluster-devel" target="_blank">http://supercolony.gluster.<u></u>org/mailman/listinfo/gluster-<u></u>devel</a><br>
</blockquote></div>