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

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 8c4f2597e3e branch-3.0: [improve](group commit)Print file size when 
replaying wal #50688 (#50949)
8c4f2597e3e is described below

commit 8c4f2597e3e4b75a0f2d3b1c49ebf60a1ab9ccce
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri May 16 20:32:27 2025 +0800

    branch-3.0: [improve](group commit)Print file size when replaying wal 
#50688 (#50949)
    
    Cherry-picked from #50688
    
    Co-authored-by: huanghaibin <[email protected]>
---
 be/src/olap/wal/wal_table.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/wal/wal_table.cpp b/be/src/olap/wal/wal_table.cpp
index 84cf7afd4d3..a671717b50f 100644
--- a/be/src/olap/wal/wal_table.cpp
+++ b/be/src/olap/wal/wal_table.cpp
@@ -87,14 +87,22 @@ Status WalTable::_relay_wal_one_by_one() {
     std::vector<std::shared_ptr<WalInfo>> need_retry_wals;
     for (auto wal_info : _replaying_queue) {
         wal_info->add_retry_num();
-        auto st = _replay_wal_internal(wal_info->get_wal_path());
+        Status st;
+        int64_t file_size = 0;
+        std::filesystem::path file_path(wal_info->get_wal_path());
+        if (!std::filesystem::exists(file_path)) {
+            st = Status::InternalError("wal file {} does not exist", 
wal_info->get_wal_path());
+        } else {
+            file_size = std::filesystem::file_size(file_path);
+            st = _replay_wal_internal(wal_info->get_wal_path());
+        }
         auto msg = st.msg();
         if (st.ok() || st.is<ErrorCode::PUBLISH_TIMEOUT>() || 
st.is<ErrorCode::NOT_FOUND>() ||
             st.is<ErrorCode::DATA_QUALITY_ERROR>() ||
             (msg.find("has already been used") != msg.npos &&
              (msg.find("COMMITTED") != msg.npos || msg.find("VISIBLE") != 
msg.npos))) {
             LOG(INFO) << "succeed to replay wal=" << wal_info->get_wal_path()
-                      << ", st=" << st.to_string();
+                      << ", st=" << st.to_string() << ", file size=" << 
file_size;
             // delete wal
             WARN_IF_ERROR(_exec_env->wal_mgr()->delete_wal(_table_id, 
wal_info->get_wal_id()),
                           "failed to delete wal=" + wal_info->get_wal_path());


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to