From 021f80ce73d35dc5f95b4b674f7d824816908e27 Mon Sep 17 00:00:00 2001 From: huanghaibin <284824253@qq.com> Date: Wed, 20 Mar 2024 19:06:07 +0800 Subject: [PATCH] [improvement](group_comit) Add bvar to monitor the total wal count on disk (#31646) --- be/src/olap/wal/wal_manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/be/src/olap/wal/wal_manager.cpp b/be/src/olap/wal/wal_manager.cpp index cce5d14d69e17e..0df70919078d75 100644 --- a/be/src/olap/wal/wal_manager.cpp +++ b/be/src/olap/wal/wal_manager.cpp @@ -17,6 +17,7 @@ #include "olap/wal/wal_manager.h" +#include #include #include @@ -38,6 +39,9 @@ #include "vec/exec/format/wal/wal_reader.h" namespace doris { + +bvar::Status g_wal_total_count("wal_total_count", 0); + WalManager::WalManager(ExecEnv* exec_env, const std::string& wal_dir_list) : _exec_env(exec_env), _stop(false), @@ -299,6 +303,7 @@ Status WalManager::_load_wals() { Status WalManager::_scan_wals(const std::string& wal_path, std::vector& res) { bool exists = false; + auto last_total_size = res.size(); std::vector dbs; Status st = io::global_local_filesystem()->list(wal_path, false, &dbs, &exists); if (!st.ok()) { @@ -362,7 +367,8 @@ Status WalManager::_scan_wals(const std::string& wal_path, std::vector