pingcap/tidb

support for FLUSH LOGS command

Open

#19,643 创建于 2020年9月1日

在 GitHub 查看
 (7 评论) (1 反应) (0 负责人)Go (6,186 fork)batch import
feature/acceptedhelp wantedtype/feature-request

仓库指标

Star
 (40,090 star)
PR 合并指标
 (平均合并 14天 4小时) (30 天内合并 346 个 PR)

描述

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)


MySQL [(none)]> system ls /home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log
ls: 无法访问/home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log: 没有那个文件或目录
MySQL [(none)]> select sleep(3);
+----------+
| sleep(3) |
+----------+
|        0 |
+----------+
1 row in set (3.00 sec)

MySQL [(none)]> system ls /home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log
/home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log
MySQL [(none)]> system rm /home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log
MySQL [(none)]> system ls /home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log
ls: 无法访问/home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log: 没有那个文件或目录
MySQL [(none)]> select sleep(3);
+----------+
| sleep(3) |
+----------+
|        0 |
+----------+
1 row in set (3.00 sec)

MySQL [(none)]> system ls /home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log
ls: 无法访问/home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log: 没有那个文件或目录

MySQL [(none)]> system touch /home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log
MySQL [(none)]> select sleep(3);
+----------+
| sleep(3) |
+----------+
|        0 |
+----------+
1 row in set (3.01 sec)

MySQL [(none)]> system cat /home/tidb/gangshen/dev/deploy/tidb-14010/log/tidb_slow_query.log
MySQL [(none)]>

TiDB will automatically create a slow log file if it finds no slow log file when it encounters a slow log for the first time after restarting. Later, if the slow log is manually deleted after the slow log is created, it will not be created actively even if the slow log appears, and it needs to be restarted.

2. What did you expect to see? (Required)

tidb-server will create tidb_slow_query.log if it not exists.

3. What did you see instead (Required)

tidb-server won't create tidb_slow_query.log after remove it

4. What is your TiDB version? (Required)


+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                     |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.5
Edition: Community
Git Commit Hash: 9c1c21270001a0084dcb5d842c50e1fbea5d1fa8
Git Branch: heads/refs/tags/v4.0.5
UTC Build Time: 2020-08-28 10:07:42
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

贡献者指南