-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add Lock View related documents #6408
Conversation
| [`CLUSTER_HARDWARE`](/information-schema/information-schema-cluster-info.md) | 提供在每个 TiDB 组件上发现的底层物理硬件的详细信息。 | | ||
| [`CLUSTER_INFO`](/information-schema/information-schema-cluster-info.md) | 提供当前集群拓扑的详细信息。 | | ||
| [`CLUSTER_LOAD`](/information-schema/information-schema-cluster-load.md) | 提供集群中 TiDB 服务器的当前负载信息。 | | ||
| [`CLUSTER_LOG`](/information-schema/information-schema-cluster-log.md) | 提供整个 TiDB 集群的日志。 | | ||
| `CLUSTER_PROCESSLIST` | 提供 `PROCESSLIST` 表的集群级别的视图。 | | ||
| `CLUSTER_SLOW_QUERY` | 提供 `SLOW_QUERY` 表的集群级别的视图。 | | ||
| `CLUSTER_STATEMENTS_SUMMARY` | 提供 `STATEMENTS_SUMMARY` 表的集群级别的视图。 | | ||
| `CLUSTER_STATEMENTS_SUMMARY_HISTORY` | 提供 `CLUSTER_STATEMENTS_SUMMARY_HISTORY` 表的集群级别的视图。 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a mistake so I changed it 🤔
@longfangsong: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
@youjiali1995 PTAL. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需不需要介绍一下这几张表能做什么、解决什么问题之类的?有些问题还需要这几张表一起用才能解决。
|
||
`DATA_LOCK_WAITS` 表的各列的含义如下: | ||
|
||
* `KEY`:正在发生等锁的 KEY,以十六进制编码的形式显示。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tidb 现在有办法能解析这种 key 是哪个表哪一行或者索引吗?没有的话下个 sprint 要优化一下体验,可能用户知道了 sql 也没用,还要知道是哪一行才行。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个后续迭代可以考虑再加个字段展示把 key 解出来的信息。目前可能得借助些其它的工具才能解。我等会看下 tidb-ctl 顶用不顶用,能用的话晚点我把它补充进文档里。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tidb-ctl 好像不行...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll continue adding contents tomorrow |
Co-authored-by: Lei Zhao <zlwgx1023@gmail.com>
@youjiali1995: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
3. 事务 B 执行第二条语句试图对 `id = 1` 的行上锁,被事务 A 阻塞 | ||
4. 事务 A 试图对 `id = 2` 的行上锁,被 B 阻塞,形成死锁 | ||
|
||
对于这种情况,由于事务 A 阻塞其它事务的语句也是当前正在执行的语句,因而可以解除当前语句所上的悲观锁(使得事务 B 可以继续运行),并重试当前语句。TiDB 内部使用 key 的 hash 来判断是否属于这种情况。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“这种情况”是指情况二吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/remove-status LGT1 |
Co-authored-by: Grace Cai <qqzczy@126.com>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 5560738
|
2 rows in set (0.01 sec) | ||
``` | ||
|
||
以上查询结果显示,ID 为 `425405024158875649` 的事务在执行 Digest 为 `"f7530877a35ae65300c42250abd8bc731bbaf0a7cabc05dab843565230611bb22"` 的语句的过程中,试图在 `"7480000000000000355f728000000000000002"` 这个 key 上获取悲观锁,但是该 key 目前被 ID 为 `425405016242126849` 的事务持有。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> | ||
> 目前,`DEADLOCKS` 表暂不支持收集可重试的死锁错误相关的信息。 | ||
|
||
当事务 A 被另一个事务已经持有的锁阻塞,而事务 B 直接或间接地被当前事务持有的锁阻塞,将会引发一个死锁错误。这里: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All followup comments are addressed in https://github.com/pingcap/docs-cn/pull/6577/files. |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?