Skip to content

Commit 63ce1bd

Browse files
[BugFix] Correct the profile for datacache write stats to represent the actual data statistics written to datacache (backport #48136) (#48148)
Co-authored-by: Gavin <[email protected]>
1 parent 7406f7f commit 63ce1bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

be/src/io/cache_input_stream.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

464464
bool 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

Comments
 (0)