Avoid get_tablet in get_rec_scn after ddl commit success
This commit is contained in:
@ -160,6 +160,11 @@ int ObTabletDDLKvMgr::ddl_start(ObTablet &tablet,
|
||||
saved_start_scn = start_scn_;
|
||||
saved_snapshot_version = table_key_.get_snapshot_version();
|
||||
commit_scn_ = get_commit_scn_nolock(tablet.get_tablet_meta());
|
||||
if (checkpoint_scn.is_valid_and_not_min()) {
|
||||
if (tablet.get_tablet_meta().table_store_flag_.with_major_sstable() && tablet.get_tablet_meta().ddl_commit_scn_.is_valid_and_not_min()) {
|
||||
success_start_scn_ = tablet.get_tablet_meta().ddl_start_scn_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret) && !checkpoint_scn.is_valid_and_not_min()) {
|
||||
@ -349,10 +354,13 @@ int ObTabletDDLKvMgr::get_rec_scn(SCN &rec_scn)
|
||||
int ret = OB_SUCCESS;
|
||||
ObLSHandle ls_handle;
|
||||
ObTabletHandle tablet_handle;
|
||||
const bool is_commit_succ = is_commit_success();
|
||||
if (OB_UNLIKELY(!is_inited_)) {
|
||||
ret = OB_NOT_INIT;
|
||||
LOG_WARN("not init", K(ret), K(is_inited_));
|
||||
} else if (OB_FAIL(MTL(ObLSService *)->get_ls(ls_id_, ls_handle, ObLSGetMod::DDL_MOD))) {
|
||||
}
|
||||
if (OB_SUCC(ret) && !is_commit_succ) {
|
||||
if (OB_FAIL(MTL(ObLSService *)->get_ls(ls_id_, ls_handle, ObLSGetMod::DDL_MOD))) {
|
||||
LOG_WARN("failed to get log stream", K(ret), K(ls_id_));
|
||||
} else if (OB_FAIL(ls_handle.get_ls()->get_tablet(tablet_id_,
|
||||
tablet_handle,
|
||||
@ -385,6 +393,7 @@ int ObTabletDDLKvMgr::get_rec_scn(SCN &rec_scn)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rec scn of ddl redo
|
||||
if (OB_SUCC(ret)) {
|
||||
|
Reference in New Issue
Block a user