Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
Signed-off-by: tangruilin <[email protected]>
  • Loading branch information
Tangruilin committed Nov 21, 2022
1 parent 8ac6bd5 commit c311b33
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions curvefs/src/client/s3/client_s3_cache_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2202,8 +2202,6 @@ CURVEFS_ERROR DataCache::Flush(uint64_t inodeId, bool toS3) {
RCache,
WRCache,
} cachePoily = cachePoily::NCache;
bool mayCache = !s3ClientAdaptor_->GetDiskCacheManager()
->IsDiskCacheFull() && !toS3;

VLOG(9) << "DataCache::Flush : now:" << now << ",createTime:" << createTime_
<< ",flushIntervalSec:" << flushIntervalSec
Expand Down Expand Up @@ -2233,9 +2231,13 @@ CURVEFS_ERROR DataCache::Flush(uint64_t inodeId, bool toS3) {
<< ",Len:" << tmpLen << ",blockPos:" << blockPos
<< ",blockIndex:" << blockIndex;

if (s3ClientAdaptor_->IsReadCache() && mayCache) {
if (s3ClientAdaptor_->IsReadCache() &&
!s3ClientAdaptor_->GetDiskCacheManager()
->IsDiskCacheFull() && !toS3) {
cachePoily = cachePoily::RCache;
} else if (s3ClientAdaptor_->IsReadWriteCache() && mayCache) {
} else if (s3ClientAdaptor_->IsReadWriteCache() &&
!s3ClientAdaptor_->GetDiskCacheManager()
->IsDiskCacheFull() && !toS3) {
cachePoily = cachePoily::WRCache;
} else {
cachePoily = cachePoily::NCache;
Expand Down

0 comments on commit c311b33

Please sign in to comment.