You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/10/14 08:06:17 UTC

[GitHub] [incubator-doris] chaoyli commented on a change in pull request #1976: And multi-path in RowsetGraph

chaoyli commented on a change in pull request #1976: And multi-path in RowsetGraph
URL: https://github.com/apache/incubator-doris/pull/1976#discussion_r334363207
 
 

 ##########
 File path: be/src/olap/tablet.cpp
 ##########
 @@ -283,35 +164,70 @@ OLAPStatus Tablet::add_rowset(RowsetSharedPtr rowset, bool need_persist) {
             LOG(FATAL) << "failed to save rowset to local meta store" << rowset->rowset_id();
         }
     }
+    RETURN_NOT_OK(save_meta());
     ++_newly_created_rowset_num;
     return OLAP_SUCCESS;
 }
 
-OLAPStatus Tablet::modify_rowsets(const vector<RowsetSharedPtr>& to_add,
-                                  const vector<RowsetSharedPtr>& to_delete) {
+OLAPStatus Tablet::add_rowsets(const vector<RowsetSharedPtr>& to_add) {
+    WriteLock wrlock(&_meta_lock);
+
+    // Add rowsets to tablet_meta for compaction/clone/alter table/rollup.
+    // Before taking these rowsets into effect, should
+    // check shortest-path existence after adding rowsets
+
     vector<RowsetMetaSharedPtr> rs_metas_to_add;
     for (auto& rs : to_add) {
         rs_metas_to_add.push_back(rs->rowset_meta());
     }
 
+    TabletMetaSharedPtr new_tablet_meta(new TabletMeta());
+    RETURN_NOT_OK(TabletMetaManager::get_meta(_data_dir, tablet_id(), schema_hash(), new_tablet_meta));
+    new_tablet_meta->add_rs_metas(rs_metas_to_add);
 
 Review comment:
   OK

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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