fix compaction progress timeguard & ignore ls_inner_tablet
This commit is contained in:
@ -282,7 +282,7 @@ public:
|
|||||||
if (OB_LIKELY(idx_ < CAPACITY)) {
|
if (OB_LIKELY(idx_ < CAPACITY)) {
|
||||||
int64_t now = common::ObTimeUtility::current_time();
|
int64_t now = common::ObTimeUtility::current_time();
|
||||||
line_array_[idx_] = static_cast<uint16_t>(line);
|
line_array_[idx_] = static_cast<uint16_t>(line);
|
||||||
click_poinsts_[idx_] = static_cast<uint32_t>(now - last_click_ts_);
|
click_poinsts_[idx_] = now - last_click_ts_;
|
||||||
last_click_ts_ = now;
|
last_click_ts_ = now;
|
||||||
++idx_;
|
++idx_;
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ protected:
|
|||||||
const char * const func_name_;
|
const char * const func_name_;
|
||||||
const char * const log_mod_;
|
const char * const log_mod_;
|
||||||
uint16_t line_array_[CAPACITY];
|
uint16_t line_array_[CAPACITY];
|
||||||
uint32_t click_poinsts_[CAPACITY];
|
uint64_t click_poinsts_[CAPACITY];
|
||||||
};
|
};
|
||||||
|
|
||||||
class ObOccamFastTimeGuard// must used in same thread
|
class ObOccamFastTimeGuard// must used in same thread
|
||||||
|
|||||||
@ -1158,8 +1158,9 @@ int ObCompactionDiagnoseMgr::diagnose_tablet_medium_merge(
|
|||||||
ObTabletMemberWrapper<ObTabletTableStore> table_store_wrapper;
|
ObTabletMemberWrapper<ObTabletTableStore> table_store_wrapper;
|
||||||
ObArenaAllocator allocator;
|
ObArenaAllocator allocator;
|
||||||
const compaction::ObMediumCompactionInfoList *medium_list = nullptr;
|
const compaction::ObMediumCompactionInfoList *medium_list = nullptr;
|
||||||
|
if (tablet_id.is_ls_inner_tablet()) {
|
||||||
if (OB_FAIL(tablet.fetch_table_store(table_store_wrapper))) {
|
// do nothing
|
||||||
|
} else if (OB_FAIL(tablet.fetch_table_store(table_store_wrapper))) {
|
||||||
LOG_WARN("fail to fetch table store", K(ret));
|
LOG_WARN("fail to fetch table store", K(ret));
|
||||||
} else if (OB_ISNULL(last_major_sstable =
|
} else if (OB_ISNULL(last_major_sstable =
|
||||||
table_store_wrapper.get_member()->get_major_sstables().get_boundary_table(true/*last*/))) {
|
table_store_wrapper.get_member()->get_major_sstables().get_boundary_table(true/*last*/))) {
|
||||||
@ -1212,7 +1213,9 @@ int ObCompactionDiagnoseMgr::diagnose_tablet_major_merge(
|
|||||||
const ObMergeType merge_type = MEDIUM_MERGE;
|
const ObMergeType merge_type = MEDIUM_MERGE;
|
||||||
int64_t max_sync_medium_scn = 0;
|
int64_t max_sync_medium_scn = 0;
|
||||||
ObTabletMemberWrapper<ObTabletTableStore> table_store_wrapper;
|
ObTabletMemberWrapper<ObTabletTableStore> table_store_wrapper;
|
||||||
if (OB_UNLIKELY(compaction_scn <= 0)) {
|
if (tablet_id.is_ls_inner_tablet()) {
|
||||||
|
// do nothing
|
||||||
|
} else if (OB_UNLIKELY(compaction_scn <= 0)) {
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("invalid argument", K(ret), K(compaction_scn));
|
LOG_WARN("invalid argument", K(ret), K(compaction_scn));
|
||||||
} else if (tablet.get_tablet_meta().has_transfer_table()) {
|
} else if (tablet.get_tablet_meta().has_transfer_table()) {
|
||||||
|
|||||||
@ -437,7 +437,7 @@ int64_t ObCompactionTimeGuard::to_string(char *buf, const int64_t buf_len) const
|
|||||||
if (total_cost > COMPACTION_SHOW_TIME_THRESHOLD) {
|
if (total_cost > COMPACTION_SHOW_TIME_THRESHOLD) {
|
||||||
float ratio = 0;
|
float ratio = 0;
|
||||||
for (int64_t idx = COMPACTION_POLICY; idx < idx_; ++idx) {
|
for (int64_t idx = COMPACTION_POLICY; idx < idx_; ++idx) {
|
||||||
const uint32_t time_interval = click_poinsts_[idx];
|
const uint64_t time_interval = click_poinsts_[idx];
|
||||||
ratio = (float)(time_interval)/ total_cost;
|
ratio = (float)(time_interval)/ total_cost;
|
||||||
if (ratio >= COMPACTION_SHOW_PERCENT_THRESHOLD || time_interval >= COMPACTION_SHOW_TIME_THRESHOLD) {
|
if (ratio >= COMPACTION_SHOW_PERCENT_THRESHOLD || time_interval >= COMPACTION_SHOW_TIME_THRESHOLD) {
|
||||||
fmt_ts_to_meaningful_str(buf, buf_len, pos, get_comp_event_str((ObTabletCompactionEvent)line_array_[idx]), click_poinsts_[idx]);
|
fmt_ts_to_meaningful_str(buf, buf_len, pos, get_comp_event_str((ObTabletCompactionEvent)line_array_[idx]), click_poinsts_[idx]);
|
||||||
@ -1267,7 +1267,7 @@ void ObTabletMergeCtx::collect_running_info()
|
|||||||
|
|
||||||
const int64_t dag_key = merge_dag_->hash();
|
const int64_t dag_key = merge_dag_->hash();
|
||||||
// calc flush macro speed
|
// calc flush macro speed
|
||||||
uint32_t exe_ts = time_guard_.get_specified_cost_time(ObCompactionTimeGuard::EXECUTE);
|
uint64_t exe_ts = time_guard_.get_specified_cost_time(ObCompactionTimeGuard::EXECUTE);
|
||||||
if (exe_ts > 0 && sstable_merge_info.new_flush_occupy_size_ > 0) {
|
if (exe_ts > 0 && sstable_merge_info.new_flush_occupy_size_ > 0) {
|
||||||
sstable_merge_info.new_flush_data_rate_ = (int)(((float)sstable_merge_info.new_flush_occupy_size_/ 1024) / ((float)exe_ts / 1_s));
|
sstable_merge_info.new_flush_data_rate_ = (int)(((float)sstable_merge_info.new_flush_occupy_size_/ 1024) / ((float)exe_ts / 1_s));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,8 +130,8 @@ public:
|
|||||||
void add_time_guard(const ObCompactionTimeGuard &other);
|
void add_time_guard(const ObCompactionTimeGuard &other);
|
||||||
ObCompactionTimeGuard & operator=(const ObCompactionTimeGuard &other);
|
ObCompactionTimeGuard & operator=(const ObCompactionTimeGuard &other);
|
||||||
OB_INLINE bool is_empty() const { return 0 == idx_; }
|
OB_INLINE bool is_empty() const { return 0 == idx_; }
|
||||||
OB_INLINE uint32_t get_specified_cost_time(const int64_t line) {
|
OB_INLINE uint64_t get_specified_cost_time(const int64_t line) {
|
||||||
uint32_t ret_val = 0;
|
uint64_t ret_val = 0;
|
||||||
for (int64_t idx = 0; idx < idx_; ++idx) {
|
for (int64_t idx = 0; idx < idx_; ++idx) {
|
||||||
if (line_array_[idx] == line) {
|
if (line_array_[idx] == line) {
|
||||||
ret_val = click_poinsts_[idx];
|
ret_val = click_poinsts_[idx];
|
||||||
|
|||||||
Reference in New Issue
Block a user