Skip to content
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

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

zzzxl1993
Copy link
Contributor

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...

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@zzzxl1993
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a 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(
Copy link
Contributor

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(
Copy link
Contributor

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]

Suggested change
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(
Copy link
Contributor

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,
Copy link
Contributor

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]

Suggested change
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,
Copy link
Contributor

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]

Suggested change
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,
Copy link
Contributor

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]

Suggested change
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,
Copy link
Contributor

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]

Suggested change
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,
Copy link
Contributor

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]

Suggested change
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,
Copy link
Contributor

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]

Suggested change
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(
Copy link
Contributor

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(

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.57% (8888/24985)
Line Coverage: 27.32% (72984/267156)
Region Coverage: 26.48% (37725/142440)
Branch Coverage: 23.29% (19225/82536)
Coverage Report: http://coverage.selectdb-in.cc/coverage/b16e9947d10d3d4804014efd41ac21b68f3a5fca_b16e9947d10d3d4804014efd41ac21b68f3a5fca/report/index.html

@@ -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) {
Copy link
Contributor

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(
Copy link
Contributor

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;
Copy link
Contributor

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.

@zzzxl1993
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a 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(
Copy link
Contributor

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(
                                                   ^

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.63% (8906/24993)
Line Coverage: 27.36% (73147/267379)
Region Coverage: 26.52% (37802/142525)
Branch Coverage: 23.32% (19258/82590)
Coverage Report: http://coverage.selectdb-in.cc/coverage/2d649c3091e2afac1c1cd1cc50435a011f41db2b_2d649c3091e2afac1c1cd1cc50435a011f41db2b/report/index.html

@zzzxl1993
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.63% (8906/24993)
Line Coverage: 27.35% (73140/267379)
Region Coverage: 26.52% (37798/142525)
Branch Coverage: 23.32% (19258/82590)
Coverage Report: http://coverage.selectdb-in.cc/coverage/c59322002d904f6c2909c51edb79ab5253d77bde_c59322002d904f6c2909c51edb79ab5253d77bde/report/index.html

Copy link
Contributor

@csun5285 csun5285 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

PR approved by anyone and no changes requested.

@qidaye qidaye changed the title [fix](inverted index) cloud mod supports time series [fix](inverted index) cloud mode supports time series Apr 10, 2024
qidaye
qidaye previously approved these changes Apr 10, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 10, 2024
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@zzzxl1993
Copy link
Contributor Author

run p0

@zzzxl1993
Copy link
Contributor Author

run cloud_p0

@zzzxl1993
Copy link
Contributor Author

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Apr 10, 2024
@zzzxl1993
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a 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(
Copy link
Contributor

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]

Suggested change
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 {
Copy link
Contributor

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]

Suggested change
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 {

@zzzxl1993
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.66% (8910/24986)
Line Coverage: 27.37% (73166/267340)
Region Coverage: 26.53% (37806/142501)
Branch Coverage: 23.33% (19266/82584)
Coverage Report: http://coverage.selectdb-in.cc/coverage/be8f4debb0774480a939d331746ea77eeec81928_be8f4debb0774480a939d331746ea77eeec81928/report/index.html

Copy link
Contributor

@csun5285 csun5285 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qidaye qidaye merged commit 62a5bc3 into apache:master Apr 10, 2024
23 of 29 checks passed
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 10, 2024
Copy link
Contributor

PR approved by at least one committer and no changes requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/3.0.0-merged meta-change reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants