From e26c54a469e28b627ab44707a5d8aa0a095a17e9 Mon Sep 17 00:00:00 2001
From: sryan yuan <sryan@qq.com>
Date: Fri, 15 Nov 2024 21:50:09 +0800
Subject: [PATCH] fix(cmd): always print ok log when get full data file info
 failed (#2663)

Co-authored-by: yxj25245 <yxj25245@ly.com>
Co-authored-by: hulk <hulk.website@gmail.com>
---
 src/commands/cmd_replication.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/commands/cmd_replication.cc b/src/commands/cmd_replication.cc
index 4d46e11d9ff..290b1261f5f 100644
--- a/src/commands/cmd_replication.cc
+++ b/src/commands/cmd_replication.cc
@@ -232,11 +232,11 @@ class CommandFetchMeta : public Commander {
       std::string files;
       auto s = engine::Storage::ReplDataManager::GetFullReplDataInfo(srv->storage, &files);
       if (!s.IsOK()) {
+        LOG(WARNING) << "[replication] Failed to get full data file info: " << s.Msg();
         s = util::SockSend(repl_fd, redis::Error({Status::RedisErrorNoPrefix, "can't create db checkpoint"}), bev);
         if (!s.IsOK()) {
           LOG(WARNING) << "[replication] Failed to send error response: " << s.Msg();
         }
-        LOG(WARNING) << "[replication] Failed to get full data file info: " << s.Msg();
         return;
       }
       // Send full data file info