-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[curvefs] When the fs mount is mounted multiple times with different enableSumInDir switches, the xattr information recorded in the metadata will be inaccurate #2094
Comments
assign |
Are you having some trouble? If so, please let us know so that we can communicate together @tangwz |
@wuhongsong Sorry I'm too busy this week, I will try to finish it this week. |
@tangwz keep going when you have time ? If you're still busy, you can do it later. |
cc @tangwz Is this issue still being followed up? Did you encounter any problems? |
I'm doing this these days. I'm reading the code and think how to do it. |
@ilixiaocui How about if |
curve/curvefs/src/client/xattr_manager.cpp Line 423 in 740debe
CalOneLayerSumInfo need calculate all files and directories under the current directory FastCalOneLayerSumInfo and FastCalAllLayerSumInfo only need get statistics from sumdirs' xattr, because every dir xattr have recorded one layer statistics. You can read the design document: https://github.com/opencurve/curve/blob/master/docs/cn/curvefs_summary_xattr.md |
So, we can
How about this ? |
I actually don't understand what your problem is.
|
@tangwz Keep talking and figure it out? |
/unassign |
any one want to take it ? |
I want to try it. |
@bit-dance Are you still going on? |
Yes,and i am trying to test in my local fs but had some build questions and struggled in this step. |
|
curvefs 有个特性,为了加快getfattr查询目录下的所有文件的length的长度之和,使用了一个enableSumInDir的特性,当开启这个开关的时候,每次在目录下创建、删除文件,修改文件的长度的时候,都会在目录的attr字段中更新相应的字段。可以在curvefs/src/client/fuse_client.cpp 搜索
enableSumInDir_
查看对应的实现逻辑。但是,如果一个fs,挂载了多次,且挂载的时候,有时开启这个特性,有时不开这个特性,就会造成文件的长度信息统计不准。需要想办法避免这种情况。怎么才能在开启这个特性的时候让这个值保持准确?或者,怎么才能在这个统计值不准的时候,不要使用这个值,而是通过遍历所有文件的方式统计数据,来避免拿到错误的数据?
Curvefs has a feature. In order to speed up getfattr to query the sum of the lengths of all files in the directory, a feature of enableSumInDirt is used. When this switch is turned on, every time a file is created or deleted in the directory, the length of the file is modified. At any time, the corresponding field will be updated in the attr field of the directory. You can search
enableSumInDir_
in curvefs/src/client/fuse_client.cpp to view the corresponding implementation logic.However, if an fs is mounted multiple times, and when mounting, sometimes this feature is enabled, and sometimes this feature is not enabled, the statistics of the length information of the file will be inaccurate. A way needs to be found to avoid this. How can I keep this value accurate when this feature is turned on? Or, how can we not use this value when the statistical value is inaccurate, but get the data by traversing all files to avoid getting wrong data?
The text was updated successfully, but these errors were encountered: