Skip to content
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] add new "getfattr -n curve.dir.recursive_rfbytes" command #2093

Closed
cw123 opened this issue Nov 21, 2022 · 3 comments
Closed

[curvefs] add new "getfattr -n curve.dir.recursive_rfbytes" command #2093

cw123 opened this issue Nov 21, 2022 · 3 comments
Assignees
Labels
enhancement improve feature good first issue Good for newcomers pending

Comments

@cw123
Copy link
Contributor

cw123 commented Nov 21, 2022

当curvefs mount的时候,会指定 enableSumInDir,来决定是否需要开启在inode的xattr属性中更新目录下的文件长度的统计信息。这个记录目录下的文件每次更新length的时候更新,可以在统计目录的下所有文件的长度时进行加速。

现在的代码实现中,在多挂载的时候,这个统计值可能不准,希望新增一个getxattr命令,每次查询目录下所有文件的长度统计信息时,不要从属性中读取,而是递归遍历目录下的所有文件。

When the curvefs is mounted, enableSumInDir will be specified to determine whether to enable the statistical information of the file length in the update directory in the xattr attribute of the inode. The files in this record directory are updated every time the length is updated, which can speed up the length of all files in the directory.

In the current code implementation, this statistical value may be inaccurate when there are multiple mounts. I hope to add a getxattr command. When querying the length statistics of all files in the directory, do not read from the attribute, but recursively Traverse all files in the directory.

相关的代码在:

The relevant code is at:

curvefs/src/client/xattr_manager.cpp

CURVEFS_ERROR XattrManager::GetXattr(const char* name, std::string *value,
    InodeAttr *attr, bool enableSumInDir) 

原来的用法:

The original usage:

getfattr -n curve.dir.rfbytes -d dirname

希望新增一个:

Hope to add one:

getfattr -n curve.dir.recursive_rfbytes -d dirname

@cw123 cw123 added enhancement improve feature good first issue Good for newcomers labels Nov 21, 2022
@cw123 cw123 changed the title curvefs client modify enableSumInDir by gflag [curvefs] add new "getfattr -n curve.dir.recursive_rfbytes" command Nov 22, 2022
@CodeFarmerPK
Copy link
Contributor

By reading the codes, i found that the total bytes is added by InodeWrapper.
Does this issue mean that the total bytes is added by existed files directly?

@CodeFarmerPK
Copy link
Contributor

@cw123
Can you give me some suggestions?

@ilixiaocui
Copy link
Contributor

@CodeFarmerPK Are you still following up on this issue? If yes, you can add storage sig for more convenient contact?Please note the issueid when entering the group.

image

In addition, this problem is the same as #2094,So this issue is closed first, we can continue the discussion under #2094

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve feature good first issue Good for newcomers pending
Projects
None yet
Development

No branches or pull requests

4 participants