Fix no checksum reported by ddl execution
This commit is contained in:
@ -763,10 +763,12 @@ int ObTenantTabletScheduler::schedule_tablet_ddl_major_merge(ObTabletHandle &tab
|
||||
} else {
|
||||
ret = OB_SUCCESS;
|
||||
}
|
||||
} else if (kv_mgr_handle.is_valid() && kv_mgr_handle.get_obj()->can_schedule_major_compaction(tablet_handle.get_obj()->get_tablet_meta())) {
|
||||
} else if (kv_mgr_handle.is_valid()) {
|
||||
ObDDLTableMergeDagParam param;
|
||||
if (OB_FAIL(kv_mgr_handle.get_obj()->get_ddl_major_merge_param(param))) {
|
||||
LOG_WARN("get ddl major merge param failed", K(ret));
|
||||
if (OB_FAIL(kv_mgr_handle.get_obj()->get_ddl_major_merge_param(tablet_handle.get_obj()->get_tablet_meta(), param))) {
|
||||
if (OB_EAGAIN != ret) {
|
||||
LOG_WARN("failed to get ddl major merge param", K(ret));
|
||||
}
|
||||
} else if (OB_FAIL(compaction::ObScheduleDagFunc::schedule_ddl_table_merge_dag(param))) {
|
||||
if (OB_SIZE_OVERFLOW != ret && OB_EAGAIN != ret) {
|
||||
LOG_WARN("schedule ddl merge dag failed", K(ret), K(param));
|
||||
|
||||
@ -1102,6 +1102,7 @@ int ObDDLSSTableRedoWriter::end_ddl_redo_and_create_ddl_sstable(
|
||||
LOG_WARN("get tablet failed", K(ret));
|
||||
} else if (OB_FAIL(tablet_handle.get_obj()->get_ddl_kv_mgr(ddl_kv_mgr_handle))) {
|
||||
LOG_WARN("get ddl kv manager failed", K(ret), K(ls_id), K(tablet_id));
|
||||
} else if (OB_FALSE_IT(ddl_kv_mgr_handle.get_obj()->prepare_info_for_checksum_report(table_id, ddl_task_id))) {
|
||||
} else if (OB_FAIL(write_commit_log(tablet_handle, ddl_kv_mgr_handle, table_key, table_id, execution_id, ddl_task_id, commit_scn))) {
|
||||
if (OB_TASK_EXPIRED == ret) {
|
||||
LOG_INFO("ddl task expired", K(ret), K(table_key), K(table_id), K(execution_id), K(ddl_task_id));
|
||||
|
||||
@ -304,17 +304,22 @@ int ObTabletDDLKvMgr::wait_ddl_merge_success(const SCN &start_scn, const SCN &co
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObTabletDDLKvMgr::get_ddl_major_merge_param(ObDDLTableMergeDagParam ¶m)
|
||||
int ObTabletDDLKvMgr::get_ddl_major_merge_param(const ObTabletMeta &tablet_meta, ObDDLTableMergeDagParam ¶m)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObLatchRGuard guard(lock_, ObLatchIds::TABLET_DDL_KV_MGR_LOCK);
|
||||
if (can_schedule_major_compaction_nolock(tablet_meta)) {
|
||||
param.ls_id_ = ls_id_;
|
||||
param.tablet_id_ = tablet_id_;
|
||||
param.rec_scn_ = commit_scn_;
|
||||
param.rec_scn_ = get_commit_scn_nolock(tablet_meta);
|
||||
param.is_commit_ = true;
|
||||
param.start_scn_ = start_scn_;
|
||||
param.table_id_ = table_id_;
|
||||
param.execution_id_ = execution_id_;
|
||||
param.ddl_task_id_ = ddl_task_id_;
|
||||
} else {
|
||||
ret = OB_EAGAIN;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -476,12 +481,6 @@ void ObTabletDDLKvMgr::reset_commit_success()
|
||||
success_start_scn_.set_min();
|
||||
}
|
||||
|
||||
bool ObTabletDDLKvMgr::can_schedule_major_compaction(const ObTabletMeta &tablet_meta)
|
||||
{
|
||||
ObLatchRGuard guard(lock_, ObLatchIds::TABLET_DDL_KV_MGR_LOCK);
|
||||
return can_schedule_major_compaction_nolock(tablet_meta);
|
||||
}
|
||||
|
||||
bool ObTabletDDLKvMgr::can_schedule_major_compaction_nolock(const ObTabletMeta &tablet_meta)
|
||||
{
|
||||
return get_commit_scn_nolock(tablet_meta).is_valid_and_not_min() && !is_commit_success_unlock();
|
||||
|
||||
@ -74,10 +74,10 @@ public:
|
||||
OB_INLINE int64_t dec_ref() { return ATOMIC_SAF(&ref_cnt_, 1 /* just sub 1 */); }
|
||||
OB_INLINE int64_t get_ref() const { return ATOMIC_LOAD(&ref_cnt_); }
|
||||
OB_INLINE void reset() { destroy(); }
|
||||
bool can_schedule_major_compaction(const ObTabletMeta &tablet_meta);
|
||||
bool can_schedule_major_compaction_nolock(const ObTabletMeta &tablet_meta);
|
||||
int get_ddl_major_merge_param(ObDDLTableMergeDagParam &merge_param);
|
||||
int get_ddl_major_merge_param(const ObTabletMeta &tablet_meta, ObDDLTableMergeDagParam &merge_param);
|
||||
int get_rec_scn(share::SCN &rec_scn);
|
||||
void prepare_info_for_checksum_report(const uint64_t table_id, const int64_t ddl_task_id) { table_id_ = table_id; ddl_task_id_ = ddl_task_id; }
|
||||
TO_STRING_KV(K_(is_inited), K_(success_start_scn), K_(ls_id), K_(tablet_id), K_(table_key),
|
||||
K_(cluster_version), K_(start_scn), K_(commit_scn), K_(max_freeze_scn),
|
||||
K_(table_id), K_(execution_id), K_(ddl_task_id), K_(head), K_(tail), K_(ref_cnt));
|
||||
|
||||
Reference in New Issue
Block a user