@@ -251,7 +251,7 @@ Status CacheInputStream::_populate_to_cache(const int64_t offset, const int64_t
251251 options.allow_zero_copy = true ;
252252 }
253253 Status r = _cache->write_buffer (_cache_key, write_offset_cursor, write_size, src_cursor, &options);
254- if (r.ok () || r. is_already_exist () ) {
254+ if (r.ok ()) {
255255 _stats.write_cache_count += 1 ;
256256 _stats.write_cache_bytes += write_size;
257257 _stats.write_mem_cache_bytes += options.stats .write_mem_bytes ;
@@ -440,7 +440,7 @@ void CacheInputStream::_populate_cache_from_zero_copy_buffer(const char* p, int6
440440 options.allow_zero_copy = true ;
441441 }
442442 Status r = _cache->write_buffer (_cache_key, off, size, buf, &options);
443- if (r.ok () || r. is_already_exist () ) {
443+ if (r.ok ()) {
444444 _stats.write_cache_count += 1 ;
445445 _stats.write_cache_bytes += size;
446446 _stats.write_mem_cache_bytes += options.stats .write_mem_bytes ;
@@ -462,7 +462,8 @@ void CacheInputStream::_populate_cache_from_zero_copy_buffer(const char* p, int6
462462}
463463
464464bool CacheInputStream::_can_ignore_populate_error (const Status& status) const {
465- if (status.is_resource_busy () || status.is_mem_limit_exceeded () || status.is_capacity_limit_exceeded ()) {
465+ if (status.is_already_exist () || status.is_resource_busy () || status.is_mem_limit_exceeded () ||
466+ status.is_capacity_limit_exceeded ()) {
466467 return true ;
467468 }
468469 return false ;
0 commit comments