chaoyli commented on a change in pull request #628: Fix bug in rollback txn case
URL: https://github.com/apache/incubator-doris/pull/628#discussion_r256298692
##########
File path: be/src/olap/task/engine_clear_alter_task.cpp
##########
@@ -46,26 +46,21 @@ OLAPStatus EngineClearAlterTask::_clear_alter_task(const
TTabletId tablet_id,
const AlterTabletTask& alter_task = tablet->alter_task();
AlterTabletState alter_state = alter_task.alter_state();
TTabletId related_tablet_id = alter_task.related_tablet_id();
- TSchemaHash related_schema_hash = alter_task.related_schema_hash();;
+ TSchemaHash related_schema_hash = alter_task.related_schema_hash();
tablet->release_header_lock();
if (alter_state == AlterTabletState::ALTER_NONE) {
return OLAP_SUCCESS;
- } else {
+ }
+
+ if (alter_state == AlterTabletState::ALTER_ALTERING) {
LOG(WARNING) << "find alter task unfinished when process clear alter
task. "
<< "tablet=" << tablet->full_name();
return OLAP_ERR_PREVIOUS_SCHEMA_CHANGE_NOT_FINISHED;
}
// clear schema change info
- tablet->obtain_header_wrlock();
- tablet->delete_alter_task();
- OLAPStatus res = tablet->save_tablet_meta();
- if (res != OLAP_SUCCESS) {
- LOG(FATAL) << "fail to save header. [res=" << res << " tablet='" <<
tablet->full_name() << "']";
- } else {
- LOG(INFO) << "clear alter task on tablet. [tablet='" <<
tablet->full_name() << "']";
- }
- tablet->release_header_lock();
+ OLAPStatus res = OLAP_SUCCESS;
+ res = tablet->protected_delete_alter_task();
Review comment:
OLAPStatus res = protected_delete_alter_task();
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]