fix some bugs

This commit is contained in:
a1iive
2023-11-28 11:42:03 +00:00
committed by ob-robot
parent 1f68ef7eec
commit 40f46b3fc8
7 changed files with 23 additions and 6 deletions

View File

@ -169,7 +169,8 @@ int ObAllVirtualServerCompactionProgress::fill_cells()
} }
{ {
int64_t pos = strlen(event_buf_); int64_t pos = strlen(event_buf_);
databuff_printf(event_buf_, sizeof(event_buf_), pos, "is_inited:%d", progress_.is_inited_); databuff_printf(event_buf_, sizeof(event_buf_), pos, "is_inited:%d,real_finish_cnt:%ld",
progress_.is_inited_, progress_.real_finish_cnt_);
} }
cells[i].set_varchar(event_buf_); cells[i].set_varchar(event_buf_);
cells[i].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); cells[i].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));

View File

@ -906,8 +906,10 @@ int ObMajorMergeProgressChecker::generate_tablet_status_map()
// source ls meta has been deleted, but source tablet meta has not been deleted yet. // source ls meta has been deleted, but source tablet meta has not been deleted yet.
ret = OB_SUCCESS; // ignore ret ret = OB_SUCCESS; // ignore ret
filter = true; filter = true;
LOG_INFO("ignore this tablet replica, sicne it is not in ls_info", K_(tenant_id), if (REACH_TIME_INTERVAL(10_s)) {
LOG_INFO("ignore this tablet replica, sicne it is not in ls_info", K_(tenant_id),
KPC(replica), K(ls_info)); KPC(replica), K(ls_info));
}
} else { } else {
LOG_WARN("fail to find ls replica", KR(ret), KPC(replica), K_(tenant_id)); LOG_WARN("fail to find ls replica", KR(ret), KPC(replica), K_(tenant_id));
} }

View File

@ -247,6 +247,15 @@ void ObCompactionDagStatus::update_finish_cnt(
} }
} }
int64_t ObCompactionDagStatus::get_cost_long_time(const int64_t prio)
{
int64_t ret_time = INT64_MAX;
if (0 < prio && COMPACTION_PRIORITY_MAX > prio) {
ret_time = COST_LONG_TIME[prio];
}
return ret_time;
}
/* /*
* ObCompactionSuggestionMgr implement * ObCompactionSuggestionMgr implement
* */ * */
@ -498,7 +507,7 @@ int ObCompactionSuggestionMgr::analyze_merge_info(
int64_t *scan_row_array = nullptr; int64_t *scan_row_array = nullptr;
bool need_suggestion = false; bool need_suggestion = false;
const int64_t buf_len = OB_DIAGNOSE_INFO_LENGTH; const int64_t buf_len = OB_DIAGNOSE_INFO_LENGTH;
if (ObCompactionDagStatus::COMPACTION_DAG_MAX > type && ObCompactionDagStatus::COST_LONG_TIME[type] <= cost_time) { if (ObCompactionDagStatus::get_cost_long_time(OB_DAG_TYPES[type].init_dag_prio_) <= cost_time) {
ADD_COMPACTION_INFO_PARAM(buf, buf_len, ADD_COMPACTION_INFO_PARAM(buf, buf_len,
"reason", get_suggestion_reason(ObCompactionSuggestionReason::DAG_COST_LONGTIME)); "reason", get_suggestion_reason(ObCompactionSuggestionReason::DAG_COST_LONGTIME));
if (TOO_MANY_FAILED_COUNT <= merge_info.retry_cnt_) { if (TOO_MANY_FAILED_COUNT <= merge_info.retry_cnt_) {

View File

@ -191,7 +191,7 @@ struct ObCompactionDagStatus final
// for mini/minor/major merge // for mini/minor/major merge
static constexpr int64_t COST_LONG_TIME[COMPACTION_PRIORITY_MAX] = { static constexpr int64_t COST_LONG_TIME[COMPACTION_PRIORITY_MAX] = {
10 * 60 * 1000 * 1000L, INT64_MAX, 20 * 60 * 1000 * 1000L, INT64_MAX, 60 * 60 * 1000 * 1000L}; // 10m,30m,60m 10 * 60 * 1000 * 1000L, INT64_MAX, 20 * 60 * 1000 * 1000L, INT64_MAX, 60 * 60 * 1000 * 1000L}; // 10m,30m,60m
static int64_t get_cost_long_time(const int64_t prio);
ObCompactionHistogramStat histogram_stat_[COMPACTION_DAG_MAX]; ObCompactionHistogramStat histogram_stat_[COMPACTION_DAG_MAX];
}; };

View File

@ -1100,7 +1100,7 @@ int ObMediumCompactionScheduleFunc::check_medium_checksum(
if (prev_item.is_key_valid()) { if (prev_item.is_key_valid()) {
if (curr_item.is_same_tablet(prev_item)) { // same tablet if (curr_item.is_same_tablet(prev_item)) { // same tablet
if (OB_TMP_FAIL(curr_item.verify_checksum(prev_item))) { if (OB_TMP_FAIL(curr_item.verify_checksum(prev_item))) {
LOG_DBA_ERROR(OB_CHECKSUM_ERROR, "msg", "checksum error in tablet replica checksum", KR(ret), LOG_DBA_ERROR(OB_CHECKSUM_ERROR, "msg", "checksum error in tablet replica checksum", KR(tmp_ret),
K(curr_item), K(prev_item)); K(curr_item), K(prev_item));
if (OB_SUCCESS == check_ret) { if (OB_SUCCESS == check_ret) {
if (OB_TMP_FAIL(error_pairs.push_back(ObTabletLSPair(curr_item.tablet_id_, curr_item.ls_id_)))) { if (OB_TMP_FAIL(error_pairs.push_back(ObTabletLSPair(curr_item.tablet_id_, curr_item.ls_id_)))) {

View File

@ -83,6 +83,7 @@ ObTenantCompactionProgress & ObTenantCompactionProgress::operator=(const ObTenan
sum_time_guard_ = other.sum_time_guard_; sum_time_guard_ = other.sum_time_guard_;
start_cg_idx_ = other.start_cg_idx_; start_cg_idx_ = other.start_cg_idx_;
end_cg_idx_ = other.end_cg_idx_; end_cg_idx_ = other.end_cg_idx_;
real_finish_cnt_ = other.real_finish_cnt_;
return *this; return *this;
} }
@ -381,6 +382,7 @@ int ObTenantCompactionProgressMgr::update_progress(
} else { } else {
array_[pos].unfinished_tablet_cnt_--; array_[pos].unfinished_tablet_cnt_--;
} }
array_[pos].real_finish_cnt_++;
} }
array_[pos].data_size_ += total_data_size_delta; array_[pos].data_size_ += total_data_size_delta;
@ -445,6 +447,7 @@ int ObTenantCompactionProgressMgr::update_unfinish_tablet(const int64_t major_sn
} }
} else { } else {
array_[pos].unfinished_tablet_cnt_--; array_[pos].unfinished_tablet_cnt_--;
array_[pos].real_finish_cnt_++;
} }
} }
return ret; return ret;

View File

@ -73,17 +73,19 @@ struct ObTenantCompactionProgress : public ObCompactionProgress
is_inited_(false), is_inited_(false),
total_tablet_cnt_(0), total_tablet_cnt_(0),
unfinished_tablet_cnt_(0), unfinished_tablet_cnt_(0),
real_finish_cnt_(0),
sum_time_guard_() sum_time_guard_()
{ {
} }
bool is_valid() const; bool is_valid() const;
ObTenantCompactionProgress & operator=(const ObTenantCompactionProgress &other); ObTenantCompactionProgress & operator=(const ObTenantCompactionProgress &other);
INHERIT_TO_STRING_KV("ObCompactionProgress", ObCompactionProgress, K_(is_inited), K_(total_tablet_cnt), INHERIT_TO_STRING_KV("ObCompactionProgress", ObCompactionProgress, K_(is_inited), K_(total_tablet_cnt),
K_(unfinished_tablet_cnt), K_(sum_time_guard)); K_(unfinished_tablet_cnt), K_(real_finish_cnt), K_(sum_time_guard));
bool is_inited_; bool is_inited_;
int64_t total_tablet_cnt_; int64_t total_tablet_cnt_;
int64_t unfinished_tablet_cnt_; int64_t unfinished_tablet_cnt_;
int64_t real_finish_cnt_;
ObStorageCompactionTimeGuard sum_time_guard_; ObStorageCompactionTimeGuard sum_time_guard_;
}; };