-
Notifications
You must be signed in to change notification settings - Fork 522
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
[feat]curvefs/client:support warmup sym link #2723
Conversation
c6f18df
to
f40f641
Compare
@@ -57,7 +59,7 @@ bool WarmupManagerS3Impl::AddWarmupFilelist(fuse_ino_t key, | |||
} | |||
// add warmup Progress | |||
if (AddWarmupProcess(key, type)) { | |||
VLOG(9) << "add warmup list task:" << key; | |||
LOG(INFO) << "add warmup list task:" << key; |
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.
Will this log too much?
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.
Will this log too much?
Only when preheating is added, one will be output, which feels good.
@@ -83,7 +85,7 @@ bool WarmupManagerS3Impl::AddWarmupFile(fuse_ino_t key, const std::string &path, | |||
} | |||
// add warmup Progress | |||
if (AddWarmupProcess(key, type)) { | |||
VLOG(9) << "add warmup single task:" << key; | |||
LOG(INFO) << "add warmup single task:" << key; |
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.
ditto
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.
ditto
ditto
|
||
if (!curve::common::StringStartWith(file, "/")) { | ||
LOG(ERROR) << fmt::format("{} isn't absolute path", file); | ||
file.erase(0, 1); |
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 if it is not an absolute path? And what is the purpose of file.erase(0, 1);
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 if it is not an absolute path? And what is the purpose of
file.erase(0, 1);
If it is not an absolute path, the warm-up task will be skipped.
There should be a problem with the latter one, it has been fixed
// skip links | ||
std::string symLink; | ||
CURVEFS_ERROR statusCode = | ||
fuseOpReadLink_(0, dentry.inodeid(), &symLink); |
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.
Maybe nullptr is more readable than 0.
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.
Maybe nullptr is more readable than 0.
fix
@@ -302,7 +297,26 @@ void WarmupManagerS3Impl::FetchChildDentry(fuse_ino_t key, fuse_ino_t ino) { | |||
}; | |||
AddFetchDentryTask(key, task); | |||
VLOG(9) << "FetchChildDentry: " << dentry.inodeid(); | |||
} else if (FsFileType::TYPE_SYM_LINK == dentry.type()) { // need todo | |||
} else if (FsFileType::TYPE_SYM_LINK == dentry.type()) { |
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.
The logic of functions FetchDentry
and FetchChildDentry
is very similar, so you can consider abstracting the common parts.
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.
The logic of functions
FetchDentry
andFetchChildDentry
is very similar, so you can consider abstracting the common parts.
can't agree with you anymore @wuhongsong
@@ -719,6 +732,74 @@ void WarmupManager::CollectMetrics(InterfaceMetric *interface, int count, | |||
interface->latency << (butil::cpuwide_time_us() - start); | |||
} | |||
|
|||
bool WarmupManagerS3Impl::GetInodeSubPathParent( |
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.
If there are source files and corresponding link files in the preheating directory, will the file be preheated multiple times?
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.
If there are source files and corresponding link files in the preheating directory, will the file be preheated multiple times?
This depends on the situation:
If it is preheated to diskcache, although it will still be preheated, it will be skipped because diskcache has the logic to determine whether the cache exists.
However, there is no corresponding logic for kvcache, and it will be warmed up repeatedly.
continue; | ||
} | ||
std::string lastName = splitSymLink.back(); | ||
auto task = [this, key, parent, lastName]() { |
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.
task
isn't being used.
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.
task
isn't being used.
fix
* @return false: subPath isn't belong to inode | ||
*/ | ||
bool GetInodeSubPathParent(fuse_ino_t inode, | ||
std::vector<std::string> subPath, |
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.
std::vector<std::string> subPath, | |
const std::vector<std::string>& subPath, |
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.
subPath will modify in function
LOG(ERROR) << "get inode fail, inodeid = " << inode; | ||
return false; | ||
} | ||
curve::common::UniqueLock lck = inodeWrapper->GetUniqueLock(); |
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.
do we support this case, e.g.,
fsmount/
-> A(symlink to ../fsmount/B)
-> B
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.
do we support this case, e.g.,
fsmount/ -> A(symlink to ../fsmount/B) -> B
no
splitSymLink.end()); | ||
nextInode = inode; | ||
} else { | ||
nextInode = dentry.inodeid(); |
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.
It's better to use iterative approach instead of recursion.
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.
It's better to use iterative approach instead of recursion.
Here is to analyze the soft link, I don't think there will be too deep level calls. However, this can be modified. if you insist
9178a68
to
76d61c1
Compare
cicheck |
76d61c1
to
01b0968
Compare
cicheck |
1 similar comment
cicheck |
01b0968
to
d0d384f
Compare
add feat support symlink by fuseOpReadLink Signed-off-by: Cyber-SiKu <[email protected]>
d0d384f
to
3be0880
Compare
cicheck |
5 similar comments
cicheck |
cicheck |
cicheck |
cicheck |
cicheck |
cicheck |
What problem does this PR solve?
Issue Number: #xxx
Problem Summary:
What is changed and how it works?
What's Changed:
How it Works:
Side effects(Breaking backward compatibility? Performance regression?):
Check List