This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 1995b5da3d0 [fix](Cooldown) Enhance calculate logic of
_has_data_to_cooldown #30244 (#35429)
1995b5da3d0 is described below
commit 1995b5da3d068a6ea121d4b843f415ecc8409a3c
Author: AlexYue <[email protected]>
AuthorDate: Mon May 27 17:50:25 2024 +0800
[fix](Cooldown) Enhance calculate logic of _has_data_to_cooldown #30244
(#35429)
---
be/src/olap/tablet.cpp | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 0d1898a5999..db635554b00 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -2449,19 +2449,30 @@ bool Tablet::_has_data_to_cooldown() {
int64_t min_local_version = std::numeric_limits<int64_t>::max();
RowsetSharedPtr rowset;
std::shared_lock meta_rlock(_meta_lock);
+ // Ususally once the tablet has done cooldown successfully then the first
+ // rowset would always be remote rowset
+ bool has_cooldowned = false;
+ for (const auto& [_, rs] : _rs_version_map) {
+ if (!rs->is_local()) {
+ has_cooldowned = true;
+ break;
+ }
+ }
for (auto& [v, rs] : _rs_version_map) {
- if (rs->is_local() && v.first < min_local_version &&
rs->data_disk_size() > 0) {
+ auto predicate = rs->is_local() && v.first < min_local_version;
+ if (!has_cooldowned) {
+ predicate = predicate && (rs->data_disk_size() > 0);
+ }
+ if (predicate) {
// this is a local rowset and has data
min_local_version = v.first;
rowset = rs;
}
}
-
int64_t newest_cooldown_time = 0;
if (rowset != nullptr) {
newest_cooldown_time = _get_newest_cooldown_time(rowset);
}
-
return (newest_cooldown_time != 0) && (newest_cooldown_time <
UnixSeconds());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]