kangpinghuang commented on a change in pull request #932: Refactor tablet mgr
code
URL: https://github.com/apache/incubator-doris/pull/932#discussion_r275693511
##########
File path: be/src/olap/tablet_manager.cpp
##########
@@ -100,15 +99,22 @@ OLAPStatus TabletManager::add_tablet(TTabletId tablet_id,
SchemaHash schema_hash
if (table_item == nullptr) {
_tablet_map[tablet_id].table_arr.push_back(tablet);
_tablet_map[tablet_id].table_arr.sort(_sort_tablet_by_creation_time);
- _tablet_map_lock.unlock();
return res;
}
- _tablet_map_lock.unlock();
if (!force) {
if (table_item->tablet_path() == tablet->tablet_path()) {
LOG(WARNING) << "add the same tablet twice! tablet_id="
- << tablet_id << " schema_hash=" << tablet_id;
+ << tablet_id << " schema_hash=" << tablet_id;
+ return OLAP_ERR_ENGINE_INSERT_EXISTS_TABLE;
+ }
+ }
+
+ // if not force, the data dir should not same
+ if (!force) {
+ if (table_item->data_dir() == tablet->data_dir()) {
Review comment:
move these lines to line 110
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]