This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 6c60669e5 fix(replication): check the status of listing checkpoint 
files (#3158)
6c60669e5 is described below

commit 6c60669e527bc1d0f79ddedd537a4a25f02d1ba3
Author: Jonah Gao <[email protected]>
AuthorDate: Wed Sep 3 13:03:43 2025 +0800

    fix(replication): check the status of listing checkpoint files (#3158)
---
 CMakeLists.txt         | 1 -
 src/storage/storage.cc | 6 +++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08504b6d7..7d7a175c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,6 @@ option(ENABLE_OPENSSL "enable openssl to support tls 
connection" OFF)
 option(ENABLE_LTO "enable link-time optimization" ON)
 set(SYMBOLIZE_BACKEND "" CACHE STRING "symbolization backend library for 
cpptrace (libbacktrace, libdwarf, or empty)")
 set(PORTABLE 0 CACHE STRING "build a portable binary (disable arch-specific 
optimizations)")
-# TODO: set ENABLE_NEW_ENCODING to ON when we are ready
 option(ENABLE_NEW_ENCODING "enable new encoding (#1033) for storing 64bit size 
and expire time in milliseconds" ON)
 
 # to save build time in debug mode
diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index 2f204c506..b8d068dab 100644
--- a/src/storage/storage.cc
+++ b/src/storage/storage.cc
@@ -1153,7 +1153,11 @@ Status 
Storage::ReplDataManager::GetFullReplDataInfo(Storage *storage, std::stri
 
   // Get checkpoint file list
   std::vector<std::string> result;
-  storage->env_->GetChildren(data_files_dir, &result);
+  auto s = storage->env_->GetChildren(data_files_dir, &result);
+  if (!s.ok()) {
+    warn("[storage] Failed to list checkpoint files. Error: {}", s.ToString());
+    return {Status::NotOK, s.ToString()};
+  }
   for (const auto &f : result) {
     if (f == "." || f == "..") continue;
 

Reply via email to