opencurve / curve

Curve is a sandbox project hosted by the CNCF Foundation. It's cloud-native, high-performance, and easy to operate. Curve is an open-source distributed storage system for block and shared file storage.
https://opencurve.io
Apache License 2.0
2.32k stars 522 forks source link

[curvefs] recycle blacklist or writelist #2230

Open cw123 opened 1 year ago

cw123 commented 1 year ago

Description:

当前curvefs已经有一个实现了基础功能的回收站,用来对误删除操作兜底。当文件从回收站删除之后,可以去回收站找回误删的文件。 如果所有删除的文件都进入回收站,可能会把存储系统的存储空间撑爆炸。 希望回收站能够增加一个白名单或者黑名单功能。 白名单:符合白名单条件的文件才会进入回收站,其他文件删除的时候直接删除。 黑名单:符合黑名单条件的文件不会进入回收站,删除的时候直接删除,其余文件删除时进入回收站。

Currently, curvefs already has a recycle bin that implements basic functions, which is used to cover accidental deletion operations. When files are deleted from the recycle bin, you can go to the recycle bin to retrieve the accidentally deleted files. If all deleted files go into the recycle bin, it may blow up the storage space of the storage system. I hope that the recycle bin can add a whitelist or blacklist function. Whitelist: Only files that meet the whitelist conditions will enter the recycle bin, and other files will be deleted directly when they are deleted. Blacklist: Files that meet the conditions of the blacklist will not enter the recycle bin, and will be deleted directly when deleted, and other files will enter the recycle bin when deleted.

Proposed solution:

白名单或者黑名单可通过配置文件配置,client挂载的时候,读取配置文件,获取回收站黑名单或者白名单。在client的fuse_client.cppCURVEFS_ERROR FuseClient::RemoveNode(fuse_req_t req, fuse_ino_t parent, const char *name, FsFileType type) 时候,判断文件是否需要进入回收站。

The whitelist or blacklist can be configured through the configuration file. When the client mounts, it reads the configuration file and obtains the blacklist or whitelist of the recycle bin. When CURVEFS_ERROR FuseClient::RemoveNode(fuse_req_t req, fuse_ino_t parent, const char *name, FsFileType type) of fuse_client.cpp of the client determines whether the file needs to enter the recycle bin.

Alipebt commented 1 year ago

I will try to do this .Please assign me.

ilixiaocui commented 1 year ago

Since the developer @Alipebt has more important matters and cannot continue this issue, interested students can continue to try.

CodeFarmerPK commented 1 year ago

I want to try to deal with this issue.

ilixiaocui commented 1 year ago

I want to try to deal with this issue.

welcome!

Cyber-SiKu commented 1 year ago

@CodeFarmerPK Have you encountered any difficulties?

CodeFarmerPK commented 1 year ago

@CodeFarmerPK Have you encountered any difficulties? I'm still deal with it, and i have a little trouble when build test environment. The recycle bin has been merged in branch release2.6 recently, and the earlier image can't biuld the test environment. When I made image with newest branch master, I can't create filesystem when mount. Now I'm trying to use branch release2.6 to create a new image to build test environment.

caoxianfei1 commented 1 year ago

@CodeFarmerPK Have you encountered any difficulties? I'm still deal with it, and i have a little trouble when build test environment. The recycle bin has been merged in branch release2.6 recently, and the earlier image can't biuld the test environment. When I made image with newest branch master, I can't create filesystem when mount. Now I'm trying to use branch release2.6 to create a new image to build test environment.

Is there any specific error message when using the image of master branch? And feel free to continue.

CodeFarmerPK commented 1 year ago

@CodeFarmerPK Have you encountered any difficulties? I'm still deal with it, and i have a little trouble when build test environment. The recycle bin has been merged in branch release2.6 recently, and the earlier image can't biuld the test environment. When I made image with newest branch master, I can't create filesystem when mount. Now I'm trying to use branch release2.6 to create a new image to build test environment.

Is there any specific error message when using the image of master branch? And feel free to continue.

No problem when I build image with branch master or branch release2.6. The earlier image given in document like "opencurvedocker/curve-base:build-debian9" does not support recycle bin.

And now I am not in work, I was sick for almost two weeks, ops.

CodeFarmerPK commented 1 year ago

I found the way to filter files when delete, but recycle bin has some other functions to do, and I am trying to design how to support other functions. For I do not have full time to deal with it, it will cost a lot of time.

CodeFarmerPK commented 1 year ago

The first version, I want to set witelist or black list when create fs. And next version I want to create a new tool for recycle bin configuration. Include witelist、blacklist、change recycletimehour and other functions. For that I don't know how to create tool now and I need to learn how to realize it. Any problem or suggestion for this programme?

CodeFarmerPK commented 1 year ago

I am under ill for almost one month, so this porblen has been delayed for so long, maybe it will still wait a long time to reslove for that I will not recover soon. But I still trying to learn the codes and deal with it.

caoxianfei1 commented 1 year ago

Ok, we temporarily unassigne to you, so that other people can choose this issue to deal with, but you can still continue. Also wish you a speedy recovery.

CodeFarmerPK commented 1 year ago

Ok, we temporarily unassigne to you, so that other people can choose this issue to deal with, but you can still continue. Also wish you a speedy recovery.

OK, but it is almost done now, and I am testing it.

caoxianfei1 commented 1 year ago

Ok, we temporarily unassigne to you, so that other people can choose this issue to deal with, but you can still continue. Also wish you a speedy recovery.

OK, but it is almost done now, and I am testing it.

Got it.

CodeFarmerPK commented 1 year ago

Finished function test and it works. And i am performing boundary and exception test to improve the codes, so I assign the issue to myself.

wuhongsong commented 1 year ago

@CodeFarmerPK doing now

caoxianfei1 commented 10 months ago

@CodeFarmerPK For a long time there was no corresponding work and we unassign to you.