You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2022/12/02 12:15:38 UTC
[doris] branch branch-1.1-lts updated: [improvement](compaction) use read lock in set cu point (#14766)
This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-1.1-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.1-lts by this push:
new f367b73609 [improvement](compaction) use read lock in set cu point (#14766)
f367b73609 is described below
commit f367b7360905cf61ff0e3e55ba25a37634e228a5
Author: yixiutt <10...@users.noreply.github.com>
AuthorDate: Fri Dec 2 20:15:30 2022 +0800
[improvement](compaction) use read lock in set cu point (#14766)
---
be/src/olap/tablet.cpp | 2 +-
be/src/olap/tablet.h | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 2ffaebd0b3..3c471178e5 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -859,7 +859,7 @@ void Tablet::_max_continuous_version_from_beginning_unlocked(Version* version, V
}
void Tablet::calculate_cumulative_point() {
- WriteLock wrlock(_meta_lock);
+ ReadLock wrlock(_meta_lock);
int64_t ret_cumulative_point;
_cumulative_compaction_policy->calculate_cumulative_point(
this, _tablet_meta->all_rs_metas(), _cumulative_point, &ret_cumulative_point);
diff --git a/be/src/olap/tablet.h b/be/src/olap/tablet.h
index d4e9d54693..847132b628 100644
--- a/be/src/olap/tablet.h
+++ b/be/src/olap/tablet.h
@@ -395,10 +395,12 @@ inline const int64_t Tablet::cumulative_layer_point() const {
inline void Tablet::set_cumulative_layer_point(int64_t new_point) {
// cumulative point should only be reset to -1, or be increased
- CHECK(new_point == Tablet::K_INVALID_CUMULATIVE_POINT || new_point >= _cumulative_point)
- << "Unexpected cumulative point: " << new_point
+ if (new_point == Tablet::K_INVALID_CUMULATIVE_POINT || new_point >= _cumulative_point){
+ _cumulative_point = new_point;
+ } else {
+ LOG(WARNING) << "Unexpected cumulative point: " << new_point
<< ", origin: " << _cumulative_point.load();
- _cumulative_point = new_point;
+ }
}
// TODO(lingbin): Why other methods that need to get information from _tablet_meta
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org