From 89ffabe447ad396f908beb441ffcff9e370e0128 Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 1 Jun 2023 11:16:30 +0800 Subject: [PATCH 1/4] Add temp.md --- temp.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 temp.md diff --git a/temp.md b/temp.md new file mode 100644 index 0000000000000..af27ff4986a7b --- /dev/null +++ b/temp.md @@ -0,0 +1 @@ +This is a test file. \ No newline at end of file From 003c1a2552ccefef60db5818c323f7201224ea2f Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 1 Jun 2023 11:16:35 +0800 Subject: [PATCH 2/4] Delete temp.md --- temp.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 temp.md diff --git a/temp.md b/temp.md deleted file mode 100644 index af27ff4986a7b..0000000000000 --- a/temp.md +++ /dev/null @@ -1 +0,0 @@ -This is a test file. \ No newline at end of file From 2f056334c52e16b4deb1adc901705d5685ffc6de Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 1 Jun 2023 11:54:58 +0800 Subject: [PATCH 3/4] add a known issue of mpp Signed-off-by: Ran --- tiflash/use-tiflash-mpp-mode.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tiflash/use-tiflash-mpp-mode.md b/tiflash/use-tiflash-mpp-mode.md index d991da03e4f8f..170c3cfbbbf3f 100644 --- a/tiflash/use-tiflash-mpp-mode.md +++ b/tiflash/use-tiflash-mpp-mode.md @@ -175,3 +175,18 @@ mysql> explain SELECT count(*) FROM test.employees; +------------------------------+----------+--------------+-----------------+---------------------------------------------------------+ 5 rows in set (0,00 sec) ``` + +## Known Issues of MPP + +In the current version, TiFlash uses the `start_ts` of a query as the unique key of the query. In most cases, the `start_ts` of each query can uniquely identify a query, but in the following cases, different queries have the same `start_ts`: + +- All queries in the same transaction have the same `start_ts`. +- When you use [`tidb_snapshot`](/system-variables.md#tidb_snapshot) to specify reading data at a specific historical time point, the same time point is manually specified. +- When [Stale Read](/stale-read.md) is enabled, the same time point is manually specified. + +When `start_ts` cannot uniquely represent the MPP query, if TiFlash detects that different queries have the same `start_ts` at a given time, TiFlash might report an error. Typical error cases are as follows: + +- When multiple queries with the same `start_ts` are sent to TiFlash at the same time, you might encounter the error `task has been registered`. +- When multiple simple queries with `LIMIT` are executed continuously in the same transaction, after the `LIMIT` condition is met, TiDB sends a cancel request to TiFlash to cancel the query. This request also uses `start_ts` to identify the query to be canceled. If there are other queries with the same `start_ts` in TiFlash, other queries might be canceled by mistake. For example, the problem occurred in [this issue](https://github.com/pingcap/tidb/issues/43426). + +This issue is fixed in TiDB v6.6.0. It is recommended to use the [latest LTS version](https://docs.pingcap.com/tidb/stable). From 022dd08d980b940b6280edc975244fc77281b495 Mon Sep 17 00:00:00 2001 From: Ran Date: Fri, 9 Jun 2023 09:33:25 +0800 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Grace Cai --- tiflash/use-tiflash-mpp-mode.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tiflash/use-tiflash-mpp-mode.md b/tiflash/use-tiflash-mpp-mode.md index 170c3cfbbbf3f..ee11423ed79e2 100644 --- a/tiflash/use-tiflash-mpp-mode.md +++ b/tiflash/use-tiflash-mpp-mode.md @@ -176,17 +176,17 @@ mysql> explain SELECT count(*) FROM test.employees; 5 rows in set (0,00 sec) ``` -## Known Issues of MPP +## Known issues of MPP In the current version, TiFlash uses the `start_ts` of a query as the unique key of the query. In most cases, the `start_ts` of each query can uniquely identify a query, but in the following cases, different queries have the same `start_ts`: - All queries in the same transaction have the same `start_ts`. -- When you use [`tidb_snapshot`](/system-variables.md#tidb_snapshot) to specify reading data at a specific historical time point, the same time point is manually specified. +- When you use [`tidb_snapshot`](/system-variables.md#tidb_snapshot) to read data at a specific historical time point, the same time point is manually specified. - When [Stale Read](/stale-read.md) is enabled, the same time point is manually specified. When `start_ts` cannot uniquely represent the MPP query, if TiFlash detects that different queries have the same `start_ts` at a given time, TiFlash might report an error. Typical error cases are as follows: -- When multiple queries with the same `start_ts` are sent to TiFlash at the same time, you might encounter the error `task has been registered`. -- When multiple simple queries with `LIMIT` are executed continuously in the same transaction, after the `LIMIT` condition is met, TiDB sends a cancel request to TiFlash to cancel the query. This request also uses `start_ts` to identify the query to be canceled. If there are other queries with the same `start_ts` in TiFlash, other queries might be canceled by mistake. For example, the problem occurred in [this issue](https://github.com/pingcap/tidb/issues/43426). +- When multiple queries with the same `start_ts` are sent to TiFlash at the same time, you might encounter the `task has been registered` error. +- When multiple simple queries with `LIMIT` are executed continuously in the same transaction, once the `LIMIT` condition is met, TiDB sends a cancel request to TiFlash to cancel the query. This request also uses `start_ts` to identify the query to be canceled. If there are other queries with the same `start_ts` in TiFlash, these queries might be canceled by mistake. An example of this issue can be found in [#43426](https://github.com/pingcap/tidb/issues/43426). This issue is fixed in TiDB v6.6.0. It is recommended to use the [latest LTS version](https://docs.pingcap.com/tidb/stable).