You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "csun5285 (via GitHub)" <gi...@apache.org> on 2023/11/20 12:34:13 UTC

[PR] []fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

csun5285 opened a new pull request, #27299:
URL: https://github.com/apache/doris/pull/27299

   ## Proposed changes
   
   Issue Number: close #xxx
   
   Sometimes we need to merge a large number of empty versions to reduce meta-information.
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820565314

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit cf333b424702313635f8b4b86e3421b35e09381c, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4918	4665	4639	4639
   q2	366	148	158	148
   q3	2018	1948	1897	1897
   q4	1367	1250	1249	1249
   q5	3971	3899	4014	3899
   q6	242	128	133	128
   q7	1427	889	894	889
   q8	2756	2778	2779	2778
   q9	56877	13090	9571	9571
   q10	3493	3546	3534	3534
   q11	398	251	248	248
   q12	1291	297	297	297
   q13	4595	3825	3797	3797
   q14	329	312	291	291
   q15	598	539	531	531
   q16	673	591	582	582
   q17	1131	973	895	895
   q18	7745	7424	7258	7258
   q19	1720	1660	1671	1660
   q20	561	301	296	296
   q21	7558	3961	4011	3961
   q22	483	374	373	373
   Total cold run time: 104517 ms
   Total hot run time: 48921 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4629	4595	4610	4595
   q2	344	242	261	242
   q3	4003	4005	3981	3981
   q4	2700	2694	2674	2674
   q5	9584	9575	9592	9575
   q6	240	126	126	126
   q7	3019	2466	2503	2466
   q8	4379	4432	4440	4432
   q9	13231	13121	13039	13039
   q10	4104	4172	4178	4172
   q11	756	649	674	649
   q12	983	829	829	829
   q13	4283	3583	3544	3544
   q14	383	340	349	340
   q15	578	523	519	519
   q16	746	653	664	653
   q17	3891	3868	3894	3868
   q18	9564	8919	9029	8919
   q19	1799	1770	1786	1770
   q20	2388	2085	2054	2054
   q21	8791	8802	8664	8664
   q22	916	788	794	788
   Total cold run time: 81311 ms
   Total hot run time: 77899 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] []fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1819090458

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.82 seconds
    stream load tsv:          569 seconds loaded 74807831229 Bytes, about 125 MB/s
    stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          28.5 seconds inserted 10000000 Rows, about 350K ops/s
    storage size: 17098756207 Bytes


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1859695274

   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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1435495196


##########
be/src/olap/tablet.cpp:
##########
@@ -1332,6 +1332,49 @@ std::vector<RowsetSharedPtr> Tablet::pick_candidate_rowsets_to_full_compaction()
     return pick_candidate_rowsets_to_single_replica_compaction();
 }
 
+std::vector<RowsetSharedPtr> Tablet::pick_first_consecutive_empty_rowsets(int limit) {
+    std::vector<RowsetSharedPtr> consecutive_empty_rowsets;
+    std::vector<RowsetSharedPtr> candidate_rowsets;
+    traverse_rowsets([&candidate_rowsets, this](const auto& rs) {
+        if (rs->is_local() && rs->start_version() >= _cumulative_point) {
+            candidate_rowsets.emplace_back(rs);
+        }
+    });
+    std::sort(candidate_rowsets.begin(), candidate_rowsets.end(), Rowset::comparator);
+    int len = candidate_rowsets.size();
+    for (int i = 0; i < len - 1; ++i) {
+        auto rowset = candidate_rowsets[i];
+        auto next_rowset = candidate_rowsets[i + 1];
+
+        // identify two consecutive rowsets that are empty
+        if (rowset->num_segments() == 0 && next_rowset->num_segments() == 0 &&
+            !rowset->rowset_meta()->has_delete_predicate() &&
+            !next_rowset->rowset_meta()->has_delete_predicate() &&
+            rowset->end_version() == next_rowset->start_version() - 1) {
+            consecutive_empty_rowsets.emplace_back(rowset);
+            consecutive_empty_rowsets.emplace_back(next_rowset);
+            rowset = next_rowset;
+            int next_index = i + 2;
+
+            // keep searching for consecutive empty rowsets
+            while (next_index < len && candidate_rowsets[next_index]->num_segments() == 0 &&
+                   !candidate_rowsets[next_index]->rowset_meta()->has_delete_predicate() &&
+                   rowset->end_version() == candidate_rowsets[next_index]->start_version() - 1) {
+                consecutive_empty_rowsets.emplace_back(candidate_rowsets[next_index]);
+                rowset = candidate_rowsets[next_index++];
+            }
+            if (consecutive_empty_rowsets.size() >= limit && next_index < len) {
+                return consecutive_empty_rowsets;
+            } else {
+                i = next_index - 1;
+                consecutive_empty_rowsets.clear();

Review Comment:
   done



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820156230

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit 50491a4de946058f515ba5367d3a8e58790180c2, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4958	4673	4669	4669
   q2	359	155	161	155
   q3	2022	1939	1888	1888
   q4	1393	1262	1257	1257
   q5	3995	3990	4000	3990
   q6	247	133	134	133
   q7	1440	890	927	890
   q8	2757	2808	2778	2778
   q9	9817	9580	10166	9580
   q10	3489	3567	3534	3534
   q11	374	254	252	252
   q12	446	301	299	299
   q13	4580	3869	3834	3834
   q14	314	287	298	287
   q15	582	535	524	524
   q16	669	595	579	579
   q17	1139	971	909	909
   q18	7765	7259	7452	7259
   q19	1657	1692	1709	1692
   q20	560	308	308	308
   q21	4439	3988	4052	3988
   q22	493	378	375	375
   Total cold run time: 53495 ms
   Total hot run time: 49180 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4598	4581	4578	4578
   q2	330	230	255	230
   q3	4032	4000	3990	3990
   q4	2721	2713	2706	2706
   q5	9547	9633	9575	9575
   q6	245	127	125	125
   q7	3052	2495	2481	2481
   q8	4402	4406	4399	4399
   q9	13175	13166	13192	13166
   q10	4109	4224	4210	4210
   q11	757	650	655	650
   q12	979	819	819	819
   q13	4318	3574	3543	3543
   q14	377	359	359	359
   q15	582	528	531	528
   q16	757	688	697	688
   q17	3963	3897	3866	3866
   q18	9619	8966	8903	8903
   q19	1793	1790	1789	1789
   q20	2389	2070	2061	2061
   q21	8824	8601	8774	8601
   q22	973	821	797	797
   Total cold run time: 81542 ms
   Total hot run time: 78064 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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "qidaye (via GitHub)" <gi...@apache.org>.
qidaye commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1434766727


##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -254,10 +282,11 @@ int TimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
 void TimeSeriesCumulativeCompactionPolicy::update_cumulative_point(
         Tablet* tablet, const std::vector<RowsetSharedPtr>& input_rowsets,
         RowsetSharedPtr output_rowset, Version& last_delete_version) {
-    if (tablet->tablet_state() != TABLET_RUNNING) {
+    if (tablet->tablet_state() != TABLET_RUNNING || output_rowset->num_segments() == 0) {
         // if tablet under alter process, do not update cumulative point

Review Comment:
   update comment



##########
be/src/olap/tablet.cpp:
##########
@@ -1332,6 +1332,49 @@ std::vector<RowsetSharedPtr> Tablet::pick_candidate_rowsets_to_full_compaction()
     return pick_candidate_rowsets_to_single_replica_compaction();
 }
 
+std::vector<RowsetSharedPtr> Tablet::pick_first_consecutive_empty_rowsets(int limit) {
+    std::vector<RowsetSharedPtr> consecutive_empty_rowsets;
+    std::vector<RowsetSharedPtr> candidate_rowsets;
+    traverse_rowsets([&candidate_rowsets, this](const auto& rs) {
+        if (rs->is_local() && rs->start_version() >= _cumulative_point) {
+            candidate_rowsets.emplace_back(rs);
+        }
+    });
+    std::sort(candidate_rowsets.begin(), candidate_rowsets.end(), Rowset::comparator);
+    int len = candidate_rowsets.size();
+    for (int i = 0; i < len - 1; ++i) {
+        auto rowset = candidate_rowsets[i];
+        auto next_rowset = candidate_rowsets[i + 1];
+
+        // identify two consecutive rowsets that are empty
+        if (rowset->num_segments() == 0 && next_rowset->num_segments() == 0 &&
+            !rowset->rowset_meta()->has_delete_predicate() &&
+            !next_rowset->rowset_meta()->has_delete_predicate() &&
+            rowset->end_version() == next_rowset->start_version() - 1) {
+            consecutive_empty_rowsets.emplace_back(rowset);
+            consecutive_empty_rowsets.emplace_back(next_rowset);
+            rowset = next_rowset;
+            int next_index = i + 2;
+
+            // keep searching for consecutive empty rowsets
+            while (next_index < len && candidate_rowsets[next_index]->num_segments() == 0 &&
+                   !candidate_rowsets[next_index]->rowset_meta()->has_delete_predicate() &&
+                   rowset->end_version() == candidate_rowsets[next_index]->start_version() - 1) {
+                consecutive_empty_rowsets.emplace_back(candidate_rowsets[next_index]);
+                rowset = candidate_rowsets[next_index++];
+            }
+            if (consecutive_empty_rowsets.size() >= limit && next_index < len) {

Review Comment:
   add some comments here



##########
be/src/olap/tablet.cpp:
##########
@@ -1332,6 +1332,49 @@ std::vector<RowsetSharedPtr> Tablet::pick_candidate_rowsets_to_full_compaction()
     return pick_candidate_rowsets_to_single_replica_compaction();
 }
 
+std::vector<RowsetSharedPtr> Tablet::pick_first_consecutive_empty_rowsets(int limit) {
+    std::vector<RowsetSharedPtr> consecutive_empty_rowsets;
+    std::vector<RowsetSharedPtr> candidate_rowsets;
+    traverse_rowsets([&candidate_rowsets, this](const auto& rs) {
+        if (rs->is_local() && rs->start_version() >= _cumulative_point) {
+            candidate_rowsets.emplace_back(rs);
+        }
+    });
+    std::sort(candidate_rowsets.begin(), candidate_rowsets.end(), Rowset::comparator);
+    int len = candidate_rowsets.size();
+    for (int i = 0; i < len - 1; ++i) {
+        auto rowset = candidate_rowsets[i];
+        auto next_rowset = candidate_rowsets[i + 1];
+
+        // identify two consecutive rowsets that are empty
+        if (rowset->num_segments() == 0 && next_rowset->num_segments() == 0 &&
+            !rowset->rowset_meta()->has_delete_predicate() &&
+            !next_rowset->rowset_meta()->has_delete_predicate() &&
+            rowset->end_version() == next_rowset->start_version() - 1) {
+            consecutive_empty_rowsets.emplace_back(rowset);
+            consecutive_empty_rowsets.emplace_back(next_rowset);
+            rowset = next_rowset;
+            int next_index = i + 2;
+
+            // keep searching for consecutive empty rowsets
+            while (next_index < len && candidate_rowsets[next_index]->num_segments() == 0 &&
+                   !candidate_rowsets[next_index]->rowset_meta()->has_delete_predicate() &&
+                   rowset->end_version() == candidate_rowsets[next_index]->start_version() - 1) {
+                consecutive_empty_rowsets.emplace_back(candidate_rowsets[next_index]);
+                rowset = candidate_rowsets[next_index++];
+            }
+            if (consecutive_empty_rowsets.size() >= limit && next_index < len) {
+                return consecutive_empty_rowsets;
+            } else {
+                i = next_index - 1;
+                consecutive_empty_rowsets.clear();

Review Comment:
   and 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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1870861837

   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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1400155405


##########
be/src/olap/tablet_meta.cpp:
##########
@@ -859,6 +869,9 @@ bool operator==(const TabletMeta& a, const TabletMeta& b) {
     if (a._time_series_compaction_time_threshold_seconds !=
         b._time_series_compaction_time_threshold_seconds)
         return false;
+    if (a._time_series_compaction_empty_rowsets_threshold !=
+        b._time_series_compaction_empty_rowsets_threshold)
+        return false;

Review Comment:
   warning: statement should be inside braces [readability-braces-around-statements]
   
   ```suggestion
           b._time_series_compaction_empty_rowsets_threshold) {
           return false;
   }
   ```
   



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1859833556

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 43.96 seconds
    stream load tsv:          578 seconds loaded 74807831229 Bytes, about 123 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    insert into select:          28.5 seconds inserted 10000000 Rows, about 350K ops/s
    storage size: 17218526320 Bytes


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820160725

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.12 seconds
    stream load tsv:          569 seconds loaded 74807831229 Bytes, about 125 MB/s
    stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    insert into select:          28.5 seconds inserted 10000000 Rows, about 350K ops/s
    storage size: 17099462075 Bytes


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1870950597

   
   TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   ```
   Tpch sf100 test result on commit 661d5aa273beb54ad61446af8dc7c0dd8322473e, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	5018	4663	4671	4663
   q2	365	150	158	150
   q3	1467	1297	1204	1204
   q4	1125	963	902	902
   q5	3151	3190	3169	3169
   q6	248	125	125	125
   q7	1038	491	488	488
   q8	2259	2252	2253	2252
   q9	6717	6700	6696	6696
   q10	3212	3264	3273	3264
   q11	333	209	219	209
   q12	350	207	210	207
   q13	4144	3434	3446	3434
   q14	244	217	211	211
   q15	573	521	525	521
   q16	441	384	389	384
   q17	1056	807	666	666
   q18	7022	6868	6768	6768
   q19	1611	1636	1621	1621
   q20	563	287	293	287
   q21	3192	2698	2732	2698
   q22	375	308	311	308
   Total cold run time: 44504 ms
   Total hot run time: 40227 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4583	4599	4547	4547
   q2	269	166	169	166
   q3	3372	3358	3349	3349
   q4	2229	2187	2192	2187
   q5	5729	5701	5711	5701
   q6	241	117	117	117
   q7	2371	1859	1823	1823
   q8	3604	3605	3601	3601
   q9	8992	8972	8929	8929
   q10	3808	3867	3911	3867
   q11	494	371	352	352
   q12	769	593	600	593
   q13	3896	3193	3169	3169
   q14	281	250	258	250
   q15	566	515	517	515
   q16	492	440	449	440
   q17	1969	1966	1945	1945
   q18	8641	8245	8251	8245
   q19	1754	1749	1751	1749
   q20	2239	1944	1939	1939
   q21	6100	5726	5744	5726
   q22	565	460	468	460
   Total cold run time: 62964 ms
   Total hot run time: 59670 ms
   ```
   


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1868232335

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.33 seconds
    stream load tsv:          580 seconds loaded 74807831229 Bytes, about 123 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    insert into select:          28.9 seconds inserted 10000000 Rows, about 346K ops/s
    storage size: 17184080687 Bytes


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1859815063

   
   TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   ```
   Tpch sf100 test result on commit c6725851097de19ed9f11cae7e44023013e7ea61, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4695	4477	4468	4468
   q2	360	154	158	154
   q3	1474	1265	1261	1261
   q4	1124	936	920	920
   q5	3150	3181	3159	3159
   q6	244	130	125	125
   q7	977	487	490	487
   q8	2260	2223	2210	2210
   q9	6719	6688	6707	6688
   q10	3214	3280	3252	3252
   q11	333	193	201	193
   q12	357	214	204	204
   q13	4563	3796	3778	3778
   q14	240	219	218	218
   q15	567	526	521	521
   q16	440	382	377	377
   q17	1027	636	550	550
   q18	7110	7030	7018	7018
   q19	1558	1425	1446	1425
   q20	548	314	293	293
   q21	3066	2635	2657	2635
   q22	346	279	278	278
   Total cold run time: 44372 ms
   Total hot run time: 40214 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4389	4399	4390	4390
   q2	275	165	168	165
   q3	3528	3542	3531	3531
   q4	2383	2370	2368	2368
   q5	5773	5727	5735	5727
   q6	243	122	123	122
   q7	2408	1856	1905	1856
   q8	3534	3530	3533	3530
   q9	9073	9054	8999	8999
   q10	3907	4001	3989	3989
   q11	506	382	398	382
   q12	778	595	606	595
   q13	4279	3594	3552	3552
   q14	286	250	260	250
   q15	579	530	522	522
   q16	493	438	462	438
   q17	1887	1843	1847	1843
   q18	8686	8126	8377	8126
   q19	1727	1745	1768	1745
   q20	2264	1952	1943	1943
   q21	6527	6205	6172	6172
   q22	500	415	410	410
   Total cold run time: 64025 ms
   Total hot run time: 60655 ms
   ```
   


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1435493225


##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -254,10 +282,11 @@ int TimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
 void TimeSeriesCumulativeCompactionPolicy::update_cumulative_point(
         Tablet* tablet, const std::vector<RowsetSharedPtr>& input_rowsets,
         RowsetSharedPtr output_rowset, Version& last_delete_version) {
-    if (tablet->tablet_state() != TABLET_RUNNING) {
+    if (tablet->tablet_state() != TABLET_RUNNING || output_rowset->num_segments() == 0) {
         // if tablet under alter process, do not update cumulative point

Review Comment:
   done



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1435493009


##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -213,6 +240,7 @@ int TimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
                 total_size = 0;
                 continue;
             }
+

Review Comment:
   done



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1870945073

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 47.75 seconds
    stream load tsv:          569 seconds loaded 74807831229 Bytes, about 125 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          28.9 seconds inserted 10000000 Rows, about 346K ops/s
    storage size: 17188360891 Bytes


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1870886679

   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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1870939885

   TeamCity be ut coverage result:
    Function Coverage: 36.61% (8592/23466) 
    Line Coverage: 28.69% (69893/243633)
    Region Coverage: 27.68% (36166/130640)
    Branch Coverage: 24.39% (18479/75774)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/661d5aa273beb54ad61446af8dc7c0dd8322473e_661d5aa273beb54ad61446af8dc7c0dd8322473e/report/index.html


-- 
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] []fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820109641

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "xiaokang (via GitHub)" <gi...@apache.org>.
xiaokang commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1399967718


##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -70,6 +70,12 @@ uint32_t TimeSeriesCumulativeCompactionPolicy::calc_cumulative_compaction_score(
         return score;
     }
 
+    // If their are many empty rowset, maybe should be compact
+    auto consecutive_empty_rowsets = tablet->collect_consecutive_empty_rowsets();

Review Comment:
   maybe we should treat it as condition 4 and put it in the last



##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -229,6 +242,14 @@ int TimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
         return transient_size;
     }
 
+    auto consecutive_empty_rowsets = tablet->collect_consecutive_empty_rowsets();

Review Comment:
   maybe we should treat it as condition 4 and put it in the last



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820158825

   TeamCity be ut coverage result:
    Function Coverage: 36.55% (8452/23126) 
    Line Coverage: 28.88% (68711/237957)
    Region Coverage: 27.85% (35546/127654)
    Branch Coverage: 24.59% (18126/73704)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/50491a4de946058f515ba5367d3a8e58790180c2_50491a4de946058f515ba5367d3a8e58790180c2/report/index.html


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1435492936


##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -149,6 +156,12 @@ void TimeSeriesCumulativeCompactionPolicy::calculate_cumulative_point(
             break;
         }
 
+        if (!is_delete && rs->version().first != 0 && rs->version().first != rs->version().second &&

Review Comment:
   When the machine restarts, it will recalculate cumu point, the merged empty version should be the first, it should be merged again.



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1399977694


##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -70,6 +70,12 @@ uint32_t TimeSeriesCumulativeCompactionPolicy::calc_cumulative_compaction_score(
         return score;
     }
 
+    // If their are many empty rowset, maybe should be compact
+    auto consecutive_empty_rowsets = tablet->collect_consecutive_empty_rowsets();

Review Comment:
   done



##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -229,6 +242,14 @@ int TimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
         return transient_size;
     }
 
+    auto consecutive_empty_rowsets = tablet->collect_consecutive_empty_rowsets();

Review Comment:
   done



##########
be/src/olap/tablet.h:
##########
@@ -272,6 +272,8 @@ class Tablet final : public BaseTablet {
     std::vector<RowsetSharedPtr> pick_candidate_rowsets_to_single_replica_compaction();
     std::vector<Version> get_all_versions();
 
+    std::vector<RowsetSharedPtr> collect_consecutive_empty_rowsets();

Review Comment:
   done



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820537272

   TeamCity be ut coverage result:
    Function Coverage: 36.54% (8451/23129) 
    Line Coverage: 28.87% (68723/238034)
    Region Coverage: 27.83% (35548/127710)
    Branch Coverage: 24.58% (18127/73736)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/cf333b424702313635f8b4b86e3421b35e09381c_cf333b424702313635f8b4b86e3421b35e09381c/report/index.html


-- 
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] []fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820106390

   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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820174069

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1435492149


##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -85,6 +91,7 @@ uint32_t TimeSeriesCumulativeCompactionPolicy::calc_cumulative_compaction_score(
             (tablet->tablet_meta()->time_series_compaction_time_threshold_seconds() * 1000)) {
             return score;
         }
+

Review Comment:
   done



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "xiaokang (via GitHub)" <gi...@apache.org>.
xiaokang commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1399961073


##########
be/src/olap/tablet.h:
##########
@@ -272,6 +272,8 @@ class Tablet final : public BaseTablet {
     std::vector<RowsetSharedPtr> pick_candidate_rowsets_to_single_replica_compaction();
     std::vector<Version> get_all_versions();
 
+    std::vector<RowsetSharedPtr> collect_consecutive_empty_rowsets();

Review Comment:
   suggest name pick_first_consecutive_empty_rowsets()



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820237226

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.48 seconds
    stream load tsv:          568 seconds loaded 74807831229 Bytes, about 125 MB/s
    stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    insert into select:          28.8 seconds inserted 10000000 Rows, about 347K ops/s
    storage size: 17099233924 Bytes


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1825266051

   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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "xiaokang (via GitHub)" <gi...@apache.org>.
xiaokang commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1434719971


##########
gensrc/thrift/AgentService.thrift:
##########
@@ -150,6 +150,7 @@ struct TCreateTabletReq {
     23: optional i64 time_series_compaction_goal_size_mbytes = 1024
     24: optional i64 time_series_compaction_file_count_threshold = 2000
     25: optional i64 time_series_compaction_time_threshold_seconds = 3600
+    26: optional i64 time_series_compaction_empty_rowsets_threshold = 5

Review Comment:
   Is it necessary to config in table level?



##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -63,6 +63,12 @@ uint32_t TimeSeriesCumulativeCompactionPolicy::calc_cumulative_compaction_score(
         return 0;
     }
 
+    auto consecutive_empty_rowsets = tablet->pick_first_consecutive_empty_rowsets(

Review Comment:
   add comment to explain policy



##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -149,6 +156,12 @@ void TimeSeriesCumulativeCompactionPolicy::calculate_cumulative_point(
             break;
         }
 
+        if (!is_delete && rs->version().first != 0 && rs->version().first != rs->version().second &&

Review Comment:
   Do you mean set cu point to the first empty rowset? Why?



##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -85,6 +91,7 @@ uint32_t TimeSeriesCumulativeCompactionPolicy::calc_cumulative_compaction_score(
             (tablet->tablet_meta()->time_series_compaction_time_threshold_seconds() * 1000)) {
             return score;
         }
+

Review Comment:
   useless blank line



##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -149,6 +156,12 @@ void TimeSeriesCumulativeCompactionPolicy::calculate_cumulative_point(
             break;
         }
 
+        if (!is_delete && rs->version().first != 0 && rs->version().first != rs->version().second &&

Review Comment:
   add comment to explain policy



##########
be/src/olap/cumulative_compaction_time_series_policy.cpp:
##########
@@ -213,6 +240,7 @@ int TimeSeriesCumulativeCompactionPolicy::pick_input_rowsets(
                 total_size = 0;
                 continue;
             }
+

Review Comment:
   uesless blank



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1868230014

   
   TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   ```
   Tpch sf100 test result on commit 82218c270a9d9233c04f0eb2da1eeccb89d3ca95, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4734	4452	4413	4413
   q2	366	146	159	146
   q3	1436	1278	1279	1278
   q4	1113	916	902	902
   q5	3158	3163	3140	3140
   q6	249	133	131	131
   q7	1001	492	486	486
   q8	2189	2238	2184	2184
   q9	6682	6660	6684	6660
   q10	3223	3271	3273	3271
   q11	308	183	184	183
   q12	357	212	208	208
   q13	4558	3798	3780	3780
   q14	242	217	217	217
   q15	566	531	520	520
   q16	441	389	384	384
   q17	1035	613	585	585
   q18	7013	6920	6883	6883
   q19	1527	1435	1435	1435
   q20	538	303	302	302
   q21	3107	2692	2609	2609
   q22	355	273	278	273
   Total cold run time: 44198 ms
   Total hot run time: 39990 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4409	4349	4355	4349
   q2	270	165	172	165
   q3	3503	3499	3495	3495
   q4	2389	2349	2376	2349
   q5	5706	5713	5718	5713
   q6	241	122	123	122
   q7	2358	1831	1867	1831
   q8	3522	3542	3520	3520
   q9	9024	9016	8963	8963
   q10	3907	4010	4027	4010
   q11	480	379	381	379
   q12	766	603	576	576
   q13	4274	3589	3549	3549
   q14	283	251	248	248
   q15	576	525	520	520
   q16	502	466	456	456
   q17	1866	1886	1839	1839
   q18	8524	8009	8217	8009
   q19	1755	1750	1753	1750
   q20	2258	1940	1937	1937
   q21	6504	6131	6134	6131
   q22	499	416	425	416
   Total cold run time: 63616 ms
   Total hot run time: 60327 ms
   ```
   


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1435494240


##########
be/src/olap/tablet.cpp:
##########
@@ -1332,6 +1332,49 @@ std::vector<RowsetSharedPtr> Tablet::pick_candidate_rowsets_to_full_compaction()
     return pick_candidate_rowsets_to_single_replica_compaction();
 }
 
+std::vector<RowsetSharedPtr> Tablet::pick_first_consecutive_empty_rowsets(int limit) {
+    std::vector<RowsetSharedPtr> consecutive_empty_rowsets;
+    std::vector<RowsetSharedPtr> candidate_rowsets;
+    traverse_rowsets([&candidate_rowsets, this](const auto& rs) {
+        if (rs->is_local() && rs->start_version() >= _cumulative_point) {
+            candidate_rowsets.emplace_back(rs);
+        }
+    });
+    std::sort(candidate_rowsets.begin(), candidate_rowsets.end(), Rowset::comparator);
+    int len = candidate_rowsets.size();
+    for (int i = 0; i < len - 1; ++i) {
+        auto rowset = candidate_rowsets[i];
+        auto next_rowset = candidate_rowsets[i + 1];
+
+        // identify two consecutive rowsets that are empty
+        if (rowset->num_segments() == 0 && next_rowset->num_segments() == 0 &&
+            !rowset->rowset_meta()->has_delete_predicate() &&
+            !next_rowset->rowset_meta()->has_delete_predicate() &&
+            rowset->end_version() == next_rowset->start_version() - 1) {
+            consecutive_empty_rowsets.emplace_back(rowset);
+            consecutive_empty_rowsets.emplace_back(next_rowset);
+            rowset = next_rowset;
+            int next_index = i + 2;
+
+            // keep searching for consecutive empty rowsets
+            while (next_index < len && candidate_rowsets[next_index]->num_segments() == 0 &&
+                   !candidate_rowsets[next_index]->rowset_meta()->has_delete_predicate() &&
+                   rowset->end_version() == candidate_rowsets[next_index]->start_version() - 1) {
+                consecutive_empty_rowsets.emplace_back(candidate_rowsets[next_index]);
+                rowset = candidate_rowsets[next_index++];
+            }
+            if (consecutive_empty_rowsets.size() >= limit && next_index < len) {

Review Comment:
   done



-- 
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] []fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1819115249

   TeamCity be ut coverage result:
    Function Coverage: 36.52% (8450/23136) 
    Line Coverage: 28.87% (68699/237941)
    Region Coverage: 27.85% (35536/127613)
    Branch Coverage: 24.60% (18122/73656)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/b86937e62569a9ecbbc7d5d3630bca4dd1aa76d3_b86937e62569a9ecbbc7d5d3630bca4dd1aa76d3/report/index.html


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "qidaye (via GitHub)" <gi...@apache.org>.
qidaye merged PR #27299:
URL: https://github.com/apache/doris/pull/27299


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1870861818

   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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1868230818

   TeamCity be ut coverage result:
    Function Coverage: 36.61% (8554/23368) 
    Line Coverage: 28.69% (69585/242566)
    Region Coverage: 27.69% (35992/130004)
    Branch Coverage: 24.42% (18404/75374)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/82218c270a9d9233c04f0eb2da1eeccb89d3ca95_82218c270a9d9233c04f0eb2da1eeccb89d3ca95/report/index.html


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820173178

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820164849

   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] []fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1819072609

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit b86937e62569a9ecbbc7d5d3630bca4dd1aa76d3, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4940	4669	4624	4624
   q2	355	158	158	158
   q3	2042	1945	1881	1881
   q4	1386	1266	1256	1256
   q5	3994	3966	4018	3966
   q6	251	131	132	131
   q7	1417	885	903	885
   q8	2745	2782	2762	2762
   q9	9796	10073	10019	10019
   q10	3461	3550	3562	3550
   q11	380	249	238	238
   q12	442	293	301	293
   q13	4581	3853	3819	3819
   q14	322	283	289	283
   q15	585	546	518	518
   q16	675	581	580	580
   q17	1138	967	947	947
   q18	7768	7473	7353	7353
   q19	1680	1682	1652	1652
   q20	551	298	328	298
   q21	4411	3940	4002	3940
   q22	470	366	368	366
   Total cold run time: 53390 ms
   Total hot run time: 49519 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4600	4584	4592	4584
   q2	346	235	274	235
   q3	4003	4013	3997	3997
   q4	2709	2701	2708	2701
   q5	9870	9786	9755	9755
   q6	235	125	129	125
   q7	2986	2463	2487	2463
   q8	4433	4450	4468	4450
   q9	13394	13206	13206	13206
   q10	4080	4187	4193	4187
   q11	760	653	700	653
   q12	970	808	814	808
   q13	4285	3593	3564	3564
   q14	379	363	344	344
   q15	574	527	514	514
   q16	739	672	663	663
   q17	3778	3925	3794	3794
   q18	9382	9105	8951	8951
   q19	1823	1776	1753	1753
   q20	2379	2055	2084	2055
   q21	8861	8713	8749	8713
   q22	929	805	793	793
   Total cold run time: 81515 ms
   Total hot run time: 78308 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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820581483

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.05 seconds
    stream load tsv:          566 seconds loaded 74807831229 Bytes, about 126 MB/s
    stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          28.7 seconds inserted 10000000 Rows, about 348K ops/s
    storage size: 17098752194 Bytes


-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820177979

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] []fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1818993681

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] []fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1818984984

   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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1820398373

    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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on code in PR #27299:
URL: https://github.com/apache/doris/pull/27299#discussion_r1435495529


##########
gensrc/thrift/AgentService.thrift:
##########
@@ -150,6 +150,7 @@ struct TCreateTabletReq {
     23: optional i64 time_series_compaction_goal_size_mbytes = 1024
     24: optional i64 time_series_compaction_file_count_threshold = 2000
     25: optional i64 time_series_compaction_time_threshold_seconds = 3600
+    26: optional i64 time_series_compaction_empty_rowsets_threshold = 5

Review Comment:
   The empty rowsets for different tables may vary,due to various configurations of the tables



-- 
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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "csun5285 (via GitHub)" <gi...@apache.org>.
csun5285 commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1868217703

   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] [fix](compaction) time series compaction policy -> compact consecutive empty rowsets [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27299:
URL: https://github.com/apache/doris/pull/27299#issuecomment-1872105175

   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