finish progress in abnormal situation
This commit is contained in:
		@ -698,15 +698,17 @@ int ObMajorMergeProgressChecker::set_table_compaction_info_status(
 | 
			
		||||
int ObMajorMergeProgressChecker::validate_index_ckm()
 | 
			
		||||
{
 | 
			
		||||
  int ret = OB_SUCCESS;
 | 
			
		||||
  if (idx_ckm_validate_array_.count() < 50
 | 
			
		||||
    && progress_.get_wait_index_ckm_table_cnt() > 100
 | 
			
		||||
    && !is_extra_check_round()) {
 | 
			
		||||
    // do nothing
 | 
			
		||||
  } else if (idx_ckm_validate_array_.count() > 0) {
 | 
			
		||||
    if (OB_FAIL(loop_index_ckm_validate_array())) {
 | 
			
		||||
      LOG_WARN("failed to loop index ckm validate array", KR(ret), K_(tenant_id));
 | 
			
		||||
  if (idx_ckm_validate_array_.count() > 0) {
 | 
			
		||||
    if (idx_ckm_validate_array_.count() < 50
 | 
			
		||||
      && progress_.get_wait_index_ckm_table_cnt() > 100
 | 
			
		||||
      && !is_extra_check_round()) {
 | 
			
		||||
      // do nothing
 | 
			
		||||
    } else {
 | 
			
		||||
      if (OB_FAIL(loop_index_ckm_validate_array())) {
 | 
			
		||||
        LOG_WARN("failed to loop index ckm validate array", KR(ret), K_(tenant_id));
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    idx_ckm_validate_array_.reset();
 | 
			
		||||
    idx_ckm_validate_array_.reuse(); // reuse array
 | 
			
		||||
  }
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -521,13 +521,15 @@ int ObMajorMergeScheduler::handle_merge_progress(
 | 
			
		||||
    const int64_t expected_epoch)
 | 
			
		||||
{
 | 
			
		||||
  int ret = OB_SUCCESS;
 | 
			
		||||
  if (progress.is_merge_finished()) {
 | 
			
		||||
    LOG_INFO("merge completed", K(global_broadcast_scn), K(progress));
 | 
			
		||||
  if (progress.is_merge_finished() || progress.is_merge_abnomal()) {
 | 
			
		||||
    if (progress.is_merge_abnomal()) {
 | 
			
		||||
      LOG_WARN("merge progress is abnomal, finish progress anyway", K(global_broadcast_scn), K(progress));
 | 
			
		||||
    } else {
 | 
			
		||||
      LOG_INFO("merge completed", K(global_broadcast_scn), K(progress));
 | 
			
		||||
    }
 | 
			
		||||
    if (OB_FAIL(try_update_global_merged_scn(expected_epoch))) { // MERGE_STATUS: change to IDLE
 | 
			
		||||
      LOG_WARN("fail to update global_merged_scn", KR(ret), K_(tenant_id), K(expected_epoch));
 | 
			
		||||
    }
 | 
			
		||||
  } else if (progress.is_merge_abnomal()) {
 | 
			
		||||
    LOG_WARN("merge progress is abnomal", K(global_broadcast_scn), K(progress));
 | 
			
		||||
  } else {
 | 
			
		||||
    LOG_INFO("this round of traversal is completed, but there are still tablets/tables that have not been merged",
 | 
			
		||||
      K(ret), K(global_broadcast_scn), K(progress));
 | 
			
		||||
 | 
			
		||||
@ -635,7 +635,7 @@ private:
 | 
			
		||||
    if (__pos < buf_size) {                                                                   \
 | 
			
		||||
      buf[__pos-1] = '\0';                                                                    \
 | 
			
		||||
    } else {                                                                                  \
 | 
			
		||||
      buf[__pos] = '\0';                                                                      \
 | 
			
		||||
      buf[buf_size - 1] = '\0';                                                               \
 | 
			
		||||
    }                                                                                         \
 | 
			
		||||
    return ret;                                                                               \
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -1248,13 +1248,12 @@ int ObMediumCompactionScheduleFunc::schedule_tablet_medium_merge(
 | 
			
		||||
    if (OB_FAIL(ret) || !schedule_flag) {
 | 
			
		||||
    } else {
 | 
			
		||||
      const int64_t major_frozen_snapshot = 0 == input_major_snapshot ? MTL(ObTenantTabletScheduler *)->get_frozen_version() : input_major_snapshot;
 | 
			
		||||
      ObMediumCompactionInfo::ObCompactionType compaction_type = ObMediumCompactionInfo::COMPACTION_TYPE_MAX;
 | 
			
		||||
      int64_t schedule_scn = 0;
 | 
			
		||||
      if (OB_FAIL(read_medium_info_from_list(*medium_list, last_major_snapshot,
 | 
			
		||||
          major_frozen_snapshot, compaction_type, schedule_scn))) {
 | 
			
		||||
          major_frozen_snapshot, schedule_scn))) {
 | 
			
		||||
        LOG_WARN("failed to read medium info from list", K(ret), K(ls_id), K(tablet_id), KPC(medium_list), K(last_major_snapshot));
 | 
			
		||||
      } else if (schedule_scn > 0
 | 
			
		||||
              && OB_FAIL(check_need_merge_and_schedule(ls, tablet, schedule_scn, compaction_type, tablet_need_freeze_flag, create_dag_flag))) {
 | 
			
		||||
              && OB_FAIL(check_need_merge_and_schedule(ls, tablet, schedule_scn, tablet_need_freeze_flag, create_dag_flag))) {
 | 
			
		||||
        LOG_WARN("failed to check medium merge", K(ret), K(ls_id), K(tablet_id), K(schedule_scn));
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
@ -1267,7 +1266,6 @@ int ObMediumCompactionScheduleFunc::read_medium_info_from_list(
 | 
			
		||||
  const ObMediumCompactionInfoList &medium_list,
 | 
			
		||||
  const int64_t last_major_snapshot,
 | 
			
		||||
  const int64_t major_frozen_snapshot,
 | 
			
		||||
  ObMediumCompactionInfo::ObCompactionType &compaction_type,
 | 
			
		||||
  int64_t &schedule_scn)
 | 
			
		||||
{
 | 
			
		||||
  int ret = OB_SUCCESS;
 | 
			
		||||
@ -1278,7 +1276,6 @@ int ObMediumCompactionScheduleFunc::read_medium_info_from_list(
 | 
			
		||||
      if (info->is_medium_compaction()
 | 
			
		||||
          || info->medium_snapshot_ <= major_frozen_snapshot) {
 | 
			
		||||
        schedule_scn = info->medium_snapshot_;
 | 
			
		||||
        compaction_type = (ObMediumCompactionInfo::ObCompactionType)info->compaction_type_;
 | 
			
		||||
      }
 | 
			
		||||
      break; // found one unfinish medium info, loop end
 | 
			
		||||
    }
 | 
			
		||||
@ -1308,7 +1305,6 @@ int ObMediumCompactionScheduleFunc::check_need_merge_and_schedule(
 | 
			
		||||
    ObLS &ls,
 | 
			
		||||
    ObTablet &tablet,
 | 
			
		||||
    const int64_t schedule_scn,
 | 
			
		||||
    const ObMediumCompactionInfo::ObCompactionType compaction_type,
 | 
			
		||||
    bool &tablet_need_freeze_flag,
 | 
			
		||||
    bool &create_dag_flag)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -55,7 +55,6 @@ public:
 | 
			
		||||
      const ObMediumCompactionInfoList &medium_list,
 | 
			
		||||
      const int64_t major_frozen_snapshot,
 | 
			
		||||
      const int64_t last_major_snapshot,
 | 
			
		||||
      ObMediumCompactionInfo::ObCompactionType &compaction_type,
 | 
			
		||||
      int64_t &schedule_scn);
 | 
			
		||||
  static int is_election_leader(const share::ObLSID &ls_id, bool &ls_election_leader);
 | 
			
		||||
  static int get_max_sync_medium_scn(
 | 
			
		||||
@ -141,7 +140,6 @@ protected:
 | 
			
		||||
      ObLS &ls,
 | 
			
		||||
      ObTablet &tablet,
 | 
			
		||||
      const int64_t schedule_scn,
 | 
			
		||||
      const ObMediumCompactionInfo::ObCompactionType compaction_type,
 | 
			
		||||
      bool &tablet_need_freeze_flag,
 | 
			
		||||
      bool &create_dag_flag);
 | 
			
		||||
  int schedule_next_medium_primary_cluster(
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user