提交 2b80efbf 编写于 作者: O obdev 提交者: OB-robot

Skip ready_for_flush if migration_clog_checkpoint >= end_log_ts

上级 ede1903f
......@@ -1653,6 +1653,13 @@ bool ObMemtable::ready_for_flush_()
int ret = OB_SUCCESS;
int64_t current_right_boundary = ObLogTsRange::MIN_TS;
share::ObLSID ls_id = freezer_->get_ls_id();
int64_t migration_clog_checkpoint_ts = get_migration_clog_checkpoint_ts();
if (ObLogTsRange::MIN_TS != migration_clog_checkpoint_ts &&
migration_clog_checkpoint_ts >= get_end_log_ts() &&
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.
先完成此消息的编辑!
想要评论请 注册