Copilot commented on code in PR #59583:
URL: https://github.com/apache/doris/pull/59583#discussion_r2663403259
##########
be/src/olap/wal/wal_manager.cpp:
##########
@@ -204,9 +205,12 @@ size_t WalManager::get_wal_queue_size(int64_t table_id) {
}
} else {
// table_id is -1 meaning get all table wal size
+ size_t max_count = 0;
for (auto& [_, table_wals] : _wal_queues) {
count += table_wals.size();
+ max_count = std::max(max_count, table_wals.size());
}
+ g_wal_max_count_per_table.set_value(max_count);
Review Comment:
The metric g_wal_max_count_per_table is only updated when table_id is -1
(when querying all tables), but this means the metric could become stale if
get_wal_queue_size is frequently called with specific table_id values and
rarely with -1. Consider also updating this metric in add_wal_queue and
erase_wal_queue methods, or ensuring this function is called regularly with
table_id = -1 to keep the metric current.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]