You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/07/23 02:32:04 UTC

[GitHub] [incubator-doris] yiguolei commented on a change in pull request #1497: Add ALTER_TABLET task in be

yiguolei commented on a change in pull request #1497: Add ALTER_TABLET task in be
URL: https://github.com/apache/incubator-doris/pull/1497#discussion_r306106519
 
 

 ##########
 File path: be/src/olap/schema_change.cpp
 ##########
 @@ -1121,6 +1121,207 @@ bool SchemaChangeWithSorting::_external_sorting(
     return true;
 }
 
+OLAPStatus SchemaChangeHandler::process_alter_tablet_v2(const TAlterTabletReqV2& request) {
+    LOG(INFO) << "begin to validate alter tablet request. base_tablet_id=" << request.base_tablet_id
+              << ", base_schema_hash" << request.base_schema_hash
+              << ", new_tablet_id=" << request.new_tablet_id
+              << ", new_schema_hash=" << request.new_schema_hash
+              << ", alter_version=" << request.alter_version
+              << ", alter_version_hash=" << request.alter_version_hash;
+
+    // Lock schema_change_lock util schema change info is stored in tablet header
+    if (!StorageEngine::instance()->tablet_manager()->try_schema_change_lock(request.base_tablet_id)) {
+        LOG(WARNING) << "failed to obtain schema change lock. "
+                     << "base_tablet=" << request.base_tablet_id;
+        return OLAP_ERR_TRY_LOCK_FAILED;
+    }
+
+    OLAPStatus res = _do_process_alter_tablet_v2(request);
+    LOG(INFO) << "finished alter tablet process, res=" << res;
+    StorageEngine::instance()->tablet_manager()->release_schema_change_lock(request.base_tablet_id);
+    return res;
+}
+
+OLAPStatus SchemaChangeHandler::_do_process_alter_tablet_v2(const TAlterTabletReqV2& request) {
 
 Review comment:
   NOT_READY tablet is created during create tablet task.

----------------------------------------------------------------
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: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org