This is an automated email from the ASF dual-hosted git repository.
airborne pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 5db41841786 [fix] (compaction) fix time series (#38791) (#39052)
5db41841786 is described below
commit 5db41841786a5244235af9211af074f2cb6c46e3
Author: Sun Chenyang <[email protected]>
AuthorDate: Fri Aug 9 15:02:58 2024 +0800
[fix] (compaction) fix time series (#38791) (#39052)
## 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 849db757ac0..2256d1c304e 100644
--- a/be/src/olap/compaction.cpp
+++ b/be/src/olap/compaction.cpp
@@ -333,7 +333,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) {
@@ -748,7 +752,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]