Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe auto_id_cache = 0 behavior and add link how to address TiKV_pending_task alert #13892

Merged
merged 3 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion alert-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ aliases: ['/docs-cn/dev/alert-rules/','/docs-cn/dev/reference/alert-rules/']

* 处理方法:

查看是哪一类任务的值偏高,通常 Coprocessor、apply worker 这类任务都可以在其他指标里找到解决办法
观察 [**TiKV-Details** > **Task** 面板](/grafana-tikv-dashboard.md#task),查看是哪一类任务的 `Worker pending tasks` 值偏高。如果是 Coprocessor 任务,可以参考 [`TiKV_coprocessor_request_wait_seconds`](#tikv_coprocessor_request_wait_seconds) 的处理方法
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved

#### `TiKV_low_space`

Expand Down
1 change: 1 addition & 0 deletions auto-increment.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ CREATE TABLE t(a int AUTO_INCREMENT key) AUTO_ID_CACHE 1;
>
> - 对于 TiDB v6.4.0 之前的版本,由于每次分配 ID 都需要通过一个 TiKV 事务完成 `AUTO_INCREMENT` 值的持久化修改,因此设置 `AUTO_ID_CACHE` 为 `1` 会出现性能下降。
> - 对于 v6.4.0 及以上版本,由于引入了中心化的分配服务,`AUTO_INCREMENT` 值的修改只是在 TiDB 服务进程中的一个内存操作,相较于之前版本更快。
> - 将 `AUTO_ID_CACHE` 设置为 `1` 表示 TiDB 使用默认的缓存大小 `30000`。
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved

使用 MySQL 兼容模式后,能保证 ID **唯一**、**单调递增**,行为几乎跟 MySQL 完全一致。即使跨 TiDB 实例访问,ID 也不会出现回退。只有当中心化服务的“主” TiDB 实例异常崩溃时,才有可能造成少量 ID 不连续。这是因为主备切换时,“备” 节点需要丢弃一部分之前的“主” 节点可能已经分配的 ID,以保证 ID 不出现重复。

Expand Down