yiguolei commented on a change in pull request #1976: And multi-path in
RowsetGraph
URL: https://github.com/apache/incubator-doris/pull/1976#discussion_r334338676
##########
File path: be/src/olap/task/engine_clone_task.cpp
##########
@@ -739,19 +739,34 @@ OLAPStatus
EngineCloneTask::_clone_incremental_data(TabletSharedPtr tablet, cons
// check missing versions exist in clone src
for (Version version : missed_versions) {
- RowsetMetaSharedPtr inc_rs_meta =
cloned_tablet_meta.acquire_inc_rs_meta_by_version(version);
- if (inc_rs_meta == nullptr) {
+ RowsetMetaSharedPtr rs_meta =
cloned_tablet_meta.acquire_rs_meta_by_version(version);
+ if (rs_meta == nullptr) {
LOG(WARNING) << "missed version is not found in cloned tablet
meta."
<< ", missed_version=" << version.first << "-" <<
version.second;
return OLAP_ERR_VERSION_NOT_EXIST;
}
- rowsets_to_clone.push_back(inc_rs_meta);
+ rs_metas.push_back(rs_meta);
}
// clone_data to tablet
- OLAPStatus clone_res = tablet->revise_tablet_meta(rowsets_to_clone,
versions_to_delete);
- LOG(INFO) << "finish to incremental clone. [tablet=" <<
tablet->full_name() << " res=" << clone_res << "]";
+
+ OLAPStatus res = OLAP_SUCCESS;
+ vector<RowsetSharedPtr> rowsets_to_clone;
+ for (auto& rs_meta : rs_metas) {
+ Version version = { rs_meta->start_version(), rs_meta->end_version() };
+ RowsetSharedPtr rowset;
+ res = RowsetFactory::create_rowset(&(tablet->tablet_schema()),
tablet->tablet_path(),
+ tablet->data_dir(), rs_meta,
&rowset);
+ if (res != OLAP_SUCCESS) {
+ LOG(WARNING) << "fail to init rowset. version=" << version.first
<< "-" << version.second;
+ return res;
+ }
+ rowsets_to_clone.push_back(rowset);
+ }
+
+ OLAPStatus clone_res = tablet->add_rowsets(rowsets_to_clone);
Review comment:
may be add rowsets should return the rowset that already exist in tablet
meta. And the callers could depend on the return value to remove the unused
rowset.
----------------------------------------------------------------
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]