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

[fix]curvefs/client: warmup process #2887

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions curvefs/src/client/warmup/warmup_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ bool WarmupManagerS3Impl::AddWarmupFilelist(fuse_ino_t key,
return false;
}
// add warmup Progress
if (AddWarmupProcess(key, path, type)) {
WriteLockGuard lock(inode2ProgressMutex_);
if (AddWarmupProcessLocked(key, path, type)) {
LOG(INFO) << "add warmup list task:" << key;
WriteLockGuard lock(warmupFilelistDequeMutex_);
auto iter = FindWarmupFilelistByKeyLocked(key);
Expand All @@ -96,7 +97,8 @@ bool WarmupManagerS3Impl::AddWarmupFile(fuse_ino_t key, const std::string& path,
return false;
}
// add warmup Progress
if (AddWarmupProcess(key, path, type)) {
WriteLockGuard lock(inode2ProgressMutex_);
if (AddWarmupProcessLocked(key, path, type)) {
LOG(INFO) << "add warmup single task:" << key;
FetchDentryEnqueue(key, path);
}
Expand Down
5 changes: 2 additions & 3 deletions curvefs/src/client/warmup/warmup_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,8 @@ class WarmupManager {
* @return true
* @return false warmupProcess has been added
*/
virtual bool AddWarmupProcess(fuse_ino_t key, const std::string& path,
WarmupStorageType type) {
WriteLockGuard lock(inode2ProgressMutex_);
virtual bool AddWarmupProcessLocked(
fuse_ino_t key, const std::string& path, WarmupStorageType type) {
auto retPg = inode2Progress_.emplace(key, WarmupProgress(type, path));
return retPg.second;
}
Expand Down