chaoyli commented on a change in pull request #906: Remove alter task related 
header lock
URL: https://github.com/apache/incubator-doris/pull/906#discussion_r274407501
 
 

 ##########
 File path: be/src/olap/delta_writer.cpp
 ##########
 @@ -81,24 +81,22 @@ OLAPStatus DeltaWriter::init() {
                             _req.partition_id, _req.txn_id,
                             _req.tablet_id, _req.schema_hash, _req.load_id));
         if (_req.need_gen_rollup) {
-            _tablet->obtain_header_rdlock();
-            bool has_alter_task = _tablet->has_alter_task();
-            const AlterTabletTask& alter_task = _tablet->alter_task();
-            AlterTabletState alter_state = alter_task.alter_state();
-            TTabletId new_tablet_id = alter_task.related_tablet_id();
-            TSchemaHash new_schema_hash = alter_task.related_schema_hash();;
-            _tablet->release_header_lock();
-
-            if (has_alter_task && alter_state != ALTER_FAILED) {
-                LOG(INFO) << "load with schema change." << "old_tablet_id: " 
<< _tablet->tablet_id() << ", "
-                          << "old_schema_hash: " << _tablet->schema_hash() <<  
", "
-                          << "new_tablet_id: " << new_tablet_id << ", "
-                          << "new_schema_hash: " << new_schema_hash << ", "
-                          << "transaction_id: " << _req.txn_id;
-                _new_tablet = 
StorageEngine::instance()->tablet_manager()->get_tablet(new_tablet_id, 
new_schema_hash);
-                StorageEngine::instance()->txn_manager()->prepare_txn(
-                                    _req.partition_id, _req.txn_id,
-                                    new_tablet_id, new_schema_hash, 
_req.load_id);
+            AlterTabletTaskSharedPtr alter_task = _tablet->alter_task();
+            if (alter_task != nullptr) {
 
 Review comment:
   if (alter_task != nullptr && alter_task->alter_state() != ALTER_FAILED) {

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

Reply via email to