查询偶发性的出现region is unavailable

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:v4.0.6
  • 【问题描述】:StatementCallback; uncategorized SQLException for SQL [select sum(bizcard_present_count_int) as bizCardPresentCount,count(*) as bizCardCount,sum(bizcard_cash_amount) as bizCardCash,sum(bizcard_click_count_int) as bizCardClickCount,ifnull(account_name, ‘未知’) as account_id,ifnull(account_name, ‘未知’) as account from f_mid_business_card where create_time between ‘2020-07-24 00:00:00’ and ‘2020-09-21 23:59:59’ and delete_flag <> 1 group by account_id,account order by account_id asc]; SQL state [HY000]; error code [9005]; Region is unavailable; nested exception is java.sql.SQLException: Region is unavailable
    image

    若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

你好,region is unavaliable 是 tidb 中比较常见的报错,报错的原因可以参考下面的文档:
https://docs.pingcap.com/zh/tidb/stable/tidb-troubleshooting-map#11-客户端报-region-is-unavailable-错误

您好,现在频繁出现region is unavaliable,查看tiflash的log并没有发现什么异常。
这个查询经过where条件之后,数据量其实不大。
有没有什么参数,可以避免掉报region is unavaliable这个错误,业务投诉很伤啊:cry:

请按照文档排查,看看问题发生时,是哪种情况,单独看这条sql不一定有问题。出问题时可能集群整体负载较高。
https://docs.pingcap.com/zh/tidb/stable/tidb-troubleshooting-map

怎么调大backoff呀?我想调大这个试试。tiflash服务器的硬盘IO基本都是100%

  1. https://docs.pingcap.com/zh/tidb/stable/system-variables#tidb_backoff_weight 想调大这个参数?