Repository: tikv/tikv (language: rust)

Issue:
coprocessor in some case doesn't print slow log
## Question

Version: v6.5.7

https://github.com/tikv/tikv/blob/31a21609bc35849183ff0d0946e181ebae0c9c73/src/coprocessor/tracker.rs#L275

In some cases, cop's `total_process_time` maybe small but cop's `total_suspend_time` is high, and this cop will have slow log in TiDB:

https://github.com/tikv/tikv/blob/6fb3637fb18b03c93e8d582fec1cde090044d628/src/coprocessor/tracker.rs#L195

```log
[2024/12/27 09:27:17.834 +08:00] [Info] [coprocessor.go:1128] ["[TIME_COP_PROCESS] resp_time:6.550246359s txnStartTS:454888739640705720 region_id:40144512 store_addr:30.88.1.72:6501 kv_process_ms:6469 kv_wait_ms:76 kv_read_ms:6469 processed_versions:15 total_versions:30 rocksdb_delete_skipped_count:0 rocksdb_key_skipped_count:15 rocksdb_cache_hit_count:180 rocksdb_read_count:0 rocksdb_read_byte:0"] [conn=4188376240775702521] 
```

But the cop doesn't have a slow-log in TiKV, it is unexpected.


Discussion / hints:

Fix patch:
diff --git a/src/coprocessor/tracker.rs b/src/coprocessor/tracker.rs
index 197c35ab238..196791fe20b 100644
--- a/src/coprocessor/tracker.rs
+++ b/src/coprocessor/tracker.rs
@@ -272,7 +272,7 @@ impl<E: Engine> Tracker<E> {
 
         let total_storage_stats = std::mem::take(&mut self.total_storage_stats);
 
-        if self.total_process_time > self.slow_log_threshold {
+        if (self.total_process_time + self.total_suspend_time) > self.slow_log_threshold {
             let first_range = self.req_ctx.ranges.first();
             let some_table_id = first_range.as_ref().map(|range| {
                 tidb_query_datatype::codec::table::decode_table_id(range.get_start())


Test patch: