[Fix] clear ddl commit flag in DDL start redo process

This commit is contained in:
obdev
2023-02-15 14:12:22 +00:00
committed by ob-robot
parent 07291ffaf2
commit efffd594cc
3 changed files with 9 additions and 0 deletions

View File

@ -1073,6 +1073,8 @@ int ObDDLSSTableRedoWriter::start_ddl_redo(const ObITable::TableKey &table_key,
} else if (FALSE_IT(set_start_scn(tmp_scn))) {
} else if (OB_FAIL(ddl_kv_mgr_handle.get_obj()->register_to_tablet(get_start_scn(), ddl_kv_mgr_handle))) {
LOG_WARN("register ddl kv mgr to tablet failed", K(ret), K(ls_id_), K(tablet_id_));
} else {
ddl_kv_mgr_handle.get_obj()->reset_commit_success(); // releated issue: https://work.aone.alibaba-inc.com/issue/47686927
}
return ret;
}

View File

@ -470,6 +470,12 @@ bool ObTabletDDLKvMgr::is_commit_success_unlock() const
return success_start_scn_ > SCN::min_scn() && success_start_scn_ == start_scn_;
}
void ObTabletDDLKvMgr::reset_commit_success()
{
ObLatchWGuard guard(lock_, ObLatchIds::TABLET_DDL_KV_MGR_LOCK);
success_start_scn_.set_min();
}
bool ObTabletDDLKvMgr::can_schedule_major_compaction(const ObTabletMeta &tablet_meta)
{
ObLatchRGuard guard(lock_, ObLatchIds::TABLET_DDL_KV_MGR_LOCK);

View File

@ -57,6 +57,7 @@ public:
share::SCN get_commit_scn(const ObTabletMeta &tablet_meta);
int set_commit_success(const share::SCN &start_scn);
bool is_commit_success();
void reset_commit_success();
common::ObTabletID get_tablet_id() const { return tablet_id_; }
share::ObLSID get_ls_id() const { return ls_id_; }
int cleanup();