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/04/11 13:01:01 UTC

[GitHub] [incubator-doris] chaoyli commented on a change in pull request #906: Remove alter task related header lock

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_r274406504
 
 

 ##########
 File path: be/src/olap/tablet_meta.cpp
 ##########
 @@ -580,16 +582,26 @@ bool TabletMeta::version_for_delete_predicate(const Version& version) {
 }
 
 OLAPStatus TabletMeta::add_alter_task(const AlterTabletTask& alter_task) {
-    _alter_task = alter_task;
-    RETURN_NOT_OK(_alter_task.to_alter_pb(_tablet_meta_pb.mutable_alter_tablet_task()));
-    _has_alter_task = true;
+    WriteLock wrlock(&_meta_lock);
+    AlterTabletTask* alter_tablet_task = new AlterTabletTask();
+    *alter_tablet_task = alter_task;
+    RETURN_NOT_OK(alter_tablet_task->to_alter_pb(_tablet_meta_pb.mutable_alter_tablet_task()));
+    _alter_task.reset(alter_tablet_task);
     return OLAP_SUCCESS;
 }
 
 OLAPStatus TabletMeta::delete_alter_task() {
+    WriteLock wrlock(&_meta_lock);
+    _alter_task.reset();
     _tablet_meta_pb.clear_alter_tablet_task();
-    _has_alter_task = false;
     return OLAP_SUCCESS;
 }
 
+void TabletMeta::set_alter_state(AlterTabletState alter_state) {
 
 Review comment:
   no place to set alter_state?

----------------------------------------------------------------
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