ByteYue commented on code in PR #27091:
URL: https://github.com/apache/doris/pull/27091#discussion_r1395908084


##########
be/src/olap/olap_server.cpp:
##########
@@ -1032,17 +1033,19 @@ void StorageEngine::_cooldown_tasks_producer_callback() 
{
             return _running_cooldown_tablets.find(tablet->tablet_id()) !=
                    _running_cooldown_tablets.end();
         };
-        _tablet_manager->get_cooldown_tablets(&tablets, 
std::move(skip_tablet));
+        _tablet_manager->get_cooldown_tablets(&tablets, &rowsets, 
std::move(skip_tablet));
         LOG(INFO) << "cooldown producer get tablet num: " << tablets.size();
         int max_priority = tablets.size();
+        int index = 0;
         for (const auto& tablet : tablets) {
             {
                 std::lock_guard<std::mutex> lock(_running_cooldown_mutex);
                 _running_cooldown_tablets.insert(tablet->tablet_id());
             }
             PriorityThreadPool::Task task;
-            task.work_function = [tablet, task_size = tablets.size(), this]() {
-                Status st = tablet->cooldown();
+            RowsetSharedPtr rowset = rowsets[index++];
+            task.work_function = [tablet, rowset, task_size = tablets.size(), 
this]() {

Review Comment:
   It seems we could use `std::move` to decrease two shared ptr copy



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to