From e1d2a90568378bc3007e6463734d2999c319ef58 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Wed, 10 May 2023 15:04:08 +0800 Subject: [PATCH] update description about compatible-kill-query configuration (#13491) (#13514) --- tidb-configuration-file.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 80c61eb12c6d4..39b5654401bd2 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -78,8 +78,12 @@ The TiDB configuration file supports more options than command-line parameters. + Determines whether to set the `KILL` statement to be MySQL compatible. + Default value: `false` -+ The behavior of `KILL xxx` in TiDB differs from the behavior in MySQL. TiDB requires the `TIDB` keyword, namely, `KILL TIDB xxx`. If `compatible-kill-query` is set to `true`, the `TIDB` keyword is not needed. -+ This distinction is important because the default behavior of the MySQL command-line client, when the user hits Ctrl+C, is to create a new connection to the backend and execute the `KILL` statement in that new connection. If a load balancer or proxy has sent the new connection to a different TiDB server instance than the original session, the wrong session could be terminated, which could cause interruption to applications using the cluster. Enable `compatible-kill-query` only if you are certain that the connection you refer to in your `KILL` statement is on the same server to which you send the `KILL` statement. ++ `compatible-kill-query` takes effect only when [`enable-global-kill`](#enable-global-kill-new-in-v610) is set to `false`. ++ When [`enable-global-kill`](#enable-global-kill-new-in-v610) is `false`, `compatible-kill-query` controls whether you need to append the `TIDB` keyword when killing a query. + - When `compatible-kill-query` is `false`, the behavior of `KILL xxx` in TiDB is different from that in MySQL. To kill a query in TiDB, you need to append the `TIDB` keyword, such as `KILL TIDB xxx`. + - When `compatible-kill-query` is `true`, to kill a query in TiDB, there is no need to append the `TIDB` keyword. It is **STRONGLY NOT RECOMMENDED** to set `compatible-kill-query` to `true` in your configuration file UNLESS you are certain that clients will be always connected to the same TiDB instance. This is because pressing Control+C in the default MySQL client opens a new connection in which `KILL` is executed. If there is a proxy between the client and the TiDB cluster, the new connection might be routed to a different TiDB instance, which possibly kills a different session by mistake. ++ When [`enable-global-kill`](#enable-global-kill-new-in-v610) is `true`, `KILL xxx` and `KILL TIDB xxx` have the same effect, but using Control+C to kill a query is not supported. ++ For more information about the `KILL` statement, see [KILL [TIDB]](/sql-statements/sql-statement-kill.md). ### `check-mb4-value-in-utf8`