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] Clean up resources after failing to create fs #2043

Closed
cw123 opened this issue Nov 4, 2022 · 8 comments
Closed

[curvefs] Clean up resources after failing to create fs #2043

cw123 opened this issue Nov 4, 2022 · 8 comments
Assignees
Labels
good first issue Good for newcomers need test Completion of development, requires QA verification nocitest Modifications such as documents do not require CI testing

Comments

@cw123
Copy link
Contributor

cw123 commented Nov 4, 2022

curve文件系统在CreateFs时,会创建一些资源,包括创建一个fsinfo,创建partition,创建root inode等。当后面的步骤失败了,需要清理掉前面步骤创建的资源。当前的代码实现中,有一些资源在执行失败的时候没有删除,希望这些资源能够被清理。

When the curve file system creates Fs, it will create some resources, including creating a fsinfo, creating a partition, creating a root inode, etc. When the later steps fail, the resources created in the previous steps need to be cleaned up. In the current code implementation, some resources are not deleted when the execution fails, and it is hoped that these resources can be cleaned up.

CreateFs的代码在:

the code is here:

https://github.com/opencurve/curve/blob/master/curvefs/src/mds/fs_manager.cpp

FSStatusCode FsManager::CreateFs(const ::curvefs::mds::CreateFsRequest* request,
                                 FsInfo* fsInfo) {
    ......
@wpy-321
Copy link

wpy-321 commented Nov 10, 2022

Hello, I want to participate

@wuhongsong
Copy link
Contributor

@wpy-321 Are you having some trouble? If so, please let us know so that we can communicate together

@wuhongsong
Copy link
Contributor

@wpy-321

@Ziy1-Tan
Copy link
Contributor

Ziy1-Tan commented Jan 9, 2023

Some rough ideas:

  • Clean the partition:
    • Define the TopologyManager::DeletePartition by passing the partitionId to wrap TopologyManager::DeletePartition in CreateFs
  • Clean the fs
    • Calling the FsStorage::Delete by passing the fsName
  • Clean the root inode
    • I cound not find function to delete root inode in MetaserverClient, what should I do next?
    • MetaserverClient::DeleteInode need uint64_t inodeId, Is the root inode id 1?

@ilixiaocui
Copy link
Contributor

Hello, I want to participate

cc @wpy-321 Due to no reply for a long time, cancel the assignment first. Welcome to continue to join if you have time!

@cw123
Copy link
Contributor Author

cw123 commented Jan 9, 2023

Some rough ideas:

  • Clean the partition:

    • Define the TopologyManager::DeletePartition by passing the partitionId to wrap TopologyManager::DeletePartition in CreateFs
  • Clean the fs

    • Calling the FsStorage::Delete by passing the fsName
  • Clean the root inode

    • I cound not find function to delete root inode in MetaserverClient, what should I do next?
    • MetaserverClient::DeleteInode need uint64_t inodeId, Is the root inode id 1?

you can use MetaserverClient::DeleteInode to delete root inode.

root inode is 1, but you should not use 1 directly. You can use uint64_t FsManager::GetRootId(); to get root inode id

@Ziy1-Tan
Copy link
Contributor

Ziy1-Tan commented Jan 9, 2023

Some rough ideas:

  • Clean the partition:

    • Define the TopologyManager::DeletePartition by passing the partitionId to wrap TopologyManager::DeletePartition in CreateFs
  • Clean the fs

    • Calling the FsStorage::Delete by passing the fsName
  • Clean the root inode

    • I cound not find function to delete root inode in MetaserverClient, what should I do next?
    • MetaserverClient::DeleteInode need uint64_t inodeId, Is the root inode id 1?

you can use MetaserverClient::DeleteInode to delete root inode.

root inode is 1, but you should not use 1 directly. You can use uint64_t FsManager::GetRootId(); to get root inode id

Thx a lot! I will continue to it, assign me plz :).

@wuhongsong
Copy link
Contributor

@Ziy1-Tan just do it

@wuhongsong wuhongsong added need test Completion of development, requires QA verification nocitest Modifications such as documents do not require CI testing labels Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers need test Completion of development, requires QA verification nocitest Modifications such as documents do not require CI testing
Projects
None yet
Development

No branches or pull requests

5 participants