judge errno before set errsim
This commit is contained in:
		@ -241,11 +241,13 @@ int ObMediumCompactionScheduleFunc::schedule_next_medium_primary_cluster(
 | 
				
			|||||||
  LOG_DEBUG("schedule next medium in primary cluster", K(ret), KPC(this), K(schedule_medium_flag),
 | 
					  LOG_DEBUG("schedule next medium in primary cluster", K(ret), KPC(this), K(schedule_medium_flag),
 | 
				
			||||||
      K(schedule_major_snapshot), K(adaptive_merge_reason), KPC(last_major), K(medium_list), K(max_sync_medium_scn));
 | 
					      K(schedule_major_snapshot), K(adaptive_merge_reason), KPC(last_major), K(medium_list), K(max_sync_medium_scn));
 | 
				
			||||||
#ifdef ERRSIM
 | 
					#ifdef ERRSIM
 | 
				
			||||||
  ret = OB_E(EventTable::EN_SCHEDULE_MEDIUM_COMPACTION) ret;
 | 
					  if (OB_SUCC(ret)) {
 | 
				
			||||||
  if (OB_FAIL(ret) && tablet_.get_tablet_meta().tablet_id_.id() > ObTabletID::MIN_USER_TABLET_ID) {
 | 
					    ret = OB_E(EventTable::EN_SCHEDULE_MEDIUM_COMPACTION) ret;
 | 
				
			||||||
    FLOG_INFO("set schedule medium with errsim", KPC(this));
 | 
					    if (OB_FAIL(ret) && tablet_.get_tablet_meta().tablet_id_.id() > ObTabletID::MIN_USER_TABLET_ID) {
 | 
				
			||||||
    ret = OB_SUCCESS;
 | 
					      FLOG_INFO("set schedule medium with errsim", KPC(this));
 | 
				
			||||||
    schedule_medium_flag = true;
 | 
					      ret = OB_SUCCESS;
 | 
				
			||||||
 | 
					      schedule_medium_flag = true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -358,10 +360,12 @@ int ObMediumCompactionScheduleFunc::decide_medium_snapshot(
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#ifdef ERRSIM
 | 
					#ifdef ERRSIM
 | 
				
			||||||
  ret = OB_E(EventTable::EN_SCHEDULE_MEDIUM_COMPACTION) ret;
 | 
					  if (OB_SUCC(ret)) {
 | 
				
			||||||
  if (OB_FAIL(ret) && tablet_.get_tablet_meta().tablet_id_.id() > ObTabletID::MIN_USER_TABLET_ID) {
 | 
					    ret = OB_E(EventTable::EN_SCHEDULE_MEDIUM_COMPACTION) ret;
 | 
				
			||||||
    FLOG_INFO("set schedule medium with errsim", KPC(this));
 | 
					    if (OB_FAIL(ret) && tablet_.get_tablet_meta().tablet_id_.id() > ObTabletID::MIN_USER_TABLET_ID) {
 | 
				
			||||||
    ret = OB_SUCCESS;
 | 
					      FLOG_INFO("set schedule medium with errsim", KPC(this));
 | 
				
			||||||
 | 
					      ret = OB_SUCCESS;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (FAILEDx(prepare_medium_info(result, medium_info))) {
 | 
					    if (FAILEDx(prepare_medium_info(result, medium_info))) {
 | 
				
			||||||
@ -620,18 +624,20 @@ int ObMediumCompactionScheduleFunc::get_table_schema_to_merge(
 | 
				
			|||||||
    LOG_WARN("table is deleted", K(ret), K(table_id));
 | 
					    LOG_WARN("table is deleted", K(ret), K(table_id));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#ifdef ERRSIM
 | 
					#ifdef ERRSIM
 | 
				
			||||||
  static bool have_set_errno = false;
 | 
					  if (OB_SUCC(ret)) {
 | 
				
			||||||
  static ObTabletID errno_tablet_id;
 | 
					    static bool have_set_errno = false;
 | 
				
			||||||
  ret = OB_E(EventTable::EN_SCHEDULE_MAJOR_GET_TABLE_SCHEMA) ret;
 | 
					    static ObTabletID errno_tablet_id;
 | 
				
			||||||
  if (OB_FAIL(ret)) {
 | 
					    ret = OB_E(EventTable::EN_SCHEDULE_MAJOR_GET_TABLE_SCHEMA) ret;
 | 
				
			||||||
    if (tablet_id.id() > ObTabletID::MIN_USER_TABLET_ID
 | 
					    if (OB_FAIL(ret)) {
 | 
				
			||||||
      && tablet_id != tablet.get_tablet_meta().data_tablet_id_
 | 
					      if (tablet_id.id() > ObTabletID::MIN_USER_TABLET_ID
 | 
				
			||||||
      && ATOMIC_BCAS(&have_set_errno, false, true)) {
 | 
					        && tablet_id != tablet.get_tablet_meta().data_tablet_id_
 | 
				
			||||||
      LOG_INFO("set get table schema failed with errsim", K(ret), K(table_id), K(tablet_id));
 | 
					        && ATOMIC_BCAS(&have_set_errno, false, true)) {
 | 
				
			||||||
      errno_tablet_id = tablet_id;
 | 
					        LOG_INFO("set get table schema failed with errsim", K(ret), K(table_id), K(tablet_id));
 | 
				
			||||||
      return ret;
 | 
					        errno_tablet_id = tablet_id;
 | 
				
			||||||
    } else {
 | 
					        return ret;
 | 
				
			||||||
      ret = OB_SUCCESS;
 | 
					      } else {
 | 
				
			||||||
 | 
					        ret = OB_SUCCESS;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@ -754,9 +760,11 @@ int ObMediumCompactionScheduleFunc::check_medium_checksum_table(
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#ifdef ERRSIM
 | 
					#ifdef ERRSIM
 | 
				
			||||||
    ret = OB_E(EventTable::EN_MEDIUM_REPLICA_CHECKSUM_ERROR) OB_SUCCESS;
 | 
					    if (OB_SUCC(ret)) {
 | 
				
			||||||
    if (OB_FAIL(ret)) {
 | 
					      ret = OB_E(EventTable::EN_MEDIUM_REPLICA_CHECKSUM_ERROR) OB_SUCCESS;
 | 
				
			||||||
      STORAGE_LOG(INFO, "ERRSIM EN_MEDIUM_REPLICA_CHECKSUM_ERROR", K(ret), K(ls_id), K(tablet_id));
 | 
					      if (OB_FAIL(ret)) {
 | 
				
			||||||
 | 
					        STORAGE_LOG(INFO, "ERRSIM EN_MEDIUM_REPLICA_CHECKSUM_ERROR", K(ret), K(ls_id), K(tablet_id));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (OB_CHECKSUM_ERROR == ret) {
 | 
					    if (OB_CHECKSUM_ERROR == ret) {
 | 
				
			||||||
 | 
				
			|||||||
@ -1343,10 +1343,12 @@ int ObAdaptiveMergePolicy::find_meta_major_tables(
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef ERRSIM
 | 
					#ifdef ERRSIM
 | 
				
			||||||
  ret = OB_E(EventTable::EN_SCHEDULE_MEDIUM_COMPACTION) ret;
 | 
					  if (OB_NO_NEED_MERGE = ret) {
 | 
				
			||||||
  if (OB_FAIL(ret) && tablet.get_tablet_meta().tablet_id_.id() > ObTabletID::MIN_USER_TABLET_ID) {
 | 
					    ret = OB_E(EventTable::EN_SCHEDULE_MEDIUM_COMPACTION) ret;
 | 
				
			||||||
    FLOG_INFO("set schedule medium with errsim", "tablet_id", tablet.get_tablet_meta().tablet_id_);
 | 
					    if (OB_FAIL(ret) && tablet.get_tablet_meta().tablet_id_.id() > ObTabletID::MIN_USER_TABLET_ID) {
 | 
				
			||||||
    ret = OB_SUCCESS;
 | 
					      FLOG_INFO("set schedule medium with errsim", "tablet_id", tablet.get_tablet_meta().tablet_id_);
 | 
				
			||||||
 | 
					      ret = OB_SUCCESS;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user