Skip to content

update async commit related documentations#5607

Merged
ti-chi-bot merged 27 commits into
pingcap:masterfrom
sticnarf:async-commit-5.0-ga
Mar 24, 2021
Merged

update async commit related documentations#5607
ti-chi-bot merged 27 commits into
pingcap:masterfrom
sticnarf:async-commit-5.0-ga

Conversation

@sticnarf
Copy link
Copy Markdown
Contributor

What is changed, added or deleted? (Required)

TiDB 5.0 GA will not contain configurations related to async commit or 1PC. So they are removed.

And we also introduce a weaker consistency model for transactions. Add documentations about it.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@sticnarf sticnarf force-pushed the async-commit-5.0-ga branch 6 times, most recently from 6e460f4 to 2ca4f59 Compare February 25, 2021 06:14
Comment thread sql-statements/sql-statement-start-transaction.md
@TomShawn
Copy link
Copy Markdown
Contributor

@sticnarf Please involve a technical review.

@TomShawn TomShawn self-assigned this Feb 25, 2021
@TomShawn TomShawn added needs-cherry-pick-5.0 size/medium Changes of a medium size. status/PTAL This PR is ready for reviewing. translation/doing This PR’s assignee is translating this PR. labels Feb 25, 2021
@sticnarf sticnarf force-pushed the async-commit-5.0-ga branch 2 times, most recently from 548e38c to 89cbb3c Compare February 25, 2021 07:09
@sticnarf
Copy link
Copy Markdown
Contributor Author

@youjiali1995 Could you help review the doc, especially the part of starting transactions with causal consistency?

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Copy link
Copy Markdown
Contributor

@youjiali1995 youjiali1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

+ TiKV 的负载阈值,如果超过此阈值,会收集更多的 batch 封包,来减轻 TiKV 的压力。仅在 `tikv-client.max-batch-size` 值大于 0 时有效,不推荐修改该值。
+ 默认值:200

## tikv-client.async-commit <span class="version-mark">从 v5.0.0-rc 版本开始引入</span>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PM does not want to expose these advanced parameters to the user. pingcap/tidb#22945 removes these parameters from the example.


![BeginTransactionStmt](/media/sqlgram/BeginTransactionStmt.png)
```ebnf+diagram
BeginTransactionStmt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the format isn't unified. All other places are

BeginTransactionStmt :=
    'BEGIN' ( 'PESSIMISTIC' | 'OPTIMISTIC' )?
|   'START' 'TRANSACTION'
...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EBNF in other places does not have multiple indentations. Now I put the second closure in one line like others...

Comment on lines +21 to +23
( 'READ' ( 'WRITE' | 'ONLY' ( 'WITH' 'TIMESTAMP' 'BOUND' TimestampBound )? )
| 'WITH' 'CONSISTENT' 'SNAPSHOT'
| 'WITH' 'CAUSAL' 'CONSISTENCY' 'ONLY' )?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to add indents here.

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Copy link
Copy Markdown
Contributor

@youjiali1995 youjiali1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

@ti-srebot
Copy link
Copy Markdown
Contributor

@youjiali1995, Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments. See the corresponding SIG page for more information. Related SIG: docs(slack).

@ti-srebot
Copy link
Copy Markdown
Contributor

@TomShawn, @youjiali1995, PTAL.

Comment thread transaction-overview.md
Comment thread transaction-overview.md
Comment thread transaction-overview.md
Comment thread transaction-overview.md
sticnarf and others added 2 commits March 23, 2021 17:13
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Comment thread system-variables.md Outdated

- 作用域:SESSION | GLOBAL
- 默认值:对于新创建的集群,v5.0.0-rc 版本默认值为 OFF,自 v5.0.0 GA 版本起默认值为 ON。对于升级到 v5.0.0 GA 版本的集群,如果升级前是 v5.0.0-rc 版本,升级不改变该变量的值;如果升级前是 v4.0 及之前版本,升级后默认值为 OFF。
- 默认值:对于新创建的集群,v5.0 RC 版本默认值为 OFF,自 v5.0 GA 版本起默认值为 ON。对于升级到 v5.0 GA 版本的集群,如果升级前是 v5.0 RC 版本,升级不改变该变量的值;如果升级前是 v4.0 及之前版本,升级后默认值为 OFF。
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 默认值:对于新创建的集群,v5.0 RC 版本默认值为 OFF,自 v5.0 GA 版本起默认值为 ON。对于升级到 v5.0 GA 版本的集群,如果升级前是 v5.0 RC 版本,升级不改变该变量的值;如果升级前是 v4.0 及之前版本,升级后默认值为 OFF。
- 默认值:对于新创建的集群,默认值为 ON。对于升级版本的集群,如果升级前是 v5.0 RC 及之后版本,升级不改变该变量的值;如果升级前是 v4.0 及之前版本,升级后默认值为 OFF。

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Comment thread system-variables.md Outdated

> **注意:**
>
> 启用 TiDB Binlog 后,开启该选项无法获得性能提升。如果可能,建议使用 [TiCDC](/ticdc/ticdc-overview.md) 替代。
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> 启用 TiDB Binlog 后,开启该选项无法获得性能提升。如果可能,建议使用 [TiCDC](/ticdc/ticdc-overview.md) 替代。
> 启用 TiDB Binlog 后,开启该选项无法获得性能提升。要获得性能提升,建议使用 [TiCDC](/ticdc/ticdc-overview.md) 替代 TiDB Binlog

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Comment thread system-variables.md
Comment on lines 379 to +397
### `tidb_enable_async_commit` <span class="version-mark">从 v5.0.0-rc 版本开始引入</span>

> **警告:**
>
> 当前该功能为实验特性,不建议在生产环境中使用。目前存在已知问题有:
- 作用域:SESSION | GLOBAL
- 默认值:对于新创建的集群,默认值为 ON。对于升级版本的集群,如果升级前是 v5.0 RC 及之后版本,升级不改变该变量的值;如果升级前是 v4.0 及之前版本,升级后默认值为 OFF。
- 该变量控制是否启用 Async Commit 特性,使事务两阶段提交的第二阶段于后台异步进行。开启本特性能降低事务提交的延迟。

> **注意:**
>
> + 暂时与 [TiCDC](/ticdc/ticdc-overview.md) 不兼容,可能导致 TiCDC 运行不正常
> + 暂时与 [Compaction Filter](/tikv-configuration-file.md#enable-compaction-filter-从-v500-rc-版本开始引入) 不兼容,共同使用时有小概率发生写丢失。
> + 本特性与 TiDB Binlog 不兼容,开启 TiDB Binlog 时本配置将不生效。
> 启用 TiDB Binlog 后,开启该选项无法获得性能提升。要获得性能提升,建议使用 [TiCDC](/ticdc/ticdc-overview.md) 替代 TiDB Binlog

### `enable-one-pc` <span class="version-mark">从 v5.0.0-rc 版本开始引入</span>

- 作用域:SESSION | GLOBAL
- 默认值:OFF
- 该变量控制是否启用 Async Commit 特性,使事务两阶段提交的第二阶段于后台异步进行。开启本特性能降低事务提交的延迟
- 默认值:对于新创建的集群,默认值为 ON。对于升级版本的集群,如果升级前是 v5.0 RC 及之后版本,升级不改变该变量的值;如果升级前是 v4.0 及之前版本,升级后默认值为 OFF
- 指定是否在只涉及一个 Region 的事务上启用一阶段提交特性。比起传统两阶段提交,一阶段提交能大幅降低事务提交延迟并提升吞吐

> **警告:**
> **注意:**
>
> 开启本特性时,默认不保证事务的外部一致性。具体请参考 [`tidb_guarantee_external_consistency`](#tidb_guarantee_external_consistency-从-v500-rc-版本开始引入) 系统变量
> 启用 TiDB Binlog 后,开启该选项无法获得性能提升。要获得性能提升,建议使用 [TiCDC](/ticdc/ticdc-overview.md) 替代 TiDB Binlog
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一部分的变量有涉及因果一致性的内容吗?是否需要在这里提到因果一致性,或是在因果一致性的内容里提到 async commit? 二者是否有关系呢?

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Comment thread transaction-overview.md Outdated
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
@TomShawn
Copy link
Copy Markdown
Contributor

/lgtm

@TomShawn
Copy link
Copy Markdown
Contributor

/remove-status require-change
/label require-LGT1

@ti-chi-bot ti-chi-bot added require-LGT1 Indicates that the PR requires an LGTM. and removed status/require-change Needs the author to address comments. labels Mar 24, 2021
@TomShawn
Copy link
Copy Markdown
Contributor

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: c0cc15b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 24, 2021
@ti-chi-bot ti-chi-bot merged commit 97b43be into pingcap:master Mar 24, 2021
ti-srebot pushed a commit to ti-srebot/docs-cn that referenced this pull request Mar 24, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Contributor

cherry pick to release-5.0 in PR #5812

@TomShawn
Copy link
Copy Markdown
Contributor

TomShawn commented Mar 24, 2021

release-5.0: 【对于新创建的集群,5.0 RC 默认值为 OFF】

@ti-chi-bot ti-chi-bot added the requires-version-specific-changes After cherry-picked, the cherry-picked PR requires further changes. label Mar 24, 2021
@TomShawn
Copy link
Copy Markdown
Contributor

/remove-translation doing
/translation done

@ti-chi-bot ti-chi-bot added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR’s assignee is translating this PR. labels Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

require-LGT1 Indicates that the PR requires an LGTM. requires-version-specific-changes After cherry-picked, the cherry-picked PR requires further changes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. v5.0 This PR/issue applies to TiDB v5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants