This is an automated email from the ASF dual-hosted git repository.
airborne 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 f4a98a72f82 [fix] (compaction) fix time series (#38791) (#39053)
f4a98a72f82 is described below
commit f4a98a72f82f07192b7cbe3644f6bdec3c0a6424
Author: Sun Chenyang <[email protected]>
AuthorDate: Fri Aug 9 15:03:07 2024 +0800
[fix] (compaction) fix time series (#38791) (#39053)
## Proposed changes
pick from master #38791
---
be/src/olap/compaction.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp
index 126cc961a0b..d7f28436800 100644
--- a/be/src/olap/compaction.cpp
+++ b/be/src/olap/compaction.cpp
@@ -308,7 +308,11 @@ Status Compaction::do_compaction_impl(int64_t permits) {
int64_t now = UnixMillis();
if (compaction_type() == ReaderType::READER_CUMULATIVE_COMPACTION) {
- _tablet->set_last_cumu_compaction_success_time(now);
+ // TIME_SERIES_POLICY, generating an empty rowset doesn't need to
update the timestamp.
+ if (!(_tablet->tablet_meta()->compaction_policy() ==
CUMULATIVE_TIME_SERIES_POLICY &&
+ _output_rowset->num_segments() == 0)) {
+ _tablet->set_last_cumu_compaction_success_time(now);
+ }
} else if (compaction_type() == ReaderType::READER_BASE_COMPACTION) {
_tablet->set_last_base_compaction_success_time(now);
} else if (compaction_type() == ReaderType::READER_FULL_COMPACTION) {
@@ -616,7 +620,11 @@ Status Compaction::do_compaction_impl(int64_t permits) {
int64_t now = UnixMillis();
// TODO(yingchun): do the judge in Tablet class
if (compaction_type() == ReaderType::READER_CUMULATIVE_COMPACTION) {
- _tablet->set_last_cumu_compaction_success_time(now);
+ // TIME_SERIES_POLICY, generating an empty rowset doesn't need to
update the timestamp.
+ if (!(_tablet->tablet_meta()->compaction_policy() ==
CUMULATIVE_TIME_SERIES_POLICY &&
+ _output_rowset->num_segments() == 0)) {
+ _tablet->set_last_cumu_compaction_success_time(now);
+ }
} else if (compaction_type() == ReaderType::READER_BASE_COMPACTION) {
_tablet->set_last_base_compaction_success_time(now);
} else if (compaction_type() == ReaderType::READER_FULL_COMPACTION) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]