csun5285 commented on code in PR #33414:
URL: https://github.com/apache/doris/pull/33414#discussion_r1557349755
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -409,6 +410,10 @@ Result<std::unique_ptr<RowsetWriter>>
CloudTablet::create_transient_rowset_write
}
int64_t CloudTablet::get_cloud_base_compaction_score() const {
+ if (_tablet_meta->compaction_policy() == CUMULATIVE_TIME_SERIES_POLICY) {
Review Comment:
It should be checked whether there is a rowset containing the delete
predicate. If so, return the score for base compaction.
##########
be/src/cloud/cloud_cumulative_compaction_policy.cpp:
##########
@@ -213,4 +213,143 @@ int64_t
CloudSizeBasedCumulativeCompactionPolicy::new_cumulative_point(
: last_cumulative_point;
}
+int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
+ CloudTablet* tablet, const std::vector<RowsetSharedPtr>&
candidate_rowsets,
+ const int64_t max_compaction_score, const int64_t min_compaction_score,
+ std::vector<RowsetSharedPtr>* input_rowsets, Version*
last_delete_version,
+ size_t* compaction_score, bool allow_delete) {
+ if (tablet->tablet_state() == TABLET_NOTREADY) {
+ return 0;
+ }
+
+ int64_t compaction_goal_size_mbytes =
+ tablet->tablet_meta()->time_series_compaction_goal_size_mbytes();
+
+ int transient_size = 0;
+ *compaction_score = 0;
+ input_rowsets->clear();
+ int64_t total_size = 0;
+
+ // when single replica compaction is enabled and BE1 fetchs merged rowsets
from BE2, and then BE2 goes offline.
+ // BE1 should performs compaction on its own, the time series compaction
may re-compact previously fetched rowsets.
+ // time series compaction policy needs to skip over the fetched rowset
+ const auto& first_rowset_iter = std::find_if(
Review Comment:
These codes should be deleted. Single compaction will not occur in the cloud
engine
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java:
##########
@@ -2194,7 +2194,7 @@ public Long getTimeSeriesCompactionGoalSizeMbytes() {
if (tableProperty != null) {
return tableProperty.timeSeriesCompactionGoalSizeMbytes();
}
- return null;
+ return
PropertyAnalyzer.TIME_SERIES_COMPACTION_GOAL_SIZE_MBYTES_DEFAULT_VALUE;
Review Comment:
getCompactionPolicy() return PropertyAnalyzer.SIZE_BASED_COMPACTION_POLICY.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]