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

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

commit 06fe865bb97e2d13aa7e9a5430f24bb7d1968268
Author: huanghaibin <284824...@qq.com>
AuthorDate: Thu Feb 8 10:19:00 2024 +0800

    [fix](group_commit) Wal file should be removed from _wal_path_map when 
renaming it to tmp directory (#30974)
---
 be/src/olap/wal/wal_manager.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/be/src/olap/wal/wal_manager.cpp b/be/src/olap/wal/wal_manager.cpp
index 59e87fba9c1..49fbbfa43bc 100644
--- a/be/src/olap/wal/wal_manager.cpp
+++ b/be/src/olap/wal/wal_manager.cpp
@@ -535,6 +535,15 @@ Status WalManager::rename_to_tmp_path(const std::string 
wal, int64_t table_id, i
         return Status::InternalError("rename fail on path " + wal);
     }
     LOG(INFO) << "rename wal from " << wal << " to " << wal_path.string();
+    {
+        std::lock_guard<std::shared_mutex> wrlock(_wal_path_lock);
+        auto it = _wal_path_map.find(wal_id);
+        if (it != _wal_path_map.end()) {
+            _wal_path_map.erase(wal_id);
+        } else {
+            LOG(WARNING) << "can't find " << wal_id << " in _wal_path_map when 
trying to rename";
+        }
+    }
     erase_wal_queue(table_id, wal_id);
     return Status::OK();
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to