print throttled size in debug log

This commit is contained in:
ZenoWang
2024-02-27 05:22:22 +00:00
committed by ob-robot
parent d1d1af5969
commit 9b36886e82
7 changed files with 25 additions and 11 deletions

View File

@ -190,7 +190,7 @@ ObMdsThrottleGuard::~ObMdsThrottleGuard()
MDS_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "throttle tool is unexpected nullptr", KP(throttle_tool_)); MDS_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "throttle tool is unexpected nullptr", KP(throttle_tool_));
} else if (throttle_tool_->is_throttling<ObTenantMdsAllocator>(share_ti_guard, module_ti_guard)) { } else if (throttle_tool_->is_throttling<ObTenantMdsAllocator>(share_ti_guard, module_ti_guard)) {
(void)TxShareMemThrottleUtil::do_throttle<ObTenantMdsAllocator>( (void)TxShareMemThrottleUtil::do_throttle<ObTenantMdsAllocator>(
for_replay_, abs_expire_time_, *throttle_tool_, share_ti_guard, module_ti_guard); for_replay_, abs_expire_time_, share::mds_throttled_alloc(), *throttle_tool_, share_ti_guard, module_ti_guard);
if (throttle_tool_->still_throttling<ObTenantMdsAllocator>(share_ti_guard, module_ti_guard)) { if (throttle_tool_->still_throttling<ObTenantMdsAllocator>(share_ti_guard, module_ti_guard)) {
(void)throttle_tool_->skip_throttle<ObTenantMdsAllocator>( (void)throttle_tool_->skip_throttle<ObTenantMdsAllocator>(

View File

@ -87,6 +87,7 @@ public:
template <typename ALLOCATOR> template <typename ALLOCATOR>
static int do_throttle(const bool for_replay, static int do_throttle(const bool for_replay,
const int64_t abs_expire_time, const int64_t abs_expire_time,
const int64_t throttle_memory_size,
TxShareThrottleTool &throttle_tool, TxShareThrottleTool &throttle_tool,
ObThrottleInfoGuard &share_ti_guard, ObThrottleInfoGuard &share_ti_guard,
ObThrottleInfoGuard &module_ti_guard) ObThrottleInfoGuard &module_ti_guard)
@ -142,7 +143,7 @@ public:
module_ti_guard, module_ti_guard,
has_printed_lbt); has_printed_lbt);
} }
PrintThrottleUtil::print_throttle_statistic(ret, ALLOCATOR::throttle_unit_name(), sleep_time); PrintThrottleUtil::print_throttle_statistic(ret, ALLOCATOR::throttle_unit_name(), sleep_time, throttle_memory_size);
if (for_replay && sleep_time > 0) { if (for_replay && sleep_time > 0) {
// avoid print replay_timeout // avoid print replay_timeout

View File

@ -126,8 +126,12 @@ ObTxDataThrottleGuard::~ObTxDataThrottleGuard()
if (OB_ISNULL(throttle_tool_)) { if (OB_ISNULL(throttle_tool_)) {
MDS_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "throttle tool is unexpected nullptr", KP(throttle_tool_)); MDS_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "throttle tool is unexpected nullptr", KP(throttle_tool_));
} else if (throttle_tool_->is_throttling<ObTenantTxDataAllocator>(share_ti_guard, module_ti_guard)) { } else if (throttle_tool_->is_throttling<ObTenantTxDataAllocator>(share_ti_guard, module_ti_guard)) {
(void)TxShareMemThrottleUtil::do_throttle<ObTenantTxDataAllocator>( (void)TxShareMemThrottleUtil::do_throttle<ObTenantTxDataAllocator>(for_replay_,
for_replay_, abs_expire_time_, *throttle_tool_, share_ti_guard, module_ti_guard); abs_expire_time_,
share::tx_data_throttled_alloc(),
*throttle_tool_,
share_ti_guard,
module_ti_guard);
if (throttle_tool_->still_throttling<ObTenantTxDataAllocator>(share_ti_guard, module_ti_guard)) { if (throttle_tool_->still_throttling<ObTenantTxDataAllocator>(share_ti_guard, module_ti_guard)) {
(void)throttle_tool_->skip_throttle<ObTenantTxDataAllocator>( (void)throttle_tool_->skip_throttle<ObTenantTxDataAllocator>(

View File

@ -152,7 +152,8 @@ void PrintThrottleUtil::pirnt_throttle_info(const int err_code,
void PrintThrottleUtil::print_throttle_statistic(const int err_code, void PrintThrottleUtil::print_throttle_statistic(const int err_code,
const char *throttle_unit_name, const char *throttle_unit_name,
const int64_t sleep_time) const int64_t sleep_time,
const int64_t throttle_memory_size)
{ {
int ret = err_code; int ret = err_code;
const int64_t THROTTLE_LOG_INTERVAL = 1L * 1000L * 1000L; /*one seconds*/ const int64_t THROTTLE_LOG_INTERVAL = 1L * 1000L * 1000L; /*one seconds*/
@ -162,7 +163,9 @@ void PrintThrottleUtil::print_throttle_statistic(const int err_code,
"Throttle Unit Name", "Throttle Unit Name",
throttle_unit_name, throttle_unit_name,
"Throttle Sleep Time(us)", "Throttle Sleep Time(us)",
sleep_time); sleep_time,
"Throttle Memory Size",
throttle_memory_size);
} }
} }

View File

@ -94,7 +94,8 @@ public:
static void print_throttle_statistic(const int err_code, static void print_throttle_statistic(const int err_code,
const char *throttle_unit_name, const char *throttle_unit_name,
const int64_t sleep_time); const int64_t sleep_time,
const int64_t throttle_memory_size = 0);
}; };
} // namespace share } // namespace share

View File

@ -174,7 +174,8 @@ void ObThrottleUnit<ALLOCATOR>::print_throttle_info_(const int64_t holding_size,
"Release Speed", release_speed, "Release Speed", release_speed,
"Total Resource Limit", resource_limit_, "Total Resource Limit", resource_limit_,
"Config Specify Limit", config_specify_resource_limit_, "Config Specify Limit", config_specify_resource_limit_,
"Throttle Trigger Threshold", throttle_trigger); "Throttle Trigger Threshold", throttle_trigger,
"Decay Factor", decay_factor_);
} }
} }

View File

@ -55,6 +55,7 @@ ObStorageTableGuard::~ObStorageTableGuard()
{ {
(void)throttle_if_needed_(); (void)throttle_if_needed_();
reset(); reset();
share::memstore_throttled_alloc() = 0;
} }
void ObStorageTableGuard::throttle_if_needed_() void ObStorageTableGuard::throttle_if_needed_()
@ -71,8 +72,12 @@ void ObStorageTableGuard::throttle_if_needed_()
// only do throttle on active memtable // only do throttle on active memtable
if (OB_NOT_NULL(memtable_) && memtable_->is_active_memtable()) { if (OB_NOT_NULL(memtable_) && memtable_->is_active_memtable()) {
reset(); reset();
(void)TxShareMemThrottleUtil::do_throttle<ObMemstoreAllocator>( (void)TxShareMemThrottleUtil::do_throttle<ObMemstoreAllocator>(for_replay_,
for_replay_, store_ctx_.timeout_, throttle_tool, share_ti_guard, module_ti_guard); store_ctx_.timeout_,
share::memstore_throttled_alloc(),
throttle_tool,
share_ti_guard,
module_ti_guard);
} }
// if throttle is skipped due to some reasons, advance clock by call skip_throttle() and clean throttle status // if throttle is skipped due to some reasons, advance clock by call skip_throttle() and clean throttle status
@ -190,7 +195,6 @@ void ObStorageTableGuard::reset()
memtable_->dec_write_ref(); memtable_->dec_write_ref();
memtable_ = NULL; memtable_ = NULL;
} }
share::memstore_throttled_alloc() = 0;
} }
void ObStorageTableGuard::double_check_inc_write_ref( void ObStorageTableGuard::double_check_inc_write_ref(