-
Notifications
You must be signed in to change notification settings - Fork 312
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
refactor: improve the single-responsibility of class fs_manager #1477
Conversation
f187ca9
to
ae54a7a
Compare
94b929f
to
8610b58
Compare
@@ -67,14 +68,14 @@ const std::string kFolderSuffixBak = ".bak"; | |||
const std::string kFolderSuffixOri = ".ori"; | |||
const std::string kFolderSuffixTmp = ".tmp"; | |||
|
|||
error_s disk_remove_useless_dirs(const std::vector<std::string> &data_dirs, | |||
error_s disk_remove_useless_dirs(const std::vector<std::shared_ptr<dir_node>> &dir_nodes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using weak_ptr
instead of shared_ptr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary. If supporting to remove dir_node from fs manager, we have to make sure it's safe to access the dir_node in disk_remove_useless_dirs() even if it has been removed, std::shared_ptr is safe in this case.
LGT1. (^_^)v |
#1383
This patch moves some functions to fs_manager which are more reasonable to be
responsibilities of class fs_manager rather than those of class replica_stub.
A new configuration is added:
[replication] + ignore_broken_disk = true