[LU-16463] llapi_open_by_fid open should not be cached systematically Created: 12/Jan/23 Updated: 03/Jul/23 Resolved: 23/Feb/23 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.16.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Etienne Aujames | Assignee: | Etienne Aujames |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Severity: | 3 | ||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||
| Description |
|
llapi_open_by_fid() uses open_by_handle_at() since https://review.whamcloud.com/36603 ("LU-8585 llapi: use open_by_handle_at in llapi_open_by_fid"). But handle are used by NFS and cache open in that case to limit the number of open-close (close are sent to MDT only on lock conflict or cache shrinks, http://review.whamcloud.com/20354). This breaks the llsom_sync util, because it used llapi_open_by_fid and "trusted.som" xattrs are synchronized on close requests: [root@client client]# touch test [root@client client]# dd if=/dev/zero of=test bs=1M count=1 1+0 records in 1+0 records out 1048576 bytes (1.0 MB) copied, 0.00145669 s, 720 MB/s [root@client client]# lfs getsom test && stat test file: test size: 1048576 blocks: 0 flags: 4 File: ‘test’ Size: 1048576 Blocks: 2048 IO Block: 4194304 regular file Device: 481510a2h/1209340066d Inode: 144115205507383305 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2023-01-12 11:22:03.000000000 +0100 Modify: 2023-01-12 11:22:07.000000000 +0100 Change: 2023-01-12 11:22:07.000000000 +0100 Birth: - [root@client client]# cat test [root@client client]# lfs getsom test && stat test file: test size: 1048576 blocks: 2048 flags: 4 <---- updated File: ‘test’ Size: 1048576 Blocks: 2048 IO Block: 4194304 regular file Device: 481510a2h/1209340066d Inode: 144115205507383305 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2023-01-12 11:22:27.000000000 +0100 Modify: 2023-01-12 11:22:07.000000000 +0100 Change: 2023-01-12 11:22:07.000000000 +0100 Birth: - [root@client client]# dd if=/dev/zero of=test bs=1M count=2 conv=notrunc 2+0 records in 2+0 records out 2097152 bytes (2.1 MB) copied, 0.00210231 s, 998 MB/s [root@client client]# lfs getsom test && stat test file: test size: 2097152 blocks: 2048 flags: 4 File: ‘test’ Size: 2097152 Blocks: 4096 IO Block: 4194304 regular file Device: 481510a2h/1209340066d Inode: 144115205507383305 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2023-01-12 11:22:27.000000000 +0100 Modify: 2023-01-12 11:23:02.000000000 +0100 Change: 2023-01-12 11:23:02.000000000 +0100 Birth: - [root@client client]# llsom_sync -u cl11 -m lustrefs-MDT0000 /media/lustrefs/client Start to sync 1 records. [root@client client]# lfs getsom test && stat test file: test size: 2097152 blocks: 2048 flags: 4 <---- not updated File: ‘test’ Size: 2097152 Blocks: 4096 IO Block: 4194304 regular file Device: 481510a2h/1209340066d Inode: 144115205507383305 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2023-01-12 11:22:27.000000000 +0100 Modify: 2023-01-12 11:23:02.000000000 +0100 Change: 2023-01-12 11:23:02.000000000 +0100 Birth: - [root@client client]# cat test [root@client client]# lfs getsom test && stat test file: test size: 2097152 blocks: 2048 flags: 4 <---- not updated File: ‘test’ Size: 2097152 Blocks: 4096 IO Block: 4194304 regular file Device: 481510a2h/1209340066d Inode: 144115205507383305 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2023-01-12 11:24:29.000000000 +0100 Modify: 2023-01-12 11:23:02.000000000 +0100 Change: 2023-01-12 11:23:02.000000000 +0100 Birth: - This is not seen by "sanity test 807" because https://review.whamcloud.com/32158 "LU-10948 llite: Introduce inode open heat counter" clears lock caches before calling "lfs getsom" (in check_lsom_data/check_lsom_size). |
| Comments |
| Comment by James A Simmons [ 12/Jan/23 ] |
|
Can you try patch https://review.whamcloud.com/#/c/fs/lustre-release/+/49237 |
| Comment by Etienne Aujames [ 12/Jan/23 ] |
I have read the patch, that should work. |
| Comment by Gerrit Updater [ 12/Jan/23 ] |
|
"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49616 |
| Comment by James A Simmons [ 12/Jan/23 ] |
|
Personally I like to see us move away from opencache since its rarely needed anymore. Let me update my patch. Now I don't like your idea of using a flag I could see passing in an open count limit. By default it would be zero but it would allow the user to cache the open if they wanted after a certain open count. That would be powerful. |
| Comment by Gerrit Updater [ 23/Feb/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/49237/ |
| Comment by Peter Jones [ 23/Feb/23 ] |
|
Landed for 2.16 |
| Comment by Gerrit Updater [ 03/Jul/23 ] |
|
"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51540 |