Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tiflash 执行sql报region is unavilable
【TiDB Usage Environment】Production Environment or Test Environment or POC
【TiDB Version】
v4.0.8
【Problem Encountered】
Executing certain aggregate queries in SQL results in “region is unavailable.” After checking the SQL execution plan, it shows that the queries are “sum group by” and are automatically assigned to TiFlash for execution.
【Reproduction Path】What operations were performed to encounter the problem
【Problem Phenomenon and Impact】
Executing a certain aggregate calculation SQL, mainly “sum group by,” with a data volume of about 3 million, reports “region is unavailable.”
At the same time, the TiFlash error logs contain the following error messages:
2.09.11 22:08:38.041389 [329026351] CoprocessorHandler: grpc::Status DB::CoprocessorHandler::execute(): RegionException: region 1683245, message: NOT_FOUND: (while creating InputStreams from storage db_48
.t_1858
, table_id: 1858)
2022.09.11 22:08:42.969253 [329021362] DAGQueryBlockInterpreter: Check after read from Storage, region 1683240, version 1560, handle range [2799039587, 2799056972), status VERSION_ERROR
2022.09.11 22:08:42.974485 [329021362] DAGQueryBlockInterpreter: RegionException after read from storage, regions [1683240,], message: VERSION_ERROR, retry to read from local
2022.09.11 22:08:43.182245 [329021421] DAGQueryBlockInterpreter: Check after read from Storage, region 1683240, version 1560, handle range [2799039587, 2799056972), status VERSION_ERROR
2022.09.11 22:08:43.206093 [329021421] DAGQueryBlockInterpreter: RegionException after read from storage, regions [1683240,], message: VERSION_ERROR, retry to read from local
2022.09.11 22:08:46.022185 [329033088] DAGQueryBlockInterpreter: Check after read from Storage, region 1683240, version 1560, handle range [2799039587, 2799056972), status VERSION_ERROR
2022.09.11 22:08:46.022305 [329021933] DAGQueryBlockInterpreter: Check after read from Storage, region 1683240, version 1560, handle range [2799039587, 2799056972), status VERSION_ERROR
2022.09.11 22:08:46.040664 [329033088] DAGQueryBlockInterpreter: RegionException after read from storage, regions [1683240,], message: VERSION_ERROR, retry to read from local
2022.09.11 22:08:46.053768 [329021933] DAGQueryBlockInterpreter: RegionException after read from storage, regions [1683240,], message: VERSION_ERROR, retry to read from local
2022.09.11 22:09:02.994684 [329037158] pingcap.tikv: Failed4: Deadline Exceeded
2022.09.11 22:09:03.233701 [329037232] pingcap.tikv: Failed4: Deadline Exceeded
【Attachments】Related logs and monitoring (https://metricstool.pingcap.com/)
For questions related to performance optimization and fault troubleshooting, please download the script and run it. Please select all and copy-paste the terminal output results and upload them.