The TiDB kill thread is not working

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb kill线程没有用

| username: Jjjjayson_zeng

[TiDB Usage Environment] Production Environment
[TiDB Version] v6.5.1
[Reproduction Path] Unable to kill thread
[Encountered Problem: Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]

| username: 像风一样的男子 | Original post link

You can execute this statistical analysis during the database idle time:
SET GLOBAL tidb_auto_analyze_start_time=‘22:00 +0800’;
SET GLOBAL tidb_auto_analyze_end_time=‘08:00 +0800’;

| username: Jjjjayson_zeng | Original post link

Now I want to kill a thread, how do I kill it? Will this cause the database to hang?

| username: tidb狂热爱好者 | Original post link

You can schedule this statistical analysis to run during the database’s idle time
SET GLOBAL tidb_auto_analyze_start_time=‘23:00 +0800’;
SET GLOBAL tidb_auto_analyze_end_time=‘00:00 +0800’;
This way, the service will not run the analysis service now.

| username: tidb菜鸟一只 | Original post link

If there are multiple TiDB nodes, you can just restart the corresponding TiDB node.

| username: wakaka | Original post link

How about trying to execute a kill command on the corresponding TiDB node?

| username: xingzhenxiang | Original post link

set global tidb_auto_analyze_end_time =‘01:00 +0000’; Takes effect immediately.
set global tidb_max_auto_analyze_time =18600; Takes effect immediately, and any tasks that exceed this time limit started before this setting will also be killed.

| username: Jjjjayson_zeng | Original post link

You can’t just restart it either, it’s a production environment.

| username: Hacker007 | Original post link

No need to restart, just set the statistics analysis time. By default, it runs all day, but you can set it to run during idle times. Note that this statement is used to optimize the database.

| username: redgame | Original post link

Just go to that node and kill it.

| username: Anna | Original post link

Restart the TiDB node.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.