提交 283a205f 编写于 作者: O obdev 提交者: OB-robot

Cherry-pick 'Skip ready_for_flush if migration_clog_checkpoint >= end_log_ts'

上级 f0c8b5bd
......@@ -1647,6 +1647,13 @@ bool ObMemtable::ready_for_flush_()
int ret = OB_SUCCESS;
SCN current_right_boundary = ObScnRange::MIN_SCN;
share::ObLSID ls_id = freezer_->get_ls_id();
const SCN migration_clog_checkpoint_scn = get_migration_clog_checkpoint_scn();
if (!migration_clog_checkpoint_scn.is_min() &&
migration_clog_checkpoint_scn >= get_end_scn() &&
0 != get_unsynced_cnt() &&
multi_source_data_.get_all_unsync_cnt_for_multi_data() == get_unsynced_cnt()) {
bool_ret = true;
}
if (bool_ret) {
if (OB_FAIL(resolve_snapshot_version_())) {
TRANS_LOG(WARN, "fail to resolve snapshot version", K(ret), KPC(this), K(ls_id));
......
......@@ -223,5 +223,20 @@ int ObMultiSourceData::get_unsync_cnt_for_multi_data(const MultiSourceDataUnitTy
return ret;
}
int64_t ObMultiSourceData::get_all_unsync_cnt_for_multi_data()
{
int ret = OB_SUCCESS;
int64_t unsynced_cnt_for_multi_data = 0;
for (int i = 0; i < MAX_PTR_COUNT; ++i) {
ObIMultiSourceDataUnit *value = units_[i];
if (nullptr != value && value->is_valid()) {
int64_t cnt = value->get_unsync_cnt_for_multi_data();
unsynced_cnt_for_multi_data += cnt;
}
}
return unsynced_cnt_for_multi_data;
}
} // namespace memtable
} // namespace oceanbase
......@@ -128,6 +128,7 @@ public:
int save_multi_source_data_unit(const T *const src, bool is_callback);
int update_unsync_cnt_for_multi_data(const MultiSourceDataUnitType multi_source_type, const bool is_inc);
int get_unsync_cnt_for_multi_data(const MultiSourceDataUnitType multi_source_type, int &unsynced_cnt_for_multi_data);
int64_t get_all_unsync_cnt_for_multi_data();
private:
int inner_mark_unit_sync_finish(
const int64_t unit_type,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册