This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 03af99507c3 branch-4.0: [fix](filecache) fix disk size calculation in
block_file_cache_factory #60644 (#60706)
03af99507c3 is described below
commit 03af99507c38c7790c2e0b9e6fc5e01128c6fb52
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Feb 13 09:57:08 2026 +0800
branch-4.0: [fix](filecache) fix disk size calculation in
block_file_cache_factory #60644 (#60706)
Cherry-picked from #60644
Co-authored-by: zhengyu <[email protected]>
---
be/src/io/cache/block_file_cache_factory.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/be/src/io/cache/block_file_cache_factory.cpp
b/be/src/io/cache/block_file_cache_factory.cpp
index 15b7880a718..315e8bb829d 100644
--- a/be/src/io/cache/block_file_cache_factory.cpp
+++ b/be/src/io/cache/block_file_cache_factory.cpp
@@ -94,8 +94,9 @@ Status FileCacheFactory::create_file_cache(const std::string&
cache_base_path,
LOG_ERROR("").tag("file cache path", cache_base_path).tag("error",
strerror(errno));
return Status::IOError("{} statfs error {}", cache_base_path,
strerror(errno));
}
+ const auto block_size = stat.f_frsize ? stat.f_frsize : stat.f_bsize;
size_t disk_capacity =
static_cast<size_t>(static_cast<size_t>(stat.f_blocks) *
-
static_cast<size_t>(stat.f_bsize));
+
static_cast<size_t>(block_size));
if (file_cache_settings.capacity == 0 || disk_capacity <
file_cache_settings.capacity) {
LOG_INFO(
"The cache {} config size {} is larger than disk size {}
or zero, recalc "
@@ -252,8 +253,9 @@ std::string validate_capacity(const std::string& path,
int64_t new_capacity,
valid_capacity = 0; // caller will handle the error
return ret;
}
+ const auto block_size = stat.f_frsize ? stat.f_frsize : stat.f_bsize;
size_t disk_capacity =
static_cast<size_t>(static_cast<size_t>(stat.f_blocks) *
-
static_cast<size_t>(stat.f_bsize));
+
static_cast<size_t>(block_size));
if (new_capacity == 0 || disk_capacity < new_capacity) {
auto ret = fmt::format(
"The cache {} config size {} is larger than disk size {} or
zero, recalc "
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]