You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "wrlcke (via GitHub)" <gi...@apache.org> on 2026/01/18 13:01:26 UTC
[PR] [chore](be) refactor long lambdas into functions [doris]
wrlcke opened a new pull request, #60001:
URL: https://github.com/apache/doris/pull/60001
Extracted several long lambda functions into file-scope or private member functions. Some that are tightly coupled with local variables or fitting better within the function context were left unchanged.
### What problem does this PR solve?
Issue Number: close #59843
Related PR: #xxx
Problem Summary:
Overly long lambdas reduce readability and make the code harder to maintain.
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3769629590
# BE Regression && UT Coverage Report
Increment line coverage `48.04% (784/1632)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/60001_497243270200c932fd73c90e2a8b539662b89701_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/60001_497243270200c932fd73c90e2a8b539662b89701_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.41% (25446/35632) |
| Line Coverage | 53.90% (265105/491868) |
| Region Coverage | 51.51% (220545/428151) |
| Branch Coverage | 52.96% (94766/178937) |
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3765416511
after finishing all works you think necessary, you can make this draft ready and run buildall
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3798295755
# BE Regression && UT Coverage Report
Increment line coverage `51.45% (869/1689)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/60001_e8c7d07b50049499565b3029f15cea4566bf0dd7_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/60001_e8c7d07b50049499565b3029f15cea4566bf0dd7_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 73.12% (26126/35732) |
| Line Coverage | 56.14% (277064/493510) |
| Region Coverage | 53.79% (231103/429629) |
| Branch Coverage | 55.53% (99749/179626) |
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3797120218
<details>
<summary>ClickBench: <b>Total hot run time: 27.05 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit e8c7d07b50049499565b3029f15cea4566bf0dd7, data reload: false
query1 0.05 0.04 0.04
query2 0.10 0.04 0.04
query3 0.26 0.08 0.08
query4 1.60 0.12 0.11
query5 0.29 0.26 0.24
query6 1.15 0.67 0.66
query7 0.04 0.03 0.03
query8 0.05 0.04 0.04
query9 0.58 0.51 0.49
query10 0.56 0.55 0.56
query11 0.14 0.09 0.10
query12 0.14 0.11 0.11
query13 0.61 0.59 0.57
query14 0.95 0.95 0.94
query15 0.78 0.77 0.78
query16 0.39 0.42 0.39
query17 0.98 1.02 1.04
query18 0.23 0.21 0.21
query19 1.89 1.89 1.89
query20 0.02 0.01 0.01
query21 15.41 0.27 0.13
query22 4.94 0.06 0.05
query23 15.79 0.28 0.10
query24 1.14 0.46 0.71
query25 0.11 0.07 0.08
query26 0.14 0.13 0.13
query27 0.08 0.05 0.05
query28 3.76 1.09 0.88
query29 12.55 3.86 3.18
query30 0.28 0.14 0.12
query31 2.82 0.62 0.41
query32 3.24 0.56 0.45
query33 2.97 3.02 3.07
query34 16.38 5.12 4.43
query35 4.52 4.48 4.44
query36 0.66 0.51 0.49
query37 0.10 0.06 0.07
query38 0.08 0.04 0.04
query39 0.04 0.03 0.03
query40 0.16 0.14 0.13
query41 0.10 0.04 0.03
query42 0.05 0.03 0.03
query43 0.05 0.04 0.04
Total cold run time: 96.18 s
Total hot run time: 27.05 s
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3797101590
<details>
<summary>TPC-H: <b>Total hot run time: 31479 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e8c7d07b50049499565b3029f15cea4566bf0dd7, data reload: false
------ Round 1 ----------------------------------
q1 17636 4784 4558 4558
q2 2076 316 195 195
q3 10212 1275 730 730
q4 10231 915 311 311
q5 7517 2036 1901 1901
q6 181 168 136 136
q7 899 717 586 586
q8 9263 1432 1112 1112
q9 4960 4782 4592 4592
q10 6789 1673 1234 1234
q11 504 297 283 283
q12 341 381 224 224
q13 17782 3851 3043 3043
q14 243 234 224 224
q15 596 531 518 518
q16 656 639 578 578
q17 650 778 536 536
q18 6688 6502 6702 6502
q19 1674 1097 672 672
q20 407 394 251 251
q21 3023 2203 2212 2203
q22 1134 1102 1090 1090
Total cold run time: 103462 ms
Total hot run time: 31479 ms
----- Round 2, with runtime_filter_mode=off -----
q1 5009 4986 4946 4946
q2 360 413 323 323
q3 2343 2879 2544 2544
q4 1509 1899 1458 1458
q5 4559 4404 4276 4276
q6 224 178 126 126
q7 2034 1918 1800 1800
q8 2539 2570 2455 2455
q9 7202 7210 7303 7210
q10 2504 2679 2284 2284
q11 541 459 456 456
q12 821 799 590 590
q13 3539 3995 3089 3089
q14 270 286 278 278
q15 533 504 490 490
q16 625 666 627 627
q17 1113 1287 1297 1287
q18 7554 7458 7149 7149
q19 823 792 793 792
q20 1907 1993 1789 1789
q21 4493 4282 4123 4123
q22 1052 1023 968 968
Total cold run time: 51554 ms
Total hot run time: 49060 ms
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3768060028
# BE Regression && UT Coverage Report
Increment line coverage `47.55% (776/1632)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/60001_497243270200c932fd73c90e2a8b539662b89701_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/60001_497243270200c932fd73c90e2a8b539662b89701_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 71.40% (25443/35632) |
| Line Coverage | 53.88% (265041/491868) |
| Region Coverage | 51.52% (220563/428151) |
| Branch Coverage | 52.95% (94742/178937) |
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3800481733
PR approved by anyone and no changes requested.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "gavinchou (via GitHub)" <gi...@apache.org>.
gavinchou commented on code in PR #60001:
URL: https://github.com/apache/doris/pull/60001#discussion_r2702535346
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -1736,5 +1557,212 @@ void CloudTablet::add_warmed_up_rowset(const RowsetId& rowset_id) {
.start_tp = std::chrono::steady_clock::now()};
}
+bool CloudTablet::_check_rowset_should_be_visible_but_not_warmed_up(
+ const RowsetMetaSharedPtr& rs_meta, int64_t path_max_version,
+ std::chrono::system_clock::time_point freshness_limit_tp) const {
+ if (rs_meta->version() == Version {0, 1}) {
+ // skip rowset[0-1]
+ return false;
+ }
+ bool ret = rs_meta->start_version() > path_max_version &&
+ rs_meta->visible_timestamp() < freshness_limit_tp;
+ if (ret && config::read_cluster_cache_opt_verbose_log) {
+ using namespace std::chrono;
+ std::time_t t1 = system_clock::to_time_t(rs_meta->visible_timestamp());
+ std::tm tm1 = *std::localtime(&t1);
+ std::ostringstream oss1;
+ oss1 << std::put_time(&tm1, "%Y-%m-%d %H:%M:%S");
+
+ std::time_t t2 = system_clock::to_time_t(freshness_limit_tp);
+ std::tm tm2 = *std::localtime(&t2);
+ std::ostringstream oss2;
+ oss2 << std::put_time(&tm2, "%Y-%m-%d %H:%M:%S");
+ LOG_INFO(
+ "[verbose] CloudTablet::capture_rs_readers_with_freshness_tolerance, "
+ "find a rowset which should be visible but not warmed up, tablet_id={}, "
+ "path_max_version={}, rowset_id={}, version={}, visible_time={}, "
+ "freshness_limit={}, version_graph={}, rowset_warmup_digest={}",
+ tablet_id(), path_max_version, rs_meta->rowset_id().to_string(),
+ rs_meta->version().to_string(), oss1.str(), oss2.str(),
+ _timestamped_version_tracker.debug_string(), rowset_warmup_digest());
+ }
+ return ret;
+}
+
+void CloudTablet::_submit_segment_download_task(const RowsetSharedPtr& rs, int seg_id,
+ const RowsetMetaSharedPtr& rowset_meta,
+ int64_t expiration_time) {
+ auto self = std::dynamic_pointer_cast<CloudTablet>(shared_from_this());
+ auto storage_resource = rowset_meta->remote_storage_resource();
+ if (!storage_resource) {
+ LOG(WARNING) << storage_resource.error();
+ return;
+ }
+
+ // clang-format off
+ _engine.file_cache_block_downloader().submit_download_task(io::DownloadFileMeta {
+ .path = storage_resource.value()->remote_segment_path(*rowset_meta, seg_id),
+ .file_size = rs->rowset_meta()->segment_file_size(seg_id),
+ .file_system = storage_resource.value()->fs,
+ .ctx = {
+ .expiration_time = expiration_time,
+ .is_dryrun = config::enable_reader_dryrun_when_download_file_cache,
+ .is_warmup = true
+ },
+ .download_done {[=](Status st) {
+ DBUG_EXECUTE_IF("CloudTablet::add_rowsets.download_data.callback.block_compaction_rowset", {
+ if (rs->version().second > rs->version().first) {
+ auto sleep_time = dp->param<int>("sleep", 3);
+ LOG_INFO(
+ "[verbose] block download for rowset={}, "
+ "version={}, sleep={}",
+ rs->rowset_id().to_string(),
+ rs->version().to_string(), sleep_time);
+ std::this_thread::sleep_for(
+ std::chrono::seconds(sleep_time));
+ }
+ });
+ self->complete_rowset_segment_warmup(WarmUpTriggerSource::SYNC_ROWSET, rowset_meta->rowset_id(), st, 1, 0);
+ if (!st) {
+ LOG_WARNING("add rowset warm up error ").error(st);
+ }
+ }},
+ });
+ // clang-format on
+}
+
+void CloudTablet::_submit_inverted_index_download_task(const RowsetSharedPtr& rs,
+ const RowsetMetaSharedPtr& rowset_meta,
+ const io::Path& idx_path, int64_t idx_size,
+ int64_t expiration_time) {
+ auto self = std::dynamic_pointer_cast<CloudTablet>(shared_from_this());
+ auto storage_resource = rowset_meta->remote_storage_resource();
+ if (!storage_resource) {
+ LOG(WARNING) << storage_resource.error();
+ return;
+ }
+
+ io::DownloadFileMeta meta {
Review Comment:
clang-format off for this code block, align code manually for better readability
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "gavinchou (via GitHub)" <gi...@apache.org>.
gavinchou commented on code in PR #60001:
URL: https://github.com/apache/doris/pull/60001#discussion_r2702535525
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -1736,5 +1557,212 @@ void CloudTablet::add_warmed_up_rowset(const RowsetId& rowset_id) {
.start_tp = std::chrono::steady_clock::now()};
}
+bool CloudTablet::_check_rowset_should_be_visible_but_not_warmed_up(
+ const RowsetMetaSharedPtr& rs_meta, int64_t path_max_version,
+ std::chrono::system_clock::time_point freshness_limit_tp) const {
+ if (rs_meta->version() == Version {0, 1}) {
+ // skip rowset[0-1]
+ return false;
+ }
+ bool ret = rs_meta->start_version() > path_max_version &&
+ rs_meta->visible_timestamp() < freshness_limit_tp;
+ if (ret && config::read_cluster_cache_opt_verbose_log) {
+ using namespace std::chrono;
+ std::time_t t1 = system_clock::to_time_t(rs_meta->visible_timestamp());
+ std::tm tm1 = *std::localtime(&t1);
+ std::ostringstream oss1;
+ oss1 << std::put_time(&tm1, "%Y-%m-%d %H:%M:%S");
+
+ std::time_t t2 = system_clock::to_time_t(freshness_limit_tp);
+ std::tm tm2 = *std::localtime(&t2);
+ std::ostringstream oss2;
+ oss2 << std::put_time(&tm2, "%Y-%m-%d %H:%M:%S");
+ LOG_INFO(
+ "[verbose] CloudTablet::capture_rs_readers_with_freshness_tolerance, "
+ "find a rowset which should be visible but not warmed up, tablet_id={}, "
+ "path_max_version={}, rowset_id={}, version={}, visible_time={}, "
+ "freshness_limit={}, version_graph={}, rowset_warmup_digest={}",
+ tablet_id(), path_max_version, rs_meta->rowset_id().to_string(),
+ rs_meta->version().to_string(), oss1.str(), oss2.str(),
+ _timestamped_version_tracker.debug_string(), rowset_warmup_digest());
+ }
+ return ret;
+}
+
+void CloudTablet::_submit_segment_download_task(const RowsetSharedPtr& rs, int seg_id,
+ const RowsetMetaSharedPtr& rowset_meta,
+ int64_t expiration_time) {
+ auto self = std::dynamic_pointer_cast<CloudTablet>(shared_from_this());
+ auto storage_resource = rowset_meta->remote_storage_resource();
+ if (!storage_resource) {
+ LOG(WARNING) << storage_resource.error();
+ return;
+ }
+
+ // clang-format off
+ _engine.file_cache_block_downloader().submit_download_task(io::DownloadFileMeta {
+ .path = storage_resource.value()->remote_segment_path(*rowset_meta, seg_id),
+ .file_size = rs->rowset_meta()->segment_file_size(seg_id),
+ .file_system = storage_resource.value()->fs,
+ .ctx = {
+ .expiration_time = expiration_time,
+ .is_dryrun = config::enable_reader_dryrun_when_download_file_cache,
+ .is_warmup = true
+ },
+ .download_done {[=](Status st) {
+ DBUG_EXECUTE_IF("CloudTablet::add_rowsets.download_data.callback.block_compaction_rowset", {
+ if (rs->version().second > rs->version().first) {
+ auto sleep_time = dp->param<int>("sleep", 3);
+ LOG_INFO(
+ "[verbose] block download for rowset={}, "
+ "version={}, sleep={}",
+ rs->rowset_id().to_string(),
+ rs->version().to_string(), sleep_time);
+ std::this_thread::sleep_for(
+ std::chrono::seconds(sleep_time));
+ }
+ });
+ self->complete_rowset_segment_warmup(WarmUpTriggerSource::SYNC_ROWSET, rowset_meta->rowset_id(), st, 1, 0);
+ if (!st) {
+ LOG_WARNING("add rowset warm up error ").error(st);
+ }
+ }},
+ });
+ // clang-format on
+}
+
+void CloudTablet::_submit_inverted_index_download_task(const RowsetSharedPtr& rs,
+ const RowsetMetaSharedPtr& rowset_meta,
+ const io::Path& idx_path, int64_t idx_size,
+ int64_t expiration_time) {
+ auto self = std::dynamic_pointer_cast<CloudTablet>(shared_from_this());
+ auto storage_resource = rowset_meta->remote_storage_resource();
+ if (!storage_resource) {
+ LOG(WARNING) << storage_resource.error();
+ return;
+ }
+
+ io::DownloadFileMeta meta {
+ .path = idx_path,
+ .file_size = idx_size,
+ .file_system = storage_resource.value()->fs,
+ .ctx = {.expiration_time = expiration_time,
+ .is_dryrun = config::enable_reader_dryrun_when_download_file_cache,
+ .is_warmup = true},
+ .download_done {[=](Status st) {
+ DBUG_EXECUTE_IF("CloudTablet::add_rowsets.download_idx.callback.block", {
+ // clang-format on
Review Comment:
wrong "on" here
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -1736,5 +1557,212 @@ void CloudTablet::add_warmed_up_rowset(const RowsetId& rowset_id) {
.start_tp = std::chrono::steady_clock::now()};
}
+bool CloudTablet::_check_rowset_should_be_visible_but_not_warmed_up(
+ const RowsetMetaSharedPtr& rs_meta, int64_t path_max_version,
+ std::chrono::system_clock::time_point freshness_limit_tp) const {
+ if (rs_meta->version() == Version {0, 1}) {
+ // skip rowset[0-1]
+ return false;
+ }
+ bool ret = rs_meta->start_version() > path_max_version &&
+ rs_meta->visible_timestamp() < freshness_limit_tp;
+ if (ret && config::read_cluster_cache_opt_verbose_log) {
+ using namespace std::chrono;
+ std::time_t t1 = system_clock::to_time_t(rs_meta->visible_timestamp());
+ std::tm tm1 = *std::localtime(&t1);
+ std::ostringstream oss1;
+ oss1 << std::put_time(&tm1, "%Y-%m-%d %H:%M:%S");
+
+ std::time_t t2 = system_clock::to_time_t(freshness_limit_tp);
+ std::tm tm2 = *std::localtime(&t2);
+ std::ostringstream oss2;
+ oss2 << std::put_time(&tm2, "%Y-%m-%d %H:%M:%S");
+ LOG_INFO(
+ "[verbose] CloudTablet::capture_rs_readers_with_freshness_tolerance, "
+ "find a rowset which should be visible but not warmed up, tablet_id={}, "
+ "path_max_version={}, rowset_id={}, version={}, visible_time={}, "
+ "freshness_limit={}, version_graph={}, rowset_warmup_digest={}",
+ tablet_id(), path_max_version, rs_meta->rowset_id().to_string(),
+ rs_meta->version().to_string(), oss1.str(), oss2.str(),
+ _timestamped_version_tracker.debug_string(), rowset_warmup_digest());
+ }
+ return ret;
+}
+
+void CloudTablet::_submit_segment_download_task(const RowsetSharedPtr& rs, int seg_id,
+ const RowsetMetaSharedPtr& rowset_meta,
+ int64_t expiration_time) {
+ auto self = std::dynamic_pointer_cast<CloudTablet>(shared_from_this());
+ auto storage_resource = rowset_meta->remote_storage_resource();
+ if (!storage_resource) {
+ LOG(WARNING) << storage_resource.error();
+ return;
+ }
+
+ // clang-format off
+ _engine.file_cache_block_downloader().submit_download_task(io::DownloadFileMeta {
+ .path = storage_resource.value()->remote_segment_path(*rowset_meta, seg_id),
+ .file_size = rs->rowset_meta()->segment_file_size(seg_id),
+ .file_system = storage_resource.value()->fs,
+ .ctx = {
+ .expiration_time = expiration_time,
+ .is_dryrun = config::enable_reader_dryrun_when_download_file_cache,
+ .is_warmup = true
+ },
+ .download_done {[=](Status st) {
+ DBUG_EXECUTE_IF("CloudTablet::add_rowsets.download_data.callback.block_compaction_rowset", {
+ if (rs->version().second > rs->version().first) {
+ auto sleep_time = dp->param<int>("sleep", 3);
+ LOG_INFO(
+ "[verbose] block download for rowset={}, "
+ "version={}, sleep={}",
+ rs->rowset_id().to_string(),
+ rs->version().to_string(), sleep_time);
+ std::this_thread::sleep_for(
+ std::chrono::seconds(sleep_time));
+ }
+ });
+ self->complete_rowset_segment_warmup(WarmUpTriggerSource::SYNC_ROWSET, rowset_meta->rowset_id(), st, 1, 0);
+ if (!st) {
+ LOG_WARNING("add rowset warm up error ").error(st);
+ }
+ }},
+ });
+ // clang-format on
+}
+
+void CloudTablet::_submit_inverted_index_download_task(const RowsetSharedPtr& rs,
+ const RowsetMetaSharedPtr& rowset_meta,
+ const io::Path& idx_path, int64_t idx_size,
+ int64_t expiration_time) {
+ auto self = std::dynamic_pointer_cast<CloudTablet>(shared_from_this());
+ auto storage_resource = rowset_meta->remote_storage_resource();
+ if (!storage_resource) {
+ LOG(WARNING) << storage_resource.error();
+ return;
+ }
+
+ io::DownloadFileMeta meta {
+ .path = idx_path,
+ .file_size = idx_size,
+ .file_system = storage_resource.value()->fs,
+ .ctx = {.expiration_time = expiration_time,
+ .is_dryrun = config::enable_reader_dryrun_when_download_file_cache,
+ .is_warmup = true},
+ .download_done {[=](Status st) {
+ DBUG_EXECUTE_IF("CloudTablet::add_rowsets.download_idx.callback.block", {
+ // clang-format on
+ auto sleep_time = dp->param<int>("sleep", 3);
+ LOG_INFO(
+ "[verbose] block download for "
+ "rowset={}, inverted_idx_file={}, "
+ "sleep={}",
+ rs->rowset_id().to_string(), idx_path.string(), sleep_time);
+ std::this_thread::sleep_for(std::chrono::seconds(sleep_time));
+ // clang-format off
Review Comment:
wrong of here
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3767836961
# BE UT Coverage Report
Increment line coverage `25.50% (343/1345)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/497243270200c932fd73c90e2a8b539662b89701_497243270200c932fd73c90e2a8b539662b89701/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/497243270200c932fd73c90e2a8b539662b89701_497243270200c932fd73c90e2a8b539662b89701/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 52.39% (19046/36352) |
| Line Coverage | 35.68% (175963/493110) |
| Region Coverage | 32.22% (136579/423836) |
| Branch Coverage | 33.12% (59034/178228) |
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3798303645
# BE Regression && UT Coverage Report
Increment line coverage `51.45% (869/1689)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/60001_e8c7d07b50049499565b3029f15cea4566bf0dd7_merge/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/60001_e8c7d07b50049499565b3029f15cea4566bf0dd7_merge/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 73.12% (26126/35732) |
| Line Coverage | 56.14% (277064/493510) |
| Region Coverage | 53.79% (231103/429629) |
| Branch Coverage | 55.53% (99749/179626) |
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "wrlcke (via GitHub)" <gi...@apache.org>.
wrlcke commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3797015686
run buildall
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3800481535
PR approved by at least one committer and no changes requested.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3765267365
Thank you for your contribution to Apache Doris.
Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR).
Please clearly describe your PR:
1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
3. What features were added. Why was this function added?
4. Which code was refactored and why was this part of the code refactored?
5. Which functions were optimized and what is the difference before and after the optimization?
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb merged PR #60001:
URL: https://github.com/apache/doris/pull/60001
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3767572063
<details>
<summary>TPC-DS: <b>Total hot run time: 175752 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 497243270200c932fd73c90e2a8b539662b89701, data reload: false
query5 4367 648 498 498
query6 332 246 218 218
query7 4232 481 271 271
query8 347 255 241 241
query9 8715 2898 2879 2879
query10 497 376 346 346
query11 15493 15359 15092 15092
query12 193 120 122 120
query13 1262 502 382 382
query14 6554 3148 2814 2814
query14_1 2717 2680 2706 2680
query15 202 196 178 178
query16 1019 488 475 475
query17 1093 681 552 552
query18 2691 459 335 335
query19 212 212 188 188
query20 125 118 116 116
query21 215 143 122 122
query22 3864 3965 4026 3965
query23 16037 15556 15281 15281
query23_1 15381 15388 15269 15269
query24 7212 1559 1175 1175
query24_1 1168 1170 1167 1167
query25 522 431 404 404
query26 1241 270 149 149
query27 2775 471 277 277
query28 4528 2169 2168 2168
query29 765 546 423 423
query30 320 253 211 211
query31 821 628 568 568
query32 87 82 72 72
query33 526 359 319 319
query34 917 895 529 529
query35 749 774 683 683
query36 873 926 828 828
query37 135 98 86 86
query38 2743 2773 2627 2627
query39 768 759 726 726
query39_1 731 733 698 698
query40 218 136 117 117
query41 69 93 71 71
query42 109 105 107 105
query43 447 459 418 418
query44 1329 757 752 752
query45 185 186 182 182
query46 848 991 580 580
query47 1388 1467 1400 1400
query48 310 318 238 238
query49 602 435 371 371
query50 613 264 216 216
query51 3837 3853 3717 3717
query52 108 110 97 97
query53 287 326 273 273
query54 289 269 261 261
query55 82 79 78 78
query56 319 307 328 307
query57 1067 1024 920 920
query58 292 261 277 261
query59 2148 2189 2149 2149
query60 346 350 330 330
query61 150 144 142 142
query62 383 358 308 308
query63 299 269 266 266
query64 4785 1271 955 955
query65 3947 3760 3752 3752
query66 1385 421 318 318
query67 16012 15971 15772 15772
query68 2460 1082 766 766
query69 451 362 338 338
query70 999 936 967 936
query71 333 324 290 290
query72 5366 3231 3254 3231
query73 608 734 320 320
query74 8716 8673 8541 8541
query75 2865 2866 2522 2522
query76 2294 1060 656 656
query77 363 385 320 320
query78 9954 10009 9293 9293
query79 1070 929 591 591
query80 658 602 516 516
query81 482 280 251 251
query82 1332 149 120 120
query83 371 270 257 257
query84 255 115 96 96
query85 893 554 501 501
query86 376 297 300 297
query87 2967 2937 2795 2795
query88 3468 2600 2602 2600
query89 386 351 332 332
query90 1905 175 164 164
query91 161 153 135 135
query92 78 81 70 70
query93 943 907 552 552
query94 458 337 304 304
query95 584 389 317 317
query96 655 502 228 228
query97 2389 2394 2329 2329
query98 212 206 203 203
query99 597 574 495 495
Total cold run time: 248372 ms
Total hot run time: 175752 ms
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3767522571
<details>
<summary>TPC-H: <b>Total hot run time: 31959 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 497243270200c932fd73c90e2a8b539662b89701, data reload: false
------ Round 1 ----------------------------------
q1 17640 4201 4063 4063
q2 2025 377 237 237
q3 10154 1247 709 709
q4 10223 873 313 313
q5 7519 2117 1830 1830
q6 187 167 137 137
q7 953 798 653 653
q8 9261 1430 1107 1107
q9 4910 4619 4597 4597
q10 6740 1811 1410 1410
q11 512 296 282 282
q12 691 748 635 635
q13 17763 3873 3088 3088
q14 295 293 292 292
q15 587 523 516 516
q16 701 698 675 675
q17 672 748 555 555
q18 6617 6409 6923 6409
q19 1138 1003 732 732
q20 405 377 250 250
q21 3274 2557 2451 2451
q22 1129 1124 1018 1018
Total cold run time: 103396 ms
Total hot run time: 31959 ms
----- Round 2, with runtime_filter_mode=off -----
q1 4297 4466 4369 4369
q2 322 403 322 322
q3 2291 2816 2472 2472
q4 1439 1874 1499 1499
q5 4516 4422 4342 4342
q6 219 172 126 126
q7 1955 1929 1714 1714
q8 2589 2495 2368 2368
q9 7310 7212 7097 7097
q10 2579 2713 2329 2329
q11 633 505 455 455
q12 712 743 621 621
q13 3673 4036 3088 3088
q14 269 277 265 265
q15 525 485 482 482
q16 624 670 613 613
q17 1119 1223 1348 1223
q18 7469 7410 7225 7225
q19 861 771 784 771
q20 1889 1953 1797 1797
q21 4608 4336 4279 4279
q22 1128 1043 962 962
Total cold run time: 51027 ms
Total hot run time: 48419 ms
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3767594318
<details>
<summary>ClickBench: <b>Total hot run time: 26.76 s</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 497243270200c932fd73c90e2a8b539662b89701, data reload: false
query1 0.06 0.04 0.05
query2 0.09 0.05 0.05
query3 0.25 0.09 0.08
query4 1.61 0.12 0.12
query5 0.28 0.26 0.25
query6 1.16 0.68 0.65
query7 0.03 0.02 0.03
query8 0.05 0.04 0.04
query9 0.56 0.49 0.50
query10 0.55 0.55 0.56
query11 0.15 0.10 0.10
query12 0.15 0.11 0.11
query13 0.62 0.58 0.59
query14 0.96 0.94 0.95
query15 0.78 0.78 0.78
query16 0.39 0.42 0.41
query17 1.04 1.03 1.04
query18 0.22 0.22 0.21
query19 1.97 1.82 1.88
query20 0.01 0.01 0.01
query21 15.44 0.28 0.14
query22 5.32 0.06 0.05
query23 16.02 0.26 0.10
query24 1.40 0.24 0.54
query25 0.10 0.08 0.05
query26 0.13 0.13 0.13
query27 0.06 0.05 0.06
query28 4.06 1.07 0.88
query29 12.58 3.98 3.16
query30 0.28 0.13 0.11
query31 2.82 0.63 0.39
query32 3.24 0.57 0.46
query33 3.05 3.05 3.03
query34 16.35 5.07 4.42
query35 4.52 4.44 4.43
query36 0.66 0.50 0.50
query37 0.10 0.06 0.06
query38 0.07 0.03 0.03
query39 0.04 0.03 0.03
query40 0.17 0.14 0.13
query41 0.09 0.04 0.03
query42 0.04 0.03 0.03
query43 0.04 0.03 0.03
Total cold run time: 97.51 s
Total hot run time: 26.76 s
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3797112399
<details>
<summary>TPC-DS: <b>Total hot run time: 172523 ms</b></summary>
```
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit e8c7d07b50049499565b3029f15cea4566bf0dd7, data reload: false
query5 4425 615 490 490
query6 322 218 199 199
query7 4212 446 252 252
query8 344 254 236 236
query9 8693 2802 2879 2802
query10 434 315 288 288
query11 15093 15244 14997 14997
query12 180 119 117 117
query13 1251 467 385 385
query14 6126 2996 2722 2722
query14_1 2652 2664 2655 2655
query15 207 187 174 174
query16 970 512 461 461
query17 1100 678 580 580
query18 2425 427 334 334
query19 204 181 153 153
query20 125 116 112 112
query21 217 144 132 132
query22 3776 4040 4112 4040
query23 16155 15517 15316 15316
query23_1 15382 15561 15418 15418
query24 7273 1561 1143 1143
query24_1 1159 1146 1165 1146
query25 552 457 413 413
query26 1240 277 155 155
query27 2737 440 287 287
query28 4557 2174 2161 2161
query29 792 552 447 447
query30 302 239 203 203
query31 789 634 562 562
query32 81 78 74 74
query33 528 372 315 315
query34 880 881 532 532
query35 712 762 682 682
query36 888 911 852 852
query37 140 99 89 89
query38 2685 2691 2722 2691
query39 790 756 758 756
query39_1 705 717 726 717
query40 226 134 121 121
query41 72 67 68 67
query42 99 99 94 94
query43 413 468 430 430
query44 1317 756 746 746
query45 191 184 178 178
query46 833 945 574 574
query47 1361 1500 1416 1416
query48 317 320 243 243
query49 612 425 361 361
query50 677 261 197 197
query51 3694 3714 3731 3714
query52 85 92 79 79
query53 219 227 167 167
query54 276 257 247 247
query55 81 78 82 78
query56 291 316 294 294
query57 980 1014 939 939
query58 266 265 261 261
query59 2051 2174 2128 2128
query60 341 330 316 316
query61 152 148 146 146
query62 388 381 320 320
query63 200 165 158 158
query64 4919 1132 873 873
query65 3860 3736 3710 3710
query66 1455 431 306 306
query67 15504 15561 15403 15403
query68 2390 1072 719 719
query69 416 310 282 282
query70 987 965 937 937
query71 356 292 269 269
query72 5253 3131 3207 3131
query73 589 718 307 307
query74 8742 8821 8509 8509
query75 2297 2332 1889 1889
query76 2293 1049 645 645
query77 366 377 305 305
query78 9704 9716 9060 9060
query79 2888 905 602 602
query80 1693 514 444 444
query81 567 266 227 227
query82 1003 147 116 116
query83 326 262 242 242
query84 259 121 100 100
query85 930 485 415 415
query86 435 298 297 297
query87 2873 2863 2774 2774
query88 3474 2598 2569 2569
query89 298 260 239 239
query90 1946 169 164 164
query91 170 149 134 134
query92 68 70 72 70
query93 1407 1001 640 640
query94 649 305 292 292
query95 581 336 304 304
query96 660 498 225 225
query97 2343 2398 2333 2333
query98 225 197 198 197
query99 576 589 505 505
Total cold run time: 247769 ms
Total hot run time: 172523 ms
```
</details>
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3798284467
# BE UT Coverage Report
Increment line coverage `24.59% (344/1399)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/e8c7d07b50049499565b3029f15cea4566bf0dd7_e8c7d07b50049499565b3029f15cea4566bf0dd7/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/e8c7d07b50049499565b3029f15cea4566bf0dd7_e8c7d07b50049499565b3029f15cea4566bf0dd7/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 52.46% (19144/36490) |
| Line Coverage | 35.83% (177423/495178) |
| Region Coverage | 32.28% (137399/425636) |
| Branch Coverage | 33.22% (59471/179032) |
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "gavinchou (via GitHub)" <gi...@apache.org>.
gavinchou commented on code in PR #60001:
URL: https://github.com/apache/doris/pull/60001#discussion_r2702538329
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -1736,5 +1557,212 @@ void CloudTablet::add_warmed_up_rowset(const RowsetId& rowset_id) {
.start_tp = std::chrono::steady_clock::now()};
}
+bool CloudTablet::_check_rowset_should_be_visible_but_not_warmed_up(
+ const RowsetMetaSharedPtr& rs_meta, int64_t path_max_version,
+ std::chrono::system_clock::time_point freshness_limit_tp) const {
+ if (rs_meta->version() == Version {0, 1}) {
+ // skip rowset[0-1]
+ return false;
+ }
+ bool ret = rs_meta->start_version() > path_max_version &&
+ rs_meta->visible_timestamp() < freshness_limit_tp;
+ if (ret && config::read_cluster_cache_opt_verbose_log) {
+ using namespace std::chrono;
+ std::time_t t1 = system_clock::to_time_t(rs_meta->visible_timestamp());
+ std::tm tm1 = *std::localtime(&t1);
+ std::ostringstream oss1;
+ oss1 << std::put_time(&tm1, "%Y-%m-%d %H:%M:%S");
+
+ std::time_t t2 = system_clock::to_time_t(freshness_limit_tp);
+ std::tm tm2 = *std::localtime(&t2);
+ std::ostringstream oss2;
+ oss2 << std::put_time(&tm2, "%Y-%m-%d %H:%M:%S");
+ LOG_INFO(
+ "[verbose] CloudTablet::capture_rs_readers_with_freshness_tolerance, "
+ "find a rowset which should be visible but not warmed up, tablet_id={}, "
+ "path_max_version={}, rowset_id={}, version={}, visible_time={}, "
+ "freshness_limit={}, version_graph={}, rowset_warmup_digest={}",
+ tablet_id(), path_max_version, rs_meta->rowset_id().to_string(),
+ rs_meta->version().to_string(), oss1.str(), oss2.str(),
+ _timestamped_version_tracker.debug_string(), rowset_warmup_digest());
+ }
+ return ret;
+}
+
+void CloudTablet::_submit_segment_download_task(const RowsetSharedPtr& rs, int seg_id,
+ const RowsetMetaSharedPtr& rowset_meta,
+ int64_t expiration_time) {
+ auto self = std::dynamic_pointer_cast<CloudTablet>(shared_from_this());
+ auto storage_resource = rowset_meta->remote_storage_resource();
+ if (!storage_resource) {
+ LOG(WARNING) << storage_resource.error();
+ return;
+ }
+
+ // clang-format off
+ _engine.file_cache_block_downloader().submit_download_task(io::DownloadFileMeta {
+ .path = storage_resource.value()->remote_segment_path(*rowset_meta, seg_id),
+ .file_size = rs->rowset_meta()->segment_file_size(seg_id),
+ .file_system = storage_resource.value()->fs,
+ .ctx = {
+ .expiration_time = expiration_time,
+ .is_dryrun = config::enable_reader_dryrun_when_download_file_cache,
+ .is_warmup = true
+ },
+ .download_done {[=](Status st) {
+ DBUG_EXECUTE_IF("CloudTablet::add_rowsets.download_data.callback.block_compaction_rowset", {
+ if (rs->version().second > rs->version().first) {
+ auto sleep_time = dp->param<int>("sleep", 3);
+ LOG_INFO(
+ "[verbose] block download for rowset={}, "
+ "version={}, sleep={}",
+ rs->rowset_id().to_string(),
+ rs->version().to_string(), sleep_time);
+ std::this_thread::sleep_for(
+ std::chrono::seconds(sleep_time));
+ }
+ });
+ self->complete_rowset_segment_warmup(WarmUpTriggerSource::SYNC_ROWSET, rowset_meta->rowset_id(), st, 1, 0);
+ if (!st) {
+ LOG_WARNING("add rowset warm up error ").error(st);
+ }
+ }},
+ });
+ // clang-format on
+}
+
+void CloudTablet::_submit_inverted_index_download_task(const RowsetSharedPtr& rs,
+ const RowsetMetaSharedPtr& rowset_meta,
+ const io::Path& idx_path, int64_t idx_size,
+ int64_t expiration_time) {
+ auto self = std::dynamic_pointer_cast<CloudTablet>(shared_from_this());
+ auto storage_resource = rowset_meta->remote_storage_resource();
+ if (!storage_resource) {
+ LOG(WARNING) << storage_resource.error();
+ return;
+ }
+
+ io::DownloadFileMeta meta {
+ .path = idx_path,
+ .file_size = idx_size,
+ .file_system = storage_resource.value()->fs,
+ .ctx = {.expiration_time = expiration_time,
+ .is_dryrun = config::enable_reader_dryrun_when_download_file_cache,
+ .is_warmup = true},
+ .download_done {[=](Status st) {
+ DBUG_EXECUTE_IF("CloudTablet::add_rowsets.download_idx.callback.block", {
+ // clang-format on
+ auto sleep_time = dp->param<int>("sleep", 3);
+ LOG_INFO(
+ "[verbose] block download for "
+ "rowset={}, inverted_idx_file={}, "
+ "sleep={}",
+ rs->rowset_id().to_string(), idx_path.string(), sleep_time);
+ std::this_thread::sleep_for(std::chrono::seconds(sleep_time));
+ // clang-format off
+ });
+ self->complete_rowset_segment_warmup(WarmUpTriggerSource::SYNC_ROWSET, rowset_meta->rowset_id(), st, 0, 1);
+ if (!st) {
+ LOG_WARNING("add rowset warm up error ").error(st);
+ }
+ }},
+ };
+ self->update_rowset_warmup_state_inverted_idx_num_unlocked(WarmUpTriggerSource::SYNC_ROWSET, rowset_meta->rowset_id(), 1);
+ _engine.file_cache_block_downloader().submit_download_task(std::move(meta));
+ g_file_cache_cloud_tablet_submitted_index_num << 1;
+ g_file_cache_cloud_tablet_submitted_index_size << idx_size;
+}
+
+void CloudTablet::_add_rowsets_directly(std::vector<RowsetSharedPtr>& rowsets, bool warmup_delta_data) {
+ for (auto& rs : rowsets) {
+ if (warmup_delta_data) {
+#ifndef BE_TEST
Review Comment:
try this to get rid of large block of `ifndef`
```suggestion
#ifdef BE_TEST
warmup_delta_data = false;
#endif
for (auto& rs : rowsets) {
if (warmup_delta_data) {
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [chore](be) refactor long lambdas into functions [doris]
Posted by "wrlcke (via GitHub)" <gi...@apache.org>.
wrlcke commented on PR #60001:
URL: https://github.com/apache/doris/pull/60001#issuecomment-3767241409
run buildall
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org