[LU-14361] Add support for statahead pattern with regularized file name Created: 25/Jan/21 Updated: 23/Jan/24 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Qian Yingjin | Assignee: | Qian Yingjin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | statahead | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||||||||||
| Description |
|
Some applications do stat() calls under a directory within which all the children files have regularized file name:
These applications call stat() on the files in the Alphabetic sorting order of the file name. This kind of metadata operations can not be optimized by current statahead mechanism. In current statahead mechanism, the stat() calls in the order of populate the dentries via readdir(). For the ldiskfs backend, it is ordering by the hash of the file name, not a kinds fo sorting oder. However, we can improve the statahead to support statahead pattern with regularized file name to optimize the metadata performance for the above applications |
| Comments |
| Comment by Gerrit Updater [ 25/Jan/21 ] |
|
Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/41308 |
| Comment by Gerrit Updater [ 26/Jan/21 ] |
|
Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/41319 |
| Comment by Gerrit Updater [ 22/Sep/22 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/48625 |
| Comment by Gerrit Updater [ 26/Oct/22 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/48954 |
| Comment by Andreas Dilger [ 25/Nov/22 ] |
|
One of the questions I had recently from a customer is whether this statahead would work with a filename that had numbers in the middle (e.g. "filename.12345.out" or similar) because the filename extension is needed for some programs to work correctly. The current version of the patch does not handle this correctly, but I could imagine that this can is detected fairly easily. Instead of just comparing numbers from the end of the filename, it should be possible to build a "format" of characters that are changing between two filenames (the byte offset of the first numeric character and the length, and the file suffix or an empty string if no suffix). The first filename would just be saved, then the second one would do a byte-by-byte comparison to find the first character that is different, then do a forward and backward search with isdigit() to find the first and last number in the filename. It would then use "snprintf(buf + start, sizeof(buf) "%*0u%s", len, index, suffix)" (or similar, with/without leading zeroes and fixed or variable width) to write the new index number into the middle (or end) of the filename. |
| Comment by Gerrit Updater [ 01/Dec/22 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49291 |
| Comment by Gerrit Updater [ 05/Jul/23 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51572 |
| Comment by Gerrit Updater [ 06/Jul/23 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51587 |
| Comment by Gerrit Updater [ 06/Jul/23 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51592 |
| Comment by Gerrit Updater [ 21/Jul/23 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51730 |
| Comment by Gerrit Updater [ 31/Aug/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/48625/ |
| Comment by Gerrit Updater [ 03/Nov/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51730/ |
| Comment by Gerrit Updater [ 08/Nov/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51572/ |
| Comment by Gerrit Updater [ 17/Nov/23 ] |
|
"Timothy Day <timday@amazon.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/53173 |
| Comment by Gerrit Updater [ 20/Dec/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/53173/ |
| Comment by Gerrit Updater [ 03/Jan/24 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/41308/ |
| Comment by Andreas Dilger [ 09/Jan/24 ] |
|
It looks like the newly-added sanity test_123i from patch https://review.whamcloud.com/41308 "LU-14361 statahead: regularized fname statahead pattern" is failing fairly often since the patch was landed (33/561 = 1/17 runs in the past week). Since the test is in sanity, it is run many times for each patch and much more likely to cause problems: |
| Comment by Qian Yingjin [ 10/Jan/24 ] |
|
The reason for these failures may be that @sbi->ll_sa_min is too small, the default value is #define LL_SA_REQ_MIN_DEF 8, it results in the stat-ahead is not so aggressive, too low hit rate and quit wrongly... Increasing this value in sanity/123i should fix the failure.
I will make a patch later. |
| Comment by Gerrit Updater [ 10/Jan/24 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/53634 |
| Comment by Gerrit Updater [ 23/Jan/24 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/53634/ |