-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Change Request
This repository is ONLY used to solve problems related to DOCS-CN.
Please answer the following questions before submitting your issue. Thanks!
- Describe what you find is inappropriate or missing in the existing docs.
tidb_slow_log_rules(v9.0.0 引入)目前在文档中已经列出了“支持的筛选字段清单”(见 PR *: add slow log control variables (tidb_slow_log_rules,tidb_slow_log_max_per_sec) and hintWRITE_SLOW_LOG#21009),但缺少以下关键信息:- 数字类型字段的单位与取值范围(min~max):例如
Query_time的单位是秒(规则匹配使用Duration.Seconds()),而tidb_slow_log_threshold的单位是毫秒,这会导致示例Query_time: 500容易产生歧义。 - 规则语法约束说明:例如最多支持 10 条规则(以
;分隔),字段名大小写是否敏感(实际不敏感),DB:"a,b"这类包含逗号的字符串如何写等。 - 字段标识符的“明文标识符”全量说明:目前是分组列举,建议再给出一个可检索的全量表格(字段名/类型/单位/范围/含义)。
- 数字类型字段的单位与取值范围(min~max):例如
- Describe your suggestion or addition.
- 在
system-variables.md的tidb_slow_log_rules小节补充一个表格(建议放在变量介绍后、示例前),至少包含:- 字段名(identifier,注明大小写不敏感)
- 类型(bool/string/int/uint/float)
- 单位(秒、次数、bytes、ratio 等)
- 取值范围(min~max;若 TiDB 侧未强校验,也可先给出“建议范围/合法范围”说明)
- 语义说明(与慢日志字段的对应关系)
- 在
identify-slow-queries.md中对tidb_slow_log_rules的示例与解释补充单位说明,避免把Query_time(秒)与tidb_slow_log_threshold(毫秒)混淆。 - 增加“规则语法约束”小节(或注意事项):
- 最多 10 条规则(
;分隔) - 单条规则内条件以
,分隔 - SESSION 作用域不允许
Conn_ID - 字段名大小写不敏感
- 含逗号字符串的写法(引号)
- 最多 10 条规则(
(背景:PR #21009 已开始补充 tidb_slow_log_rules 的说明,但以上信息目前仍缺失。)
- Provide some reference materials (documents, websites, etc) if you could.
- PR *: add slow log control variables (
tidb_slow_log_rules,tidb_slow_log_max_per_sec) and hintWRITE_SLOW_LOG#21009:https://github.com/pingcap/docs-cn/pull/21009 - TiDB 代码中规则字段与匹配实现(用于核对字段名/单位/类型):
https://github.com/pingcap/tidb/blob/master/pkg/sessionctx/variable/slow_log.go
tidb_slow_log_threshold默认值/单位为毫秒(用于避免单位误解):https://github.com/pingcap/tidb/blob/master/pkg/util/logutil/log.go
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels