<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 30, 2016 at 9:50 AM, Raghavendra Gowdappa <span dir="ltr">&lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Pranith Kumar Karampuri&quot; &lt;<a href="mailto:pkarampu@redhat.com">pkarampu@redhat.com</a>&gt;<br>
</span><span class="">&gt; To: &quot;Raghavendra Gowdappa&quot; &lt;<a href="mailto:rgowdapp@redhat.com">rgowdapp@redhat.com</a>&gt;<br>
&gt; Cc: &quot;Shyam Ranganathan&quot; &lt;<a href="mailto:srangana@redhat.com">srangana@redhat.com</a>&gt;, &quot;Nithya Balachandran&quot; &lt;<a href="mailto:nbalacha@redhat.com">nbalacha@redhat.com</a>&gt;, &quot;Gluster Devel&quot;<br>
&gt; &lt;<a href="mailto:gluster-devel@gluster.org">gluster-devel@gluster.org</a>&gt;<br>
</span><div><div class="h5">&gt; Sent: Friday, September 30, 2016 9:15:04 AM<br>
&gt; Subject: Re: Dht readdir filtering out names<br>
&gt;<br>
&gt; On Fri, Sep 30, 2016 at 9:13 AM, Raghavendra Gowdappa &lt;<a href="mailto:rgowdapp@redhat.com">rgowdapp@redhat.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt; &gt; dht_readdirp_cbk has different behaviour for directories and files.<br>
&gt; &gt;<br>
&gt; &gt; 1. If file, pick the dentry (passed from subvols as part of readdirp<br>
&gt; &gt; response) if the it corresponds to data file.<br>
&gt; &gt; 2. If directory pick the dentry if readdirp response is from hashed-subvol.<br>
&gt; &gt;<br>
&gt; &gt; In all other cases, the dentry is skipped and not passed to higher<br>
&gt; &gt; layers/application. To elaborate, the dentries which are ignored are:<br>
&gt; &gt; 1. dentries corresponding to linkto files.<br>
&gt; &gt; 2. dentries from non-hashed subvols corresponding to directories.<br>
&gt; &gt;<br>
&gt; &gt; Since the behaviour is different for different filesystem objects, dht<br>
&gt; &gt; needs ia_type to choose its behaviour.<br>
&gt; &gt;<br>
&gt; &gt; ----- Original Message -----<br>
&gt; &gt; &gt; From: &quot;Pranith Kumar Karampuri&quot; &lt;<a href="mailto:pkarampu@redhat.com">pkarampu@redhat.com</a>&gt;<br>
&gt; &gt; &gt; To: &quot;Shyam Ranganathan&quot; &lt;<a href="mailto:srangana@redhat.com">srangana@redhat.com</a>&gt;, &quot;Raghavendra Gowdappa&quot; &lt;<br>
&gt; &gt; <a href="mailto:rgowdapp@redhat.com">rgowdapp@redhat.com</a>&gt;, &quot;Nithya Balachandran&quot;<br>
&gt; &gt; &gt; &lt;<a href="mailto:nbalacha@redhat.com">nbalacha@redhat.com</a>&gt;<br>
&gt; &gt; &gt; Cc: &quot;Gluster Devel&quot; &lt;<a href="mailto:gluster-devel@gluster.org">gluster-devel@gluster.org</a>&gt;<br>
&gt; &gt; &gt; Sent: Friday, September 30, 2016 8:39:28 AM<br>
&gt; &gt; &gt; Subject: Dht readdir filtering out names<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; hi,<br>
&gt; &gt; &gt;        In dht_readdirp_cbk() there is a check about skipping files<br>
&gt; &gt; without<br>
&gt; &gt; &gt; ia_type. Could you help me understand why this check is added? There are<br>
&gt; &gt; &gt; times when users have to delete gfid of the entries and trigger something<br>
&gt; &gt; &gt; like &#39;find . | xargs stat&#39; to heal the gfids. This case would fail if we<br>
&gt; &gt; &gt; skip entries without gfid, if the lower xlators don&#39;t send stat<br>
&gt; &gt; information<br>
&gt; &gt; &gt; for them.<br>
&gt; &gt;<br>
&gt; &gt; Probably we can make readdirp_cbk not rely on ia_type and pass _all_<br>
&gt; &gt; dentries received by subvols to application without filtering. However we<br>
&gt; &gt; should make this behaviour optional and use this only for recovery setups.<br>
&gt; &gt; If we don&#39;t rely on ia_type (during non error scenarios), applications end<br>
&gt; &gt; up seeing duplicate dentries in readdir listing.<br>
&gt; &gt;<br>
&gt;<br>
&gt; That means dht_readdir() gives duplicate entries? As per the code it seems<br>
&gt; like it...<br>
<br>
</div></div>No. It follows the filtering logic of &quot;pick dentry only from hashed subvol&quot;. This logic doesn&#39;t need ia_type. Now, that you brought the topic of dht_readdir, I&#39;ve another solution for your use case (Basically don&#39;t use readdirp :) ):<br>
<br>
1. mount glusterfs with &quot;--use-readdirp=no&quot; option.<br>
2. disable md-cache/stat-prefetch as it converts all readdir calls into readdirp calls<br></blockquote><div><br></div><div>Probably the ones in dht as well? i.e. use-readdirp option.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Use this only for recovery setups :).<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt; Pranith<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; regards,<br>
&gt; &gt; Raghavendra<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Pranith<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Pranith<br></div></div>
</div></div>