weizuo93 commented on a change in pull request #5278:
URL: https://github.com/apache/incubator-doris/pull/5278#discussion_r562378984
##########
File path: be/src/olap/tablet_manager.cpp
##########
@@ -1490,9 +1490,13 @@ void
TabletManager::get_tablets_distribution_on_different_disks(
std::map<int64_t, std::map<DataDir*, int64_t>>
&tablets_num_on_disk,
std::map<int64_t, std::map<DataDir*,
std::vector<TabletSize>>> &tablets_info_on_disk) {
std::vector<DataDir*> data_dirs = StorageEngine::instance()->get_stores();
- ReadLock rlock(&_partition_tablet_map_lock);
- std::map<int64_t, std::set<TabletInfo>>::iterator partition_iter =
_partition_tablet_map.begin();
- for (; partition_iter != _partition_tablet_map.end(); partition_iter++) {
+ std::map<int64_t, std::set<TabletInfo>> partition_tablet_map;
+ {
+ ReadLock rlock(&_partition_tablet_map_lock);
Review comment:
> Could you please to add comment to explain why we need lock and copy
the `_partition_tablet_map`?
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]