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

Expand JOB_TYPE documentation for ADMIN SHOW DDL... output #14461

Merged
merged 6 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sql-statements/sql-statement-admin-show-ddl.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ ADMIN SHOW DDL;
- `JOB_ID`:每个 DDL 操作对应一个 DDL 任务,`JOB_ID` 全局唯一。
- `DB_NAME`:执行 DDL 操作的数据库的名称。
- `TABLE_NAME`:执行 DDL 操作的表的名称。
- `JOB_TYPE`:DDL 操作的类型。
- `JOB_TYPE`:DDL 任务的类型。常见的任务类型包括:
- `ingest`:通过 [`tidb_ddl_enable_fast_reorg`](/system-variables.md#tidb_ddl_enable_fast_reorg-从-v630-版本开始引入) 配置的加速索引回填的 ingest 任务。
- `txn`:基本的事务性回填。
- `txn-merge`:在回填完成时将临时索引与原始索引合并的事务性回填。
- `SCHEMA_STATE`:DDL 所操作的 schema 对象的当前状态。如果 `JOB_TYPE` 是 `ADD INDEX`,则为索引的状态;如果是 `ADD COLUMN`,则为列的状态;如果是 `CREATE TABLE`,则为表的状态。常见的状态有以下几种:
- `none`:表示不存在。一般 `DROP` 操作或者 `CREATE` 操作失败回滚后,会变为 `none` 状态。
- `delete only`、`write only`、`delete reorganization`、`write reorganization`:这四种状态是中间状态,具体含义请参考 [TiDB 中在线 DDL 异步变更的原理](/ddl-introduction.md#tidb-在线-ddl-异步变更的原理)。由于中间状态转换很快,一般操作中看不到这几种状态,只有执行 `ADD INDEX` 操作时能看到处于 `write reorganization` 状态,表示正在添加索引数据。
Expand Down
4 changes: 3 additions & 1 deletion system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,9 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;

> **注意:**
>
> 在升级到 v6.5.0 及以上版本时,建议你检查 TiDB 的 [`temp-dir`](/tidb-configuration-file.md#temp-dir-从-v630-版本开始引入) 路径是否正确挂载了 SSD 磁盘。该参数是 TiDB 的配置参数,设置后需要重启 TiDB 才能生效。因此,在升级前提前进行设置,可以避免再次重启。
> * 要使用索引加速功能,你需要提供一个可写且具有足够空余空间的临时路径 [`temp-dir`](/tidb-configuration-file.md#temp-dir-从-v630-版本开始引入)。如果 `temp-dir` 无法使用,TiDB 会退回到非加速的索引创建方式。建议将 `temp-dir` 挂载在 SSD 磁盘上。
>
> * 在升级到 v6.5.0 及以上版本时,请确保 TiDB 的 [`temp-dir`](/tidb-configuration-file.md#temp-dir-从-v630-版本开始引入) 路径已正确挂载了 SSD 磁盘。该参数是 TiDB 的配置参数,设置后需要重启 TiDB 才能生效。因此,在升级前提前进行设置,可以避免再次重启。

### `tidb_enable_dist_task` <span class="version-mark">从 v7.1.0 版本开始引入</span>

Expand Down