imay commented on a change in pull request #3136: [tablet meta] Do some refactor on TabletMeta URL: https://github.com/apache/incubator-doris/pull/3136#discussion_r395403951
########## File path: be/src/olap/task/engine_storage_migration_task.cpp ########## @@ -234,21 +225,13 @@ OLAPStatus EngineStorageMigrationTask::_storage_medium_migrate( } // TODO(ygl): lost some infomation here, such as cumulative layer point -OLAPStatus EngineStorageMigrationTask::_generate_new_header( +void EngineStorageMigrationTask::_generate_new_header( DataDir* store, const uint64_t new_shard, const TabletSharedPtr& tablet, const std::vector<RowsetSharedPtr>& consistent_rowsets, TabletMetaSharedPtr new_tablet_meta) { - if (store == nullptr) { - LOG(WARNING) << "fail to generate new header for store is null"; - return OLAP_ERR_HEADER_INIT_FAILED; - } - OLAPStatus res = tablet->generate_tablet_meta_copy(new_tablet_meta); - if (res != OLAP_SUCCESS) { - LOG(WARNING) << "could not generate new tablet meta. " - << "tablet:" << tablet->full_name(); - return res; - } + DCHECK(store); Review comment: ```suggestion DCHECK(store != nullptr); ``` Prefer "var != nullptr" for pointer compare. Only use this when the bool value ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org