From 2a6150b057d7fb5be2aa62683e217cfc8ad49ae2 Mon Sep 17 00:00:00 2001 From: xy Date: Fri, 5 Jan 2024 18:59:09 +0800 Subject: [PATCH] [optimize](cooldown)If cooldowned_rowsets is empty, there is no need to follow the logic of traversing the files (#27324) Co-authored-by: xingying01 --- be/src/olap/tablet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index d6d4888fd6..da9d8c5b01 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -2553,6 +2553,9 @@ void Tablet::remove_unused_remote_files() { cooldowned_rowsets.insert(rs_meta->rowset_id()); } } + if (cooldowned_rowsets.empty()) { + return; + } cooldown_meta_id = t->_tablet_meta->cooldown_meta_id(); } auto [cooldown_replica_id, cooldown_term] = t->cooldown_conf();