From 949705a060e2bc187abf8258af4c1ac817678e97 Mon Sep 17 00:00:00 2001 From: ZenoWang Date: Thu, 8 Feb 2024 04:42:09 +0000 Subject: [PATCH] Add lbt info when throttle more than one mintue --- .../ob_share_resource_throttle_tool.ipp | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/share/throttle/ob_share_resource_throttle_tool.ipp b/src/share/throttle/ob_share_resource_throttle_tool.ipp index 170a56d38..f27d3e6f0 100644 --- a/src/share/throttle/ob_share_resource_throttle_tool.ipp +++ b/src/share/throttle/ob_share_resource_throttle_tool.ipp @@ -187,16 +187,26 @@ int64_t ObShareResourceThrottleTool::expected_wait_time( return expected_wait_time; } -#define PRINT_THROTTLE_WARN \ - do { \ - const int64_t WARN_LOG_INTERVAL = 60L * 1000L * 1000L /* one minute */; \ - if (sleep_time > (WARN_LOG_INTERVAL) && TC_REACH_TIME_INTERVAL(WARN_LOG_INTERVAL)) { \ - SHARE_LOG(WARN, \ - "[Throttling] Attention!! Sleep More Than One Minute!!", \ - K(sleep_time), \ - K(left_interval), \ - K(expected_wait_t)); \ - } \ +#define PRINT_THROTTLE_WARN \ + do { \ + const int64_t WARN_LOG_INTERVAL = 1LL * 60L * 1000L * 1000L /* one minute */; \ + if (sleep_time > (WARN_LOG_INTERVAL) && TC_REACH_TIME_INTERVAL(WARN_LOG_INTERVAL)) { \ + SHARE_LOG(WARN, \ + "[Throttling] Attention!! Sleep More Than One Minute!!", \ + "Throttle Unit Name", \ + ALLOCATOR::throttle_unit_name(), \ + K(sleep_time), \ + K(left_interval), \ + K(expected_wait_t)); \ + if (!has_printed_lbt) { \ + has_printed_lbt = true; \ + SHARE_LOG(WARN, \ + "[Throttling] (report write throttle info) LBT Info", \ + "Throttle Unit Name", \ + ALLOCATOR::throttle_unit_name(), \ + K(lbt())); \ + } \ + } \ } while (0) #define PRINT_THROTTLE_STATISTIC \ @@ -226,6 +236,7 @@ void ObShareResourceThrottleTool::do_throttle(const int6 // exit directly } else if (is_throttling(share_ti_guard, module_ti_guard)) { // loop to do throttle + bool has_printed_lbt = false; while (still_throttling(share_ti_guard, module_ti_guard) && left_interval > 0) { int64_t expected_wait_t = min(left_interval, expected_wait_time(share_ti_guard, module_ti_guard)); if (expected_wait_t < 0) {