Bug 1618673 - [nfs-ganesha]read directory contents in chunks feature is disabled in ganesha 2.5.5-10 build
Summary: [nfs-ganesha]read directory contents in chunks feature is disabled in ganesha...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: nfs-ganesha
Version: rhgs-3.4
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: RHGS 3.5.0
Assignee: Jiffin
QA Contact: Manisha Saini
URL:
Whiteboard:
Depends On:
Blocks: 1696807
TreeView+ depends on / blocked
 
Reported: 2018-08-17 09:37 UTC by Vivek Das
Modified: 2019-10-30 12:15 UTC (History)
15 users (show)

Fixed In Version: nfs-ganesha-2.7.3-3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-30 12:15:39 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2019:3252 0 None None None 2019-10-30 12:15:56 UTC

Description Vivek Das 2018-08-17 09:37:46 UTC
Description of problem:

With the latest nfs-ganesha build "nfs-ganesha-2.5.5-10" the nfs-ganesha: Read directory contents in chunks is disabled and related parameter configuration is changed.

Version-Release number of selected component (if applicable):
nfs-ganesha-2.5.5-10

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:
readdir chunk is disabled in ganesha configuration

Expected results:
This was an feature request introduced for 3.4.0 and was validated by QE.

Additional info:

Comment 3 Daniel Gryniewicz 2018-08-17 14:25:48 UTC
It turns out readdir chunking, as currently implemented in Ganesha, cannot function correctly on Gluster.  It depends on stable d_off from readdir() across directory streams (opendir() -> closedir()), which is not something that Gluster can provide at this time.  Since this tends to work, especially for small or simple directory structures, this was not discovered until extensive testing was done.

This can be fixed, but not in a short timeframe.  It would have to delay the 3.4 release.

Comment 4 Kaleb KEITHLEY 2018-08-17 15:31:37 UTC
It is not correct to say it was validated by QE; to me that implies that it worked.

QE tested the feature and found it did not work correctly.

Also in discussions with Poornima we have learned that some of the assumptions that were made about glusterfs — and gfapi in particular — are not valid.

Comment 9 Kaleb KEITHLEY 2018-09-12 12:12:55 UTC
Dan has a partial fix which we will evaluate for potential inclusion in 3.4.1.

Comment 10 Soumya Koduri 2018-09-14 08:22:43 UTC
Just for my understanding, re-iterating few points -

Readdir chunking feature mainly addresses below issue -
(1) Earlier when one client does readdir, other client's fops involving lookup 
on any of those dirents get blocked till the entire traversal of directory is done (which was taking several hours to finish for larger workload)

(2) With readdir chunking, we read chunk by chunk and lock/unlock directory locks for every chunk so that other clients' operations continue in between.

(3) Now dirents are cached as part of dirent cache but each looked up entry with attributes is cached in md-cache.

As part of readdir chunk, while reading from a particular offset, if the entry is found in dirent cache but not in md-cache, we try to reload entire chunk (if fsal_readdir_plus option is enabled). Otherwise, we need to perform lookup for all the subsequent dirents in that chunk which could affect performance. 

This chunk reloading is what causing issue (- i.e, getting duplicate /missing entries) but not the readdir chunk feature to begin with. 

(4) Now with https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/425282, if we can disable fsal_readdir_plus for gluster, but keep readdir chunk feature enabled, only chunk reloading doesnt happen but issue#1 is still addressed as we still read dirents chunk by chunk. 

However this change may affect listing performance but should n't be worse when compared to disabling readdir chunk all together.

(5) Also, till now, dirent cache limit was to set to higher value when compared to md-cache limit. If we keep these 2 values same, do we still run into case#3?

Request Dan/Frank to provide comments and confirm if my understanding above is correct. Thanks!

Comment 11 Daniel Gryniewicz 2018-09-14 12:59:08 UTC
1.  Correct.  It also blocked the readdir in progress, not just other clients.

2. Correct.

3. The reloading-a-chunk feature enabled by fsal_readdir_plus is not the problem, it just reliably shows up the problem.  I can hit the problem with a straight chunked readdir without that feature under certain circumstances.  

4.  No, because just chunking is enough.

5.  Yes.

In addition to disabling fsal_readdir_plus, we also need to keep the dir FD open for the entire duration of the readdir.  I'm working on a patch for that.  This will get us part of the features of chunking:  The part where the initial load is broken up.  It won't, however, get us the ability to load a subset of the directory at need; if any chunk of the directory is recycled, then we need to toss the entire directory and reload it next time.  This will have a noticeable affect on large workloads.

In order to have full working chunking, Gluster needs to guarantee the order of dirents and offset of dirents are stable across readdirs (assuming that the directory is not changing, of course).

Comment 12 Soumya Koduri 2018-09-14 15:26:58 UTC
Thank you very much for the clarification Dan. Have one basic doubt though ..

(In reply to Daniel Gryniewicz from comment #11)

> 3. The reloading-a-chunk feature enabled by fsal_readdir_plus is not the
> problem, it just reliably shows up the problem.  I can hit the problem with
> a straight chunked readdir without that feature under certain circumstances.
> 
> 
> 4.  No, because just chunking is enough.
> 
> 5.  Yes.
> 
> In addition to disabling fsal_readdir_plus, we also need to keep the dir FD
> open for the entire duration of the readdir.  I'm working on a patch for
> that.  This will get us part of the features of chunking:  The part where
> the initial load is broken up.  It won't, however, get us the ability to
> load a subset of the directory at need; if any chunk of the directory is
> recycled, then we need to toss the entire directory and reload it next time.
> This will have a noticeable affect on large workloads.
> 
> In order to have full working chunking, Gluster needs to guarantee the order
> of dirents and offset of dirents are stable across readdirs (assuming that
> the directory is not changing, of course).

In that case, even without readdir chunk, we have new glfd open for each call of read_dirents() and are reading from certain offset. Then why is this issue not seen then or is it just that the chance of hitting it is very low without chunking?

Comment 13 Daniel Gryniewicz 2018-09-14 15:48:19 UTC
I wouldn't be surprised if it does fail without chunking.  I haven't tested that, because that code is gone from 2.6 and later.

My guess (and this is only a guess) is that it works because the time is very short, since MDCACHE loads the entire directory without any round-trips to the client.  This may be completely wrong, though.

Comment 14 Soumya Koduri 2018-09-14 16:28:08 UTC
(In reply to Daniel Gryniewicz from comment #13)
> I wouldn't be surprised if it does fail without chunking.  I haven't tested
> that, because that code is gone from 2.6 and later.
> 
> My guess (and this is only a guess) is that it works because the time is
> very short, since MDCACHE loads the entire directory without any round-trips
> to the client.  This may be completely wrong, though.

Okay .. so even in the current code (>=2.6), with readdir chunk disabled (Dir_Chunk=0), there are chances (though remote) that we could still get duplicate/missing entries ..right?

Comment 15 Daniel Gryniewicz 2018-09-14 16:31:09 UTC
Until my WIP lands, yes.  Probably even in 2.5.

Comment 28 errata-xmlrpc 2019-10-30 12:15:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:3252


Note You need to log in before you can comment on or make changes to this bug.