-
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
txn: update the document about read-consistency read check ts variable #8617
Conversation
[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. |
@cfzjywxk Could you please invite a technical review? Thanks~ |
system-variables.md
Outdated
- 悲观事务中当 `READ-COMMITTED` 隔离级别启用之后,每个事务中 `SELECT` 语句会尝试获取一个新的 `timestamp` 用于数据读取。当开启此变量之后,`SELECT` 语句会尝试使用前一个有效的 `timestamp` 进行数据读取,初始值为事务的 `start_ts`。如果整个读取过程没有遇到更新版本,则返回结果给客户端且 `SELECT` 语句执行成功。当读到过程遇到更新的版本时,如果当前 `TiDB` 尚未向客户端回复数据,则尝试重新获取一个新的 `timestamp` 重试此语句。如果已经回复过客户端数据,则 `TiDB` 会向客户端报错。回复客户端数据量受 `tidb_init_chunk_size` 和 `tidb_max_chunk_size` 控制。在使用 `READ-COMMITTED` 隔离级别且单个事务中 `SELECT` 语句较多,读写冲突较少的场景,可通过开启此变量用以避免获取全局 `timestamp` 带来的延迟和开销。 | ||
|
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 suggest you only mention that it's an optimization for RC transactions that's suitable for read-heavy workloads, and put these implementation details in a supplementary information block (so that users don't have to understand it). Like this:
> **说明:**
>
> * 在这里解释取 ts 之类的内部原理
I think a user may not understand what it means by retrieving a timestamp or finding a newer version. It's too complex for user.
system-variables.md
Outdated
- 适用于悲观事务 `READ-COMMITTED` 隔离级别下,读写冲突较少场景,优化事务内读语句延迟。如果读写冲突较为严重,开启此功能会增加额外开销和延迟,造成性能回退。 | ||
|
||
> **说明:** | ||
> 悲观事务中当 `READ-COMMITTED` 隔离级别启用之后,每个事务中 `SELECT` 语句会尝试获取一个新的 timestamp 用于数据读取。当开启此变量之后,`SELECT` 语句会尝试使用前一个有效的 timestamp 进行数据读取,初始值为事务的 `start_ts`。如果整个读取过程没有遇到更新版本,则返回结果给客户端且 `SELECT` 语句执行成功。当读的过程中遇到更新的版本时,如果当前 TiDB 尚未向客户端回复数据,则尝试重新获取一个新的 timestamp 重试此语句。如果已经向客户端返回部分数据,则 TiDB 会向客户端报错。每次向客户端回复的数据量受 `tidb_init_chunk_size` 和 `tidb_max_chunk_size` 控制。在使用 `READ-COMMITTED` 隔离级别且单个事务中 `SELECT` 语句较多,读写冲突较少的场景,可通过开启此变量用以避免获取全局 timestamp 带来的延迟和开销。 |
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_rc_read_check_ts 较多说明以及使用限制放在变量文档里,有点塞不下的感觉,而且也不易查找。能否考虑将特性说明放在 https://docs.pingcap.com/zh/tidb/dev/transaction-isolation-levels 这里或是哪篇文档里,而变量文档只需简单介绍变量即可? |
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
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
/remove-status LGT1 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 5d35b6c
|
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?