-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix](inverted index) cloud mode supports time series #33414
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -49,7 +49,7 @@ int64_t CloudSizeBasedCumulativeCompactionPolicy::_level_size(const int64_t size | |||
return (int64_t)1 << (sizeof(size) * 8 - 1 - __builtin_clzl(size)); | |||
} | |||
|
|||
int CloudSizeBasedCumulativeCompactionPolicy::pick_input_rowsets( | |||
int32_t CloudSizeBasedCumulativeCompactionPolicy::pick_input_rowsets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'pick_input_rowsets' exceeds recommended size/complexity thresholds [readability-function-size]
int32_t CloudSizeBasedCumulativeCompactionPolicy::pick_input_rowsets(
^
Additional context
be/src/cloud/cloud_cumulative_compaction_policy.cpp:51: 127 lines including whitespace and comments (threshold 80)
int32_t CloudSizeBasedCumulativeCompactionPolicy::pick_input_rowsets(
^
@@ -213,4 +213,143 @@ | |||
: last_cumulative_point; | |||
} | |||
|
|||
int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'pick_input_rowsets' can be made static [readability-convert-member-functions-to-static]
int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets( | |
static int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets( |
@@ -213,4 +213,143 @@ | |||
: last_cumulative_point; | |||
} | |||
|
|||
int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'pick_input_rowsets' exceeds recommended size/complexity thresholds [readability-function-size]
int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
^
Additional context
be/src/cloud/cloud_cumulative_compaction_policy.cpp:215: 118 lines including whitespace and comments (threshold 80)
int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
^
|
||
virtual int32_t pick_input_rowsets(CloudTablet* tablet, | ||
const std::vector<RowsetSharedPtr>& candidate_rowsets, | ||
const int64_t max_compaction_score, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'max_compaction_score' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
const int64_t max_compaction_score, | |
int64_t max_compaction_score, |
virtual int32_t pick_input_rowsets(CloudTablet* tablet, | ||
const std::vector<RowsetSharedPtr>& candidate_rowsets, | ||
const int64_t max_compaction_score, | ||
const int64_t min_compaction_score, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'min_compaction_score' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
const int64_t min_compaction_score, | |
int64_t min_compaction_score, |
bool allow_delete = false); | ||
int32_t pick_input_rowsets(CloudTablet* tablet, | ||
const std::vector<RowsetSharedPtr>& candidate_rowsets, | ||
const int64_t max_compaction_score, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'max_compaction_score' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
const int64_t max_compaction_score, | |
int64_t max_compaction_score, |
int32_t pick_input_rowsets(CloudTablet* tablet, | ||
const std::vector<RowsetSharedPtr>& candidate_rowsets, | ||
const int64_t max_compaction_score, | ||
const int64_t min_compaction_score, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'min_compaction_score' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
const int64_t min_compaction_score, | |
int64_t min_compaction_score, |
|
||
int32_t pick_input_rowsets(CloudTablet* tablet, | ||
const std::vector<RowsetSharedPtr>& candidate_rowsets, | ||
const int64_t max_compaction_score, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'max_compaction_score' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
const int64_t max_compaction_score, | |
int64_t max_compaction_score, |
int32_t pick_input_rowsets(CloudTablet* tablet, | ||
const std::vector<RowsetSharedPtr>& candidate_rowsets, | ||
const int64_t max_compaction_score, | ||
const int64_t min_compaction_score, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'min_compaction_score' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
const int64_t min_compaction_score, | |
int64_t min_compaction_score, |
@@ -766,4 +770,12 @@ Status CloudStorageEngine::get_compaction_status_json(std::string* result) { | |||
return Status::OK(); | |||
} | |||
|
|||
std::shared_ptr<CloudCumulativeCompactionPolicy> CloudStorageEngine::cumu_compaction_policy( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'cumu_compaction_policy' can be made static [readability-convert-member-functions-to-static]
be/src/cloud/cloud_storage_engine.h:108:
- std::shared_ptr<CloudCumulativeCompactionPolicy> cumu_compaction_policy(
+ static std::shared_ptr<CloudCumulativeCompactionPolicy> cumu_compaction_policy(
TeamCity be ut coverage result: |
@@ -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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be checked whether there is a rowset containing the delete predicate. If so, return the score for base compaction.
// 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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These codes should be deleted. Single compaction will not occur in the cloud engine
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCompactionPolicy() return PropertyAnalyzer.SIZE_BASED_COMPACTION_POLICY.
b16e994
to
2d649c3
Compare
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -213,4 +213,135 @@ int64_t CloudSizeBasedCumulativeCompactionPolicy::new_cumulative_point( | |||
: last_cumulative_point; | |||
} | |||
|
|||
int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'pick_input_rowsets' exceeds recommended size/complexity thresholds [readability-function-size]
int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
^
Additional context
be/src/cloud/cloud_cumulative_compaction_policy.cpp:215: 110 lines including whitespace and comments (threshold 80)
int32_t CloudTimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
^
TeamCity be ut coverage result: |
2d649c3
to
c593220
Compare
run buildall |
TeamCity be ut coverage result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by anyone and no changes requested. |
PR approved by at least one committer and no changes requested. |
run p0 |
run cloud_p0 |
c593220
to
e922705
Compare
run buildall |
e922705
to
600e290
Compare
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
return 0; | ||
} | ||
|
||
int64_t CloudTimeSeriesCumulativeCompactionPolicy::new_compaction_level( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'new_compaction_level' can be made static [readability-convert-member-functions-to-static]
int64_t CloudTimeSeriesCumulativeCompactionPolicy::new_compaction_level( | |
static int64_t CloudTimeSeriesCumulativeCompactionPolicy::new_compaction_level( |
Version& last_delete_version, | ||
int64_t last_cumulative_point) override; | ||
|
||
int64_t new_compaction_level(const std::vector<RowsetSharedPtr>& input_rowsets) override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'new_compaction_level' can be made static [readability-convert-member-functions-to-static]
int64_t new_compaction_level(const std::vector<RowsetSharedPtr>& input_rowsets) override { | |
static int64_t new_compaction_level(const std::vector<RowsetSharedPtr>& input_rowsets) override { |
600e290
to
956e238
Compare
956e238
to
be8f4de
Compare
run buildall |
TeamCity be ut coverage result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...