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

add documentation for tidb_enable_amend_pessimistic_txn. #4979

Merged
merged 6 commits into from
Dec 10, 2020

Conversation

cfzjywxk
Copy link
Contributor

add documentation for tidb_enable_amend_pessimistic_txn.

First-time contributors' checklist

What is changed, added or deleted? (Required)

Add documentation about the system variable introduced by the new feature and the related project

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

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

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

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

add documentation for tidb_enable_amend_pessimistic_txn.
@TomShawn TomShawn self-assigned this Nov 30, 2020
@TomShawn TomShawn added needs-cherry-pick-4.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. v5.0 This PR/issue applies to TiDB v5.0 labels Nov 30, 2020
Copy link
Member

@jackysp jackysp 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 ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 30, 2020
Copy link
Contributor

@zyguan zyguan left a comment

Choose a reason for hiding this comment

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

LGTM

It seems that the vars listed in this doc is in alphabetical order, thus we may need to prepose this one?

@cfzjywxk
Copy link
Contributor Author

LGTM

It seems that the vars list in this doc is in alphabetical order, thus we may need to prepose this one?

Thanks for reminding, I didn't notice it but just follow the implemetation order.


- 作用域:SESSION | GLOBAL
- 默认值: 0
- 这个变量用于控制是否开启 `AMEND TRANSACTION` 特性。开启该特性之后,在[悲观事务模式](/pessimistic-transaction.md)下,事务两阶段提交之前,如果该事务相关的表存在并发 DDL 操作和 SCHEMA VERSION 变更,TiDB 会尝试对于该事务进行 amend 操作修正该事务提交内容,使其和最新有效的 SCHEMA VERSION 保持一致,进而提交该事务而不返回 `Information schema is changed` 报错。该特性对于如下并发 DDL 变更生效:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 这个变量用于控制是否开启 `AMEND TRANSACTION` 特性。开启该特性之后,在[悲观事务模式](/pessimistic-transaction.md)下,事务两阶段提交之前,如果该事务相关的表存在并发 DDL 操作和 SCHEMA VERSION 变更,TiDB 会尝试对于该事务进行 amend 操作修正该事务提交内容,使其和最新有效的 SCHEMA VERSION 保持一致,进而提交该事务而不返回 `Information schema is changed` 报错。该特性对于如下并发 DDL 变更生效:
- 这个变量用于控制是否开启 `AMEND TRANSACTION` 特性。开启该特性之后,在[悲观事务模式](/pessimistic-transaction.md)下,事务两阶段提交之前,如果该事务相关的表存在并发 DDL 操作和 SCHEMA VERSION 变更,TiDB 会尝试对于该事务进行 amend 操作修正该事务的提交内容,使其和最新有效的 SCHEMA VERSION 保持一致,进而成功提交该事务而不返回 `Information schema is changed` 报错。该特性对于如下并发 DDL 变更生效:

- 这个变量用于控制是否开启 `AMEND TRANSACTION` 特性。开启该特性之后,在[悲观事务模式](/pessimistic-transaction.md)下,事务两阶段提交之前,如果该事务相关的表存在并发 DDL 操作和 SCHEMA VERSION 变更,TiDB 会尝试对于该事务进行 amend 操作修正该事务提交内容,使其和最新有效的 SCHEMA VERSION 保持一致,进而提交该事务而不返回 `Information schema is changed` 报错。该特性对于如下并发 DDL 变更生效:

- add/drop column 类型的 DDL 操作。
- modify/change column 类型的 DDL 操作。
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid we cannot support type changing for now

@TomShawn TomShawn added status/require-change Needs the author to address comments. and removed status/PTAL This PR is ready for reviewing. labels Dec 1, 2020
@TomShawn TomShawn added status/PTAL This PR is ready for reviewing. and removed status/require-change Needs the author to address comments. labels Dec 2, 2020
@ti-srebot
Copy link
Contributor

@jackysp, @zyguan, @you06, @MyonKeminta, @coocood, PTAL.

Copy link
Contributor

@you06 you06 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
Contributor

@you06, 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
Contributor

@jackysp, @zyguan, @you06, @MyonKeminta, @coocood, PTAL.

@ti-srebot
Copy link
Contributor

@cfzjywxk, please update your pull request.

@ti-srebot
Copy link
Contributor

@jackysp, @zyguan, @you06, @MyonKeminta, @coocood, PTAL.

@ti-srebot
Copy link
Contributor

@cfzjywxk, please update your pull request.


- 作用域:SESSION | GLOBAL
- 默认值: 0
- 这个变量用于控制是否开启 `AMEND TRANSACTION` 特性。开启该特性之后,在[悲观事务模式](/pessimistic-transaction.md)下,事务两阶段提交之前,如果该事务相关的表存在并发 DDL 操作和 SCHEMA VERSION 变更,TiDB 会尝试对于该事务进行 amend 操作修正该事务的提交内容,使其和最新有效的 SCHEMA VERSION 保持一致,进而成功提交该事务而不返回 `Information schema is changed` 报错。该特性对于如下并发 DDL 变更生效:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 这个变量用于控制是否开启 `AMEND TRANSACTION` 特性。开启该特性之后,[悲观事务模式](/pessimistic-transaction.md)下,事务两阶段提交之前,如果该事务相关的表存在并发 DDL 操作和 SCHEMA VERSION 变更,TiDB 会尝试对于该事务进行 amend 操作修正该事务的提交内容,使其和最新有效的 SCHEMA VERSION 保持一致,进而成功提交该事务而不返回 `Information schema is changed` 报错。该特性对于如下并发 DDL 变更生效:
- 这个变量用于控制是否开启 `AMEND TRANSACTION` 特性。在[悲观事务模式](/pessimistic-transaction.md)下开启该特性后,如果该事务相关的表存在并发 DDL 操作和 SCHEMA VERSION 变更,TiDB 会尝试对该事务进行 amend 操作,修正该事务的提交内容,使其和最新的有效 SCHEMA VERSION 保持一致,从而成功提交该事务而不返回 `Information schema is changed` 报错。该特性对以下并发 DDL 变更生效:

Comment on lines 318 to 320
- add/drop column 类型的 DDL 操作。
- modify/change column 类型的 DDL 操作,只对增大字段长度生效。
- add/drop index 类型的 DDL 操作,且操作的索引列不是在事务开启之后新创建。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- add/drop column 类型的 DDL 操作。
- modify/change column 类型的 DDL 操作,只对增大字段长度生效
- add/drop index 类型的 DDL 操作,且操作的索引列不是在事务开启之后新创建
- `ADD COLUMN` 或 `DROP COLUMN` 类型的 DDL 操作。
- `MODIFY COLUMN` 或 `CHANGE COLUMN` 类型的 DDL 操作,且只对增大字段长度的操作生效
- `ADD INDEX` 或 `DROP INDEX` 类型的 DDL 操作,且操作的索引列须在事务开启之前创建

- modify/change column 类型的 DDL 操作,只对增大字段长度生效。
- add/drop index 类型的 DDL 操作,且操作的索引列不是在事务开启之后新创建。

目前该特性可能造成事务语义的变化,且与 TiDB Binlog 存在部分兼容的场景,可以参考[事务语义行为区别](https://github.com/pingcap/tidb/issues/21069)和[与 Binlog 兼容问题汇总](https://github.com/pingcap/tidb/issues/20996)了解更多关于该特性的使用注意事项。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
目前该特性可能造成事务语义的变化,且与 TiDB Binlog 存在部分兼容的场景,可以参考[事务语义行为区别](https://github.com/pingcap/tidb/issues/21069)[与 Binlog 兼容问题汇总](https://github.com/pingcap/tidb/issues/20996)了解更多关于该特性的使用注意事项。
目前该特性可能造成事务语义的变化,且与 TiDB Binlog 存在部分不兼容的场景,可以参考[事务语义行为区别](https://github.com/pingcap/tidb/issues/21069)[ TiDB Binlog 兼容问题汇总](https://github.com/pingcap/tidb/issues/20996)了解更多关于该特性的使用注意事项。

@TomShawn TomShawn added status/require-change Needs the author to address comments. and removed status/PTAL This PR is ready for reviewing. labels Dec 7, 2020
@TomShawn
Copy link
Contributor

TomShawn commented Dec 7, 2020

@cfzjywxk I tried to refine the language in my comments. PTAL whether they are technically correct, thanks!

@ti-srebot
Copy link
Contributor

@ti-srebot
Copy link
Contributor

@cfzjywxk, please update your pull request.

Address comments
Copy link
Contributor

@TomShawn TomShawn 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 ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 10, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 10, 2020
@TomShawn TomShawn removed the status/require-change Needs the author to address comments. label Dec 10, 2020
@TomShawn TomShawn merged commit de1c82c into pingcap:master Dec 10, 2020
ti-srebot pushed a commit to ti-srebot/docs-cn that referenced this pull request Dec 10, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #5075

TomShawn added a commit that referenced this pull request Dec 10, 2020
* cherry pick #4979 to release-4.0

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

* Apply suggestions from code review

Co-authored-by: cfzjywxk <lsswxr@163.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
@TomShawn TomShawn assigned CharLotteiu and unassigned TomShawn Dec 14, 2020
@TomShawn TomShawn 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 Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/medium Changes of a medium size. 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.

8 participants