weizuo93 commented on a change in pull request #4837:
URL: https://github.com/apache/incubator-doris/pull/4837#discussion_r519575946



##########
File path: be/src/olap/tablet_manager.cpp
##########
@@ -745,17 +747,22 @@ TabletSharedPtr 
TabletManager::find_best_tablet_to_compaction(
                     }
                 }
 
-                uint32_t table_score = 0;
+                double tablet_score = 0;
+                uint32_t current_compaction_score = 0;
                 {
                     ReadLock rdlock(tablet_ptr->get_header_lock_ptr());
                     if (compaction_type == CompactionType::BASE_COMPACTION) {
-                        table_score = tablet_ptr->calc_base_compaction_score();
+                        current_compaction_score = 
tablet_ptr->calc_base_compaction_score();
                     } else if (compaction_type == 
CompactionType::CUMULATIVE_COMPACTION) {
-                        table_score = 
tablet_ptr->calc_cumulative_compaction_score();
+                        current_compaction_score = 
tablet_ptr->calc_cumulative_compaction_score();
                     }
                 }
-                if (table_score > highest_score) {
-                    highest_score = table_score;
+                double scan_frequency = tablet_ptr->calculate_scan_frequency();

Review comment:
       > if `compaction_tablet_scan_frequency_factor` is zero, we can skip 
calling `calculate_scan_frequency()` to save some CPU.
   
   It's reasonable.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to