diff --git a/curvefs/src/client/s3/client_s3_cache_manager.cpp b/curvefs/src/client/s3/client_s3_cache_manager.cpp index b5c4bb3fc3..a2a5101c53 100644 --- a/curvefs/src/client/s3/client_s3_cache_manager.cpp +++ b/curvefs/src/client/s3/client_s3_cache_manager.cpp @@ -989,7 +989,7 @@ CURVEFS_ERROR FileCacheManager::Flush(bool force, bool toS3) { }; std::vector> flushTasks; auto iter = tmp.begin(); - VLOG(6) << "flush size is: " << tmp.size(); + VLOG(0) << "whs: flush size is: " << tmp.size(); for (; iter != tmp.end(); iter++) { auto context = std::make_shared(); context->inode = inode_; @@ -999,13 +999,12 @@ CURVEFS_ERROR FileCacheManager::Flush(bool force, bool toS3) { flushTasks.emplace_back(context); } pendingReq.fetch_add(flushTasks.size(), std::memory_order_seq_cst); - for (auto iter = flushTasks.begin(); - iter != flushTasks.end(); ++iter) { - s3ClientAdaptor_->Enqueue(*iter); - } - if (pendingReq.load(std::memory_order_seq_cst)) { VLOG(6) << "wait for pendingReq"; + for (auto iter = flushTasks.begin(); + iter != flushTasks.end(); ++iter) { + s3ClientAdaptor_->Enqueue(*iter); + } cond.Wait(); } VLOG(6) << "file cache flush over";