-
Notifications
You must be signed in to change notification settings - Fork 0
test0329 #12
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
base: master
Are you sure you want to change the base?
test0329 #12
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,26 @@ | ||||||
--- | ||||||
title: DDL 常见问题 | ||||||
summary: 介绍 DDL 相关的常见问题。 | ||||||
--- | ||||||
|
||||||
# DDL 常见问题 | ||||||
|
||||||
本文档介绍 TiDB 集群中常见的些 DDL 问题。 | ||||||
|
||||||
## TiDB DDL 是否支持 DDL 语句间并行?具体一些运行特征是怎样地? | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 标题表述不够规范,建议修改为更专业的提问方式。
Suggested change
|
||||||
|
||||||
在 TiDB v6.2 之后时,TiDB 提供并发 DDL(concurent DDL) 执行的能力。 并发 DDL 主是提供 DDL 语句间的并发执行支持。这里和以前的 DDL 执将会发生如下变化: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 句子存在多处语病和错别字,建议全面修改。
Suggested change
|
||||||
|
||||||
1. 需要判断 DDL 语句间是否有相关性,如果有相关性的 DDL 语句将会按照进入 TiDB 的顺序执行,没有相关性的 DDL 语句可以并发执行。并发判断规则: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 列表项描述不够清晰,建议补充说明相关性判断的具体标准。
Suggested change
|
||||||
1. 相同表上的 DDL 语句之间具有相关性,需要按照进入 TiDB 的顺序执行; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 表述不够严谨,建议明确说明"相同表"的范围。
Suggested change
|
||||||
2. 对于 Schema 上的操作,可能会对于 schema 中的表上的 DDL 语句建立相关性,目前 Drop Schema 会对于其包含 Schema 上的 DDL 产生相关性;也需要顺序执行; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 句子表述不够清晰,建议重新组织语言。
Suggested change
|
||||||
2. 是否所有的 DDL 语句都会并发执行? | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 提问方式不够专业,建议修改。
Suggested change
|
||||||
当前,答案是否定的,在 TiDB 中 DDL 语句被分为两类, | ||||||
1. 普通(general)DDL 语句,这类 DDL 语句的执行只需要修改对象的元数据,不需要操作 schema 存储的数据,通常在秒级完成;需要的计算资源相对少; | ||||||
2. 需要重组(reorg)DDL 语句, 这类 DDL 语句的执行不仅需要修改对象的元数据,也需要对于 schema 存储的数据进行处理,例如:加索引,需要扫描全表数据,来创建索引,需要比较多的计算资源与较长的执行时间; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 术语使用不一致,建议统一使用"reorganize"。
Suggested change
|
||||||
当前我们仅对于需要重组的 DDL 语句启动了并发执行支持。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 表述不够准确,建议明确说明当前支持的范围。
Suggested change
|
||||||
3. 对于启动了并发 DDL 语句支持的 TiDB 集群,DDL 语句间的并发度是如何确定的? | ||||||
目前因为 DDL 等后台任务的执行可能会占用相当的资源,因此我们采取了一个相对保守的策略来确定 DDL 语句执行的并发度 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 句子表述不够通顺,建议修改。
Suggested change
|
||||||
1. 对于普通 DDL(general DDL) 语句,我们当前语句并发度是 1(后续将会提供并发执行支持); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修改后的表述虽然更口语化,但技术文档建议保持一致性,建议保留原表述或采用更正式的表述方式。
Suggested change
|
||||||
2. 对于需要重组的 DDL(Reorg DDL)语句,我们的并发度设置规则如下(并发度不允许用户自己设置): | ||||||
TiDB DDL owner 节点容器能够使用的 CPU 资源数量的 1/4 与 1 之间的最大值,例如 8C 规格的 TiDB DDL owner 节点,并发度将会是 2。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 技术细节描述不够准确,建议补充计算公式。
Suggested change
|
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.
句子表述不够通顺,建议修改措辞。