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