acelyc111 commented on a change in pull request #5124:
URL: https://github.com/apache/incubator-doris/pull/5124#discussion_r554294341
##########
File path: be/src/olap/olap_server.cpp
##########
@@ -390,7 +379,7 @@ void StorageEngine::_compaction_tasks_producer_callback() {
} else {
sleep(config::check_auto_compaction_interval_seconds);
}
- }
+ } while
(!_stop_background_threads_latch.wait_for(MonoDelta::FromMilliseconds(interval)));
Review comment:
Need to call `THREAD_JOIN(_compaction_tasks_producer_thread);` in
StorageEngine::stop(), otherwise it's still unsafe as described in
https://github.com/apache/incubator-doris/issues/5213
##########
File path: be/src/olap/olap_server.cpp
##########
@@ -412,4 +401,26 @@ std::vector<TabletSharedPtr>
StorageEngine::_compaction_tasks_generator(
}
return tablets_compaction;
}
+
+void StorageEngine::_push_tablet_into_submitted_compaction(TabletSharedPtr
tablet) {
+ std::unique_lock<std::mutex> lock(_tablet_submitted_compaction_mutex);
+ _tablet_submitted_compaction[tablet->data_dir()].emplace_back(
+ tablet->tablet_id());
+}
+
+void StorageEngine::_pop_tablet_from_submitted_compaction(TabletSharedPtr
tablet) {
+ std::unique_lock<std::mutex> lock(_tablet_submitted_compaction_mutex);
+ std::vector<TTabletId>::iterator it_tablet =
+ find(_tablet_submitted_compaction[tablet->data_dir()].begin(),
+ _tablet_submitted_compaction[tablet->data_dir()].end(),
+ tablet->tablet_id());
Review comment:
What's the reason not use std::set?
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]