diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7947102b65b4..07def756d241 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -19,6 +19,7 @@ By default, **CHOOSE MASTER ONLY** so your changes will be applied to the next T For details, see [tips for choosing the affected versions (in Chinese)](https://github.com/pingcap/docs-cn/blob/master/CONTRIBUTING.md#版本选择指南). - [ ] master (the latest development version) +- [ ] v7.4 (TiDB 7.4 versions) - [ ] v7.3 (TiDB 7.3 versions) - [ ] v7.2 (TiDB 7.2 versions) - [ ] v7.1 (TiDB 7.1 versions) diff --git a/README.md b/README.md index f1d6530a1059..579b22587bac 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ | 文档仓库 branch | 对应 TiDB 文档版本 | |:---------|:----------| | [`master`](https://github.com/pingcap/docs-cn/tree/master) | dev 最新开发版 | +| [`release-7.3`](https://github.com/pingcap/docs-cn/tree/release-7.3) | 7.3 开发里程碑版 (DMR) | | [`release-7.2`](https://github.com/pingcap/docs-cn/tree/release-7.2) | 7.2 开发里程碑版 (DMR) | | [`release-7.1`](https://github.com/pingcap/docs-cn/tree/release-7.1) | 7.1 长期支持版 (LTS) | | [`release-7.0`](https://github.com/pingcap/docs-cn/tree/release-7.0) | 7.0 开发里程碑版 (DMR) | diff --git a/TOC.md b/TOC.md index 86b69327261d..bed6b2af06bf 100644 --- a/TOC.md +++ b/TOC.md @@ -4,7 +4,7 @@ - [文档中心](https://docs.pingcap.com/zh) - 关于 TiDB - [TiDB 简介](/overview.md) - - [TiDB 7.2 Release Notes](/releases/release-7.2.0.md) + - [TiDB 7.3 Release Notes](/releases/release-7.3.0.md) - [功能概览](/basic-features.md) - [与 MySQL 的兼容性](/mysql-compatibility.md) - [使用限制](/tidb-limitations.md) @@ -1014,6 +1014,8 @@ - [版本发布时间线](/releases/release-timeline.md) - [TiDB 版本规则](/releases/versioning.md) - [TiDB 离线包](/binary-package.md) + - v7.3 + - [7.3.0-DMR](/releases/release-7.3.0.md) - v7.2 - [7.2.0-DMR](/releases/release-7.2.0.md) - v7.1 diff --git a/basic-features.md b/basic-features.md index 077e05ab711e..17193ef1f52c 100644 --- a/basic-features.md +++ b/basic-features.md @@ -20,227 +20,231 @@ aliases: ['/docs-cn/dev/basic-features/','/docs-cn/dev/experimental-features-4.0 ## 数据类型,函数和操作符 -| 数据类型,函数,操作符 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [数值类型](/data-type-numeric.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [日期和时间类型](/data-type-date-and-time.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [字符串类型](/data-type-string.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [JSON 类型](/data-type-json.md) | Y | Y | Y | E | E | E | E | E | E | E | -| [控制流程函数](/functions-and-operators/control-flow-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [字符串函数](/functions-and-operators/string-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [数值函数与操作符](/functions-and-operators/numeric-functions-and-operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [日期和时间函数](/functions-and-operators/date-and-time-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [位函数和操作符](/functions-and-operators/bit-functions-and-operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Cast 函数和操作符](/functions-and-operators/cast-functions-and-operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [加密和压缩函数](/functions-and-operators/encryption-and-compression-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [信息函数](/functions-and-operators/information-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [JSON 函数](/functions-and-operators/json-functions.md) | Y | Y | Y | E | E | E | E | E | E | E | -| [聚合函数](/functions-and-operators/aggregate-group-by-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [窗口函数](/functions-and-operators/window-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [其他函数](/functions-and-operators/miscellaneous-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [操作符](/functions-and-operators/operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [字符集和排序规则](/character-set-and-collation.md) [^1] | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [用户级别锁](/functions-and-operators/locking-functions.md) | Y | Y | Y | Y | N | N | N | N | N | N | +| 数据类型,函数,操作符 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [数值类型](/data-type-numeric.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [日期和时间类型](/data-type-date-and-time.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [字符串类型](/data-type-string.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [JSON 类型](/data-type-json.md) | Y | Y | Y | Y | E | E | E | E | E | E | E | +| [控制流程函数](/functions-and-operators/control-flow-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [字符串函数](/functions-and-operators/string-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [数值函数与操作符](/functions-and-operators/numeric-functions-and-operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [日期和时间函数](/functions-and-operators/date-and-time-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [位函数和操作符](/functions-and-operators/bit-functions-and-operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Cast 函数和操作符](/functions-and-operators/cast-functions-and-operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [加密和压缩函数](/functions-and-operators/encryption-and-compression-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [信息函数](/functions-and-operators/information-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [JSON 函数](/functions-and-operators/json-functions.md) | Y | Y | Y | Y | E | E | E | E | E | E | E | +| [聚合函数](/functions-and-operators/aggregate-group-by-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [窗口函数](/functions-and-operators/window-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [其他函数](/functions-and-operators/miscellaneous-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [操作符](/functions-and-operators/operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [字符集和排序规则](/character-set-and-collation.md) [^1] | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [用户级别锁](/functions-and-operators/locking-functions.md) | Y | Y | Y | Y | Y | N | N | N | N | N | N | ## 索引和约束 -| 索引和约束 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [表达式索引](/sql-statements/sql-statement-create-index.md#表达式索引) [^2] | Y | Y | Y | E | E | E | E | E | E | E | -| [列式存储 (TiFlash)](/tiflash/tiflash-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [使用 FastScan 加速 OLAP 场景下的查询](/tiflash/use-fastscan.md) | Y | Y | E | N | N | N | N | N | N | N | -| [RocksDB 引擎](/storage-engine/rocksdb-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Titan 插件](/storage-engine/titan-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Titan Level Merge](/storage-engine/titan-configuration.md#level-merge实验功能) | E | E | E | E | E | E | E | E | E | E | -| [使用 bucket 提高数据扫描并发度](/tune-region-performance.md#使用-bucket-增加并发) | E | E | E | E | N | N | N | N | N | N | -| [不可见索引](/sql-statements/sql-statement-add-index.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | -| [复合主键](/constraints.md#主键约束) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [`CHECK` 约束](/constraints.md#check-约束) | Y | N | N | N | N | N | N | N | N | N | -| [唯一约束](/constraints.md#唯一约束) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [整型主键上的聚簇索引](/constraints.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [复合或非整型主键上的聚簇索引](/constraints.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | -| [多值索引](/sql-statements/sql-statement-create-index.md#多值索引) | Y | Y | N | N | N | N | N | N | N | N | -| [外键约束](/constraints.md#外键约束) | Y | Y | N | N | N | N | N | N | N | N | -| [TiFlash 延迟物化](/tiflash/tiflash-late-materialization.md) | Y | Y | N | N | N | N | N | N | N | N | +| 索引和约束 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [表达式索引](/sql-statements/sql-statement-create-index.md#表达式索引) [^2] | Y | Y | Y | Y | E | E | E | E | E | E | E | +| [列式存储 (TiFlash)](/tiflash/tiflash-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [使用 FastScan 加速 OLAP 场景下的查询](/tiflash/use-fastscan.md) | Y | Y | Y | E | N | N | N | N | N | N | N | +| [RocksDB 引擎](/storage-engine/rocksdb-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Titan 插件](/storage-engine/titan-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Titan Level Merge](/storage-engine/titan-configuration.md#level-merge实验功能) | E | E | E | E | E | E | E | E | E | E | E | +| [使用 bucket 提高数据扫描并发度](/tune-region-performance.md#使用-bucket-增加并发) | E | E | E | E | E | N | N | N | N | N | N | +| [不可见索引](/sql-statements/sql-statement-add-index.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | +| [复合主键](/constraints.md#主键约束) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [`CHECK` 约束](/constraints.md#check-约束) | Y | Y | N | N | N | N | N | N | N | N | N | +| [唯一约束](/constraints.md#唯一约束) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [整型主键上的聚簇索引](/constraints.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [复合或非整型主键上的聚簇索引](/constraints.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | +| [多值索引](/sql-statements/sql-statement-create-index.md#多值索引) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [外键约束](/constraints.md#外键约束) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [TiFlash 延迟物化](/tiflash/tiflash-late-materialization.md) | Y | Y | Y | N | N | N | N | N | N | N | N | ## SQL 语句 -| SQL 语句 [^3] | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| `SELECT`,`INSERT`,`UPDATE`,`DELETE`,`REPLACE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| `INSERT ON DUPLICATE KEY UPDATE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| `LOAD DATA INFILE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| `SELECT INTO OUTFILE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| `INNER JOIN`, LEFT\|RIGHT [OUTER] JOIN | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| `UNION`,`UNION ALL` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [`EXCEPT` 和 `INTERSECT` 运算符](/functions-and-operators/set-operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | -| `GROUP BY`,`ORDER BY` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [窗口函数](/functions-and-operators/window-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [公共表表达式 (CTE)](/sql-statements/sql-statement-with.md) | Y | Y | Y | Y | Y | Y | Y | Y | N | N | -| `START TRANSACTION`,`COMMIT`,`ROLLBACK` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [`EXPLAIN`](/sql-statements/sql-statement-explain.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [用户自定义变量](/user-defined-variables.md) | E | E | E | E | E | E | E | E | E | E | -| [`BATCH [ON COLUMN] LIMIT INTEGER DELETE`](/sql-statements/sql-statement-batch.md) | Y | Y | Y | Y | N | N | N | N | N | N | -| [`BATCH [ON COLUMN] LIMIT INTEGER INSERT/UPDATE/REPLACE`](/sql-statements/sql-statement-batch.md) | Y | Y | Y | N | N | N | N | N | N | N | -| [`ALTER TABLE ... COMPACT`](/sql-statements/sql-statement-alter-table-compact.md) | Y | Y | Y | E | N | N | N | N | N | N | -| [表级锁 (Table Lock)](/sql-statements/sql-statement-lock-tables-and-unlock-tables.md) | E | E | E | E | E | E | E | E | E | E | -| [物化列式存储的查询结果](/tiflash/tiflash-results-materialization.md) | Y | Y | E | N | N | N | N | N | N | N | +| SQL 语句 [^3] | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| `SELECT`,`INSERT`,`UPDATE`,`DELETE`,`REPLACE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| `INSERT ON DUPLICATE KEY UPDATE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| `LOAD DATA INFILE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| `SELECT INTO OUTFILE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| `INNER JOIN`, LEFT\|RIGHT [OUTER] JOIN | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| `UNION`,`UNION ALL` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [`EXCEPT` 和 `INTERSECT` 运算符](/functions-and-operators/set-operators.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | +| `GROUP BY`,`ORDER BY` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [窗口函数](/functions-and-operators/window-functions.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [公共表表达式 (CTE)](/sql-statements/sql-statement-with.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | +| `START TRANSACTION`,`COMMIT`,`ROLLBACK` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [`EXPLAIN`](/sql-statements/sql-statement-explain.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [用户自定义变量](/user-defined-variables.md) | E | E | E | E | E | E | E | E | E | E | E | +| [`BATCH [ON COLUMN] LIMIT INTEGER DELETE`](/sql-statements/sql-statement-batch.md) | Y | Y | Y | Y | Y | N | N | N | N | N | N | +| [`BATCH [ON COLUMN] LIMIT INTEGER INSERT/UPDATE/REPLACE`](/sql-statements/sql-statement-batch.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [`ALTER TABLE ... COMPACT`](/sql-statements/sql-statement-alter-table-compact.md) | Y | Y | Y | Y | E | N | N | N | N | N | N | +| [表级锁 (Table Lock)](/sql-statements/sql-statement-lock-tables-and-unlock-tables.md) | E | E | E | E | E | E | E | E | E | E | E | +| [物化列式存储的查询结果](/tiflash/tiflash-results-materialization.md) | Y | Y | Y | E | N | N | N | N | N | N | N | ## 高级 SQL 功能 -| 高级 SQL 功能 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [Prepare 语句执行计划缓存](/sql-prepared-plan-cache.md) | Y | Y | Y | Y | Y | Y | E | E | E | E | -| [非 Prepare 语句执行计划缓存](/sql-non-prepared-plan-cache.md) | E | E | N | N | N | N | N | N | N | N | -| [执行计划管理 (SPM)](/sql-plan-management.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [根据历史执行计划创建绑定](/sql-plan-management.md#根据历史执行计划创建绑定) | Y | Y | E | N | N | N | N | N | N | N | -| [下推计算结果缓存 (Coprocessor Cache)](/coprocessor-cache.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | E | -| [Stale Read](/stale-read.md) | Y | Y | Y | Y | Y | Y | Y | Y | N | N | -| [Follower Read](/follower-read.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [通过系统变量 `tidb_snapshot` 读取历史数据](/read-historical-data.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Optimizer hints](/optimizer-hints.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [MPP 执行引擎](/explain-mpp.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | -| [MPP 执行引擎 - compression exchange](/explain-mpp.md#mpp-version-和-exchange-数据压缩) | Y | Y | N | N | N | N | N | N | N | N | -| [TiFlash Pipeline 执行模型](/tiflash/tiflash-pipeline-model.md) | E | N | N | N | N | N | N | N | N | N | -| [索引合并](/explain-index-merge.md) | Y | Y | Y | Y | Y | E | E | E | E | E | -| [基于 SQL 的数据放置规则](/placement-rules-in-sql.md) | Y | Y | Y | Y | E | E | N | N | N | N | -| [Cascades Planner](/system-variables.md#tidb_enable_cascades_planner) | E | E | E | E | E | E | E | E | E | E | +| 高级 SQL 功能 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [Prepare 语句执行计划缓存](/sql-prepared-plan-cache.md) | Y | Y | Y | Y | Y | Y | Y | E | E | E | E | +| [非 Prepare 语句执行计划缓存](/sql-non-prepared-plan-cache.md) | E | E | E | N | N | N | N | N | N | N | N | +| [执行计划管理 (SPM)](/sql-plan-management.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [根据历史执行计划创建绑定](/sql-plan-management.md#根据历史执行计划创建绑定) | Y | Y | Y | E | N | N | N | N | N | N | N | +| [下推计算结果缓存 (Coprocessor Cache)](/coprocessor-cache.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | E | +| [Stale Read](/stale-read.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | +| [Follower Read](/follower-read.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [通过系统变量 `tidb_snapshot` 读取历史数据](/read-historical-data.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Optimizer hints](/optimizer-hints.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [MPP 执行引擎](/explain-mpp.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | +| [MPP 执行引擎 - compression exchange](/explain-mpp.md#mpp-version-和-exchange-数据压缩) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [TiFlash Pipeline 执行模型](/tiflash/tiflash-pipeline-model.md) | E | E | N | N | N | N | N | N | N | N | N | +| [TiFlash 副本选择策略](/system-variables.md#tiflash_replica_read-从-v730-版本开始引入) | Y | N | N | N | N | N | N | N | N | N | N | +| [索引合并](/explain-index-merge.md) | Y | Y | Y | Y | Y | Y | E | E | E | E | E | +| [基于 SQL 的数据放置规则](/placement-rules-in-sql.md) | Y | Y | Y | Y | Y | E | E | N | N | N | N | +| [Cascades Planner](/system-variables.md#tidb_enable_cascades_planner) | E | E | E | E | E | E | E | E | E | E | E | +| [Runtime Filter](/runtime-filter.md) | Y | N | N | N | N | N | N | N | N | N | N | ## 数据定义语言 (DDL) -| 数据定义语言 (DDL) | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| `CREATE`,`DROP`,`ALTER`,`RENAME`,`TRUNCATE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [生成列](/generated-columns.md) | Y | Y | E | E | E | E | E | E | E | E | -| [视图](/views.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [序列](/sql-statements/sql-statement-create-sequence.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [`AUTO_INCREMENT` 列](/auto-increment.md) | Y | Y | Y[^4] | Y | Y | Y | Y | Y | Y | Y | -| [`AUTO_RANDOM` 列](/auto-random.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [TTL (Time to Live)](/time-to-live.md) | Y | Y | E | N | N | N | N | N | N | N | -| [DDL 算法断言](/sql-statements/sql-statement-alter-table.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| 在单条语句中添加多列 | Y | Y | Y | E | E | E | E | E | E | E | -| [更改列类型](/sql-statements/sql-statement-modify-column.md) | Y | Y | Y | Y | Y | Y | Y | Y | N | N | -| [临时表](/temporary-tables.md) | Y | Y | Y | Y | Y | Y | N | N | N | N | -| 并行 DDL | Y | Y | Y | N | N | N | N | N | N | N | -| [添加索引加速](/system-variables.md#tidb_ddl_enable_fast_reorg-从-v630-版本开始引入) | Y | Y | Y | N | N | N | N | N | N | N | -| [元数据锁](/metadata-lock.md) | Y | Y | Y | N | N | N | N | N | N | N | -| [`FLASHBACK CLUSTER TO TIMESTAMP`](/sql-statements/sql-statement-flashback-to-timestamp.md) | Y | Y | Y | N | N | N | N | N | N | N | -| [暂停](/sql-statements/sql-statement-admin-pause-ddl.md)/[恢复](/sql-statements/sql-statement-admin-resume-ddl.md) DDL | E | N | N | N | N | N | N | N | N | N | +| 数据定义语言 (DDL) | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| `CREATE`,`DROP`,`ALTER`,`RENAME`,`TRUNCATE` | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [生成列](/generated-columns.md) | Y | Y | Y | E | E | E | E | E | E | E | E | +| [视图](/views.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [序列](/sql-statements/sql-statement-create-sequence.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [`AUTO_INCREMENT` 列](/auto-increment.md) | Y | Y | Y | Y[^4] | Y | Y | Y | Y | Y | Y | Y | +| [`AUTO_RANDOM` 列](/auto-random.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [TTL (Time to Live)](/time-to-live.md) | Y | Y | Y | E | N | N | N | N | N | N | N | +| [DDL 算法断言](/sql-statements/sql-statement-alter-table.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| 在单条语句中添加多列 | Y | Y | Y | Y | E | E | E | E | E | E | E | +| [更改列类型](/sql-statements/sql-statement-modify-column.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | +| [临时表](/temporary-tables.md) | Y | Y | Y | Y | Y | Y | Y | N | N | N | N | +| 并行 DDL | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [添加索引加速](/system-variables.md#tidb_ddl_enable_fast_reorg-从-v630-版本开始引入) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [元数据锁](/metadata-lock.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [`FLASHBACK CLUSTER TO TIMESTAMP`](/sql-statements/sql-statement-flashback-to-timestamp.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [暂停](/sql-statements/sql-statement-admin-pause-ddl.md)/[恢复](/sql-statements/sql-statement-admin-resume-ddl.md) DDL | E | E | N | N | N | N | N | N | N | N | N | ## 事务 -| 事务 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [Async commit](/system-variables.md#tidb_enable_async_commit-从-v50-版本开始引入) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | -| [1PC](/system-variables.md#tidb_enable_1pc-从-v50-版本开始引入) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | -| [大事务 (10 GB)](/transaction-overview.md#事务限制) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [悲观事务](/pessimistic-transaction.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [乐观事务](/optimistic-transaction.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [可重复读隔离(快照隔离)](/transaction-isolation-levels.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [读已提交隔离](/transaction-isolation-levels.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| 事务 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [Async commit](/system-variables.md#tidb_enable_async_commit-从-v50-版本开始引入) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | +| [1PC](/system-variables.md#tidb_enable_1pc-从-v50-版本开始引入) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | +| [大事务 (10 GB)](/transaction-overview.md#事务限制) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [悲观事务](/pessimistic-transaction.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [乐观事务](/optimistic-transaction.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [可重复读隔离(快照隔离)](/transaction-isolation-levels.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [读已提交隔离](/transaction-isolation-levels.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | ## 分区 -| 分区 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [Range 分区](/partitioned-table.md#range-分区) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Hash 分区](/partitioned-table.md#hash-分区) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Key 分区](/partitioned-table.md#key-分区) | Y | Y | N | N | N | N | N | N | N | N | -| [List 分区](/partitioned-table.md#list-分区) | Y | Y | Y | Y | E | E | E | E | E | N | -| [List COLUMNS 分区](/partitioned-table.md#list-columns-分区) | Y | Y | Y | Y | E | E | E | E | E | N | -| [`EXCHANGE PARTITION`](/partitioned-table.md) | Y | Y | Y | E | E | E | E | E | E | N | -| [`REORGANIZE PARTITION`](/partitioned-table.md#重组分区) | Y | Y | N | N | N | N | N | N | N | N | -| [`COALESCE PARTITION`](/partitioned-table.md#减少分区数量) | Y | Y | N | N | N | N | N | N | N | N | -| [动态裁剪](/partitioned-table.md#动态裁剪模式) | Y | Y | Y | Y | E | E | E | E | N | N | -| [Range COLUMNS 分区](/partitioned-table.md#range-columns-分区) | Y | Y | Y | N | N | N | N | N | N | N | -| [Range INTERVAL 分区](/partitioned-table.md#range-interval-分区) | Y | Y | E | N | N | N | N | N | N | N | +| 分区 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [Range 分区](/partitioned-table.md#range-分区) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Hash 分区](/partitioned-table.md#hash-分区) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Key 分区](/partitioned-table.md#key-分区) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [List 分区](/partitioned-table.md#list-分区) | Y | Y | Y | Y | Y | E | E | E | E | E | N | +| [List COLUMNS 分区](/partitioned-table.md#list-columns-分区) | Y | Y | Y | Y | Y | E | E | E | E | E | N | +| [List 和 List COLUMNS 分区表的默认分区](/partitioned-table.md#默认的-list-分区) | Y | N | N | N | N | N | N | N | N | N | N | +| [`EXCHANGE PARTITION`](/partitioned-table.md) | Y | Y | Y | Y | E | E | E | E | E | E | N | +| [`REORGANIZE PARTITION`](/partitioned-table.md#重组分区) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [`COALESCE PARTITION`](/partitioned-table.md#减少分区数量) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [动态裁剪](/partitioned-table.md#动态裁剪模式) | Y | Y | Y | Y | Y | E | E | E | E | N | N | +| [Range COLUMNS 分区](/partitioned-table.md#range-columns-分区) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [Range INTERVAL 分区](/partitioned-table.md#range-interval-分区) | Y | Y | Y | E | N | N | N | N | N | N | N | ## 统计信息 -| 统计信息 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [CM-Sketch](/statistics.md) | 默认关闭 | 默认关闭 | 默认关闭 | 默认关闭 | 默认关闭 | 默认关闭 | Y | Y | Y | Y | -| [直方图](/statistics.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| 扩展统计信息(多列) | E | E | E | E | E | E | E | E | E | N | -| 统计反馈 | N | N | N | 已废弃 | 已废弃 | E | E | E | E | E | -| [统计信息自动更新](/statistics.md#自动更新) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [快速分析](/system-variables.md#tidb_enable_fast_analyze) | E | E | E | E | E | E | E | E | E | E | -| [动态裁剪](/partitioned-table.md#动态裁剪模式) | Y | Y | Y | Y | E | E | E | E | N | N | -| [收集部分列的统计信息](/statistics.md#收集部分列的统计信息) | E | E | E | E | E | N | N | N | N | N | -| [限制统计信息的内存使用量](/statistics.md#统计信息收集的内存限制) | E | E | E | E | N | N | N | N | N | N | -| [随机采样约 10000 行数据来快速构建统计信息](/system-variables.md#tidb_enable_fast_analyze) | E | E | E | E | E | E | E | E | E | E | -| [锁定统计信息](/statistics.md#锁定统计信息) | E | E | E | N | N | N | N | N | N | N | -| [轻量级统计信息初始化](/statistics.md#统计信息的加载) | Y | E | N | N | N | N | N | N | N | N | +| 统计信息 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [CM-Sketch](/statistics.md) | 默认关闭 | 默认关闭 | 默认关闭 | 默认关闭 | 默认关闭 | 默认关闭 | 默认关闭 | Y | Y | Y | Y | +| [直方图](/statistics.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| 扩展统计信息(多列) | E | E | E | E | E | E | E | E | E | E | N | +| 统计反馈 | N | N | N | N | 已废弃 | 已废弃 | E | E | E | E | E | +| [统计信息自动更新](/statistics.md#自动更新) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [快速分析](/system-variables.md#tidb_enable_fast_analyze) | E | E | E | E | E | E | E | E | E | E | E | +| [动态裁剪](/partitioned-table.md#动态裁剪模式) | Y | Y | Y | Y | Y | E | E | E | E | N | N | +| [收集部分列的统计信息](/statistics.md#收集部分列的统计信息) | E | E | E | E | E | E | N | N | N | N | N | +| [限制统计信息的内存使用量](/statistics.md#统计信息收集的内存限制) | E | E | E | E | E | N | N | N | N | N | N | +| [随机采样约 10000 行数据来快速构建统计信息](/system-variables.md#tidb_enable_fast_analyze) | E | E | E | E | E | E | E | E | E | E | E | +| [锁定统计信息](/statistics.md#锁定统计信息) | E | E | E | E | N | N | N | N | N | N | N | +| [轻量级统计信息初始化](/statistics.md#统计信息的加载) | Y | Y | E | N | N | N | N | N | N | N | N | +| [显示统计信息收集的进度](/sql-statements/sql-statement-show-analyze-status.md) | Y | N | N | N | N | N | N | N | N | N | N | ## 安全 -| 安全 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [传输层加密 (TLS)](/enable-tls-between-clients-and-servers.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [静态加密 (TDE)](/encryption-at-rest.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [基于角色的访问控制 (RBAC)](/role-based-access-control.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [证书鉴权](/certificate-authentication.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [`caching_sha2_password` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | Y | Y | Y | Y | Y | N | N | N | -| [`tidb_sm3_password` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | Y | N | N | N | N | N | N | N | -| [`tidb_auth_token` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | Y | N | N | N | N | N | N | N | -| [`authentication_ldap_sasl` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | N | N | N | N | N | N | N | N | -| [`authentication_ldap_simple` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | N | N | N | N | N | N | N | N | -| [密码管理](/password-management.md) | Y | Y | Y | N | N | N | N | N | N | N | -| [与 MySQL 兼容的 `GRANT` 权限管理](/privilege-management.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [动态权限](/privilege-management.md#动态权限) | Y | Y | Y | Y | Y | Y | Y | Y | N | N | -| [安全增强模式](/system-variables.md#tidb_enable_enhanced_security) | Y | Y | Y | Y | Y | Y | Y | Y | N | N | -| [日志脱敏](/log-redaction.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | +| 安全 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [传输层加密 (TLS)](/enable-tls-between-clients-and-servers.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [静态加密 (TDE)](/encryption-at-rest.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [基于角色的访问控制 (RBAC)](/role-based-access-control.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [证书鉴权](/certificate-authentication.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [`caching_sha2_password` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | Y | Y | Y | Y | Y | Y | N | N | N | +| [`tidb_sm3_password` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [`tidb_auth_token` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [`authentication_ldap_sasl` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [`authentication_ldap_simple` 认证](/system-variables.md#default_authentication_plugin) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [密码管理](/password-management.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [与 MySQL 兼容的 `GRANT` 权限管理](/privilege-management.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [动态权限](/privilege-management.md#动态权限) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | +| [安全增强模式](/system-variables.md#tidb_enable_enhanced_security) | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | N | +| [日志脱敏](/log-redaction.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | ## 数据导入和导出 -| 数据导入和导出 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [快速导入 (TiDB Lightning)](/tidb-lightning/tidb-lightning-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [快速导入 (`IMPORT INTO`)](/sql-statements/sql-statement-import-into.md) | E | N | N | N | N | N | N | N | N | N | -| mydumper 逻辑导出 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | -| [Dumpling 逻辑导出](/dumpling-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [事务 `LOAD DATA`](/sql-statements/sql-statement-load-data.md) [^5] | Y | Y | Y | Y | Y | Y | Y | Y | Y | N [^6] | -| [数据迁移工具](/migration-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [TiDB Binlog](/tidb-binlog/tidb-binlog-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Change data capture (CDC)](/ticdc/ticdc-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [TiCDC 支持保存数据到存储服务 (Amazon S3/GCS/Azure Blob Storage/NFS)](/ticdc/ticdc-sink-to-cloud-storage.md) | Y | Y | E | N | N | N | N | N | N | N | -| [TiCDC 支持在两个 TiDB 集群之间进行双向复制](/ticdc/ticdc-bidirectional-replication.md) | Y | Y | Y | N | N | N | N | N | N | N | -| [TiCDC OpenAPI v2](/ticdc/ticdc-open-api-v2.md) | Y | Y | N | N | N | N | N | N | N | N | +| 数据导入和导出 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [快速导入 (TiDB Lightning)](/tidb-lightning/tidb-lightning-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [快速导入 (`IMPORT INTO`)](/sql-statements/sql-statement-import-into.md) | E | E | N | N | N | N | N | N | N | N | N | +| mydumper 逻辑导出 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | 已废弃 | +| [Dumpling 逻辑导出](/dumpling-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [事务 `LOAD DATA`](/sql-statements/sql-statement-load-data.md) [^5] | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N [^6] | +| [数据迁移工具](/migration-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [TiDB Binlog](/tidb-binlog/tidb-binlog-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Change data capture (CDC)](/ticdc/ticdc-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [TiCDC 支持保存数据到存储服务 (Amazon S3/GCS/Azure Blob Storage/NFS)](/ticdc/ticdc-sink-to-cloud-storage.md) | Y | Y | Y | E | N | N | N | N | N | N | N | +| [TiCDC 支持在两个 TiDB 集群之间进行双向复制](/ticdc/ticdc-bidirectional-replication.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [TiCDC OpenAPI v2](/ticdc/ticdc-open-api-v2.md) | Y | Y | Y | N | N | N | N | N | N | N | N | ## 管理,可视化和工具 -| 管理,可视化和工具 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | -|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| [TiDB Dashboard 图形化展示](/dashboard/dashboard-intro.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [TiDB Dashboard 持续性能分析功能](/dashboard/continuous-profiling.md) | Y | Y | Y | Y | E | E | N | N | N | N | -| [TiDB Dashboard Top SQL 功能](/dashboard/top-sql.md) | Y | Y | Y | Y | E | N | N | N | N | N | -| [TiDB Dashboard SQL 诊断功能](/information-schema/information-schema-sql-diagnostics.md) | Y | Y | Y | E | E | E | E | E | E | E | -| [TiDB Dashboard 集群诊断功能](/dashboard/dashboard-diagnostics-access.md) | Y | Y | Y | E | E | E | E | E | E | E | -| [Grafana 中的 TiKV-FastTune 面板](/grafana-tikv-dashboard.md#tikv-fasttune-面板) | E | E | E | E | E | E | E | E | E | E | -| [Information schema](/information-schema/information-schema.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Metrics schema](/metrics-schema.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Statements summary tables](/statement-summary-tables.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Statements summary tables - 持久化 statements summary](/statement-summary-tables.md#持久化-statements-summary) | E | E | N | N | N | N | N | N | N | N | -| [慢查询日志](/identify-slow-queries.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [TiUP 部署](/tiup/tiup-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Kubernetes operator](https://docs.pingcap.com/tidb-in-kubernetes/stable) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [内置物理备份](/br/backup-and-restore-use-cases.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [Global Kill](/sql-statements/sql-statement-kill.md) | Y | Y | Y | Y | E | E | E | E | E | E | -| [Lock View](/information-schema/information-schema-data-lock-waits.md) | Y | Y | Y | Y | Y | Y | Y | E | E | E | -| [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | -| [`SET CONFIG`](/dynamic-config.md) | Y | Y | Y | Y | E | E | E | E | E | E | -| [DM WebUI](/dm/dm-webui-guide.md) | E | E | E | E | N | N | N | N | N | N | -| [前台限流](/tikv-configuration-file.md#前台限流) | Y | Y | Y | E | N | N | N | N | N | N | -| [后台限流](/tikv-configuration-file.md#后台限流) | E | E | E | N | N | N | N | N | N | N | -| [基于 EBS 的备份和恢复](https://docs.pingcap.com/zh/tidb-in-kubernetes/v1.4/volume-snapshot-backup-restore) | Y | Y | Y | N | N | N | N | N | N | N | -| [PITR](/br/br-pitr-guide.md) | Y | Y | Y | N | N | N | N | N | N | N | -| [全局内存控制](/configure-memory-usage.md#如何配置-tidb-server-实例使用内存的阈值) | Y | Y | Y | N | N | N | N | N | N | N | -| [RawKV 跨集群复制](/tikv-configuration-file.md#api-version-从-v610-版本开始引入) | E | E | E | N | N | N | N | N | N | N | -| [Green GC](/system-variables.md#tidb_gc_scan_lock_mode-从-v50-版本开始引入) | E | E | E | E | E | E | E | E | E | N | -| [资源管控 (Resource Control)](/tidb-resource-control.md) | Y | Y | N | N | N | N | N | N | N | N | -| [Runaway Queries 自动管理](/tidb-resource-control.md#管理资源消耗超出预期的查询-runaway-queries) | E | N | N | N | N | N | N | N | N | N | -| [TiFlash 存算分离架构与 S3 支持](/tiflash/tiflash-disaggregated-and-s3.md) | E | E | N | N | N | N | N | N | N | N | +| 管理,可视化和工具 | 7.3 | 7.2 | 7.1 | 6.5 | 6.1 | 5.4 | 5.3 | 5.2 | 5.1 | 5.0 | 4.0 | +|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| [TiDB Dashboard 图形化展示](/dashboard/dashboard-intro.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [TiDB Dashboard 持续性能分析功能](/dashboard/continuous-profiling.md) | Y | Y | Y | Y | Y | E | E | N | N | N | N | +| [TiDB Dashboard Top SQL 功能](/dashboard/top-sql.md) | Y | Y | Y | Y | Y | E | N | N | N | N | N | +| [TiDB Dashboard SQL 诊断功能](/information-schema/information-schema-sql-diagnostics.md) | Y | Y | Y | Y | E | E | E | E | E | E | E | +| [TiDB Dashboard 集群诊断功能](/dashboard/dashboard-diagnostics-access.md) | Y | Y | Y | Y | E | E | E | E | E | E | E | +| [Grafana 中的 TiKV-FastTune 面板](/grafana-tikv-dashboard.md#tikv-fasttune-面板) | E | E | E | E | E | E | E | E | E | E | E | +| [Information schema](/information-schema/information-schema.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Metrics schema](/metrics-schema.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Statements summary tables](/statement-summary-tables.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Statements summary tables - 持久化 statements summary](/statement-summary-tables.md#持久化-statements-summary) | E | E | E | N | N | N | N | N | N | N | N | +| [慢查询日志](/identify-slow-queries.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [TiUP 部署](/tiup/tiup-overview.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Kubernetes operator](https://docs.pingcap.com/tidb-in-kubernetes/stable) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [内置物理备份](/br/backup-and-restore-use-cases.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [Global Kill](/sql-statements/sql-statement-kill.md) | Y | Y | Y | Y | Y | E | E | E | E | E | E | +| [Lock View](/information-schema/information-schema-data-lock-waits.md) | Y | Y | Y | Y | Y | Y | Y | Y | E | E | E | +| [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| [`SET CONFIG`](/dynamic-config.md) | Y | Y | Y | Y | Y | E | E | E | E | E | E | +| [DM WebUI](/dm/dm-webui-guide.md) | E | E | E | E | E | N | N | N | N | N | N | +| [前台限流](/tikv-configuration-file.md#前台限流) | Y | Y | Y | Y | E | N | N | N | N | N | N | +| [后台限流](/tikv-configuration-file.md#后台限流) | E | E | E | E | N | N | N | N | N | N | N | +| [基于 EBS 的备份和恢复](https://docs.pingcap.com/zh/tidb-in-kubernetes/v1.4/volume-snapshot-backup-restore) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [PITR](/br/br-pitr-guide.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [全局内存控制](/configure-memory-usage.md#如何配置-tidb-server-实例使用内存的阈值) | Y | Y | Y | Y | N | N | N | N | N | N | N | +| [RawKV 跨集群复制](/tikv-configuration-file.md#api-version-从-v610-版本开始引入) | E | E | E | E | N | N | N | N | N | N | N | +| [Green GC](/system-variables.md#tidb_gc_scan_lock_mode-从-v50-版本开始引入) | E | E | E | E | E | E | E | E | E | E | N | +| [资源管控 (Resource Control)](/tidb-resource-control.md) | Y | Y | Y | N | N | N | N | N | N | N | N | +| [Runaway Queries 自动管理](/tidb-resource-control.md#管理资源消耗超出预期的查询-runaway-queries) | E | E | N | N | N | N | N | N | N | N | N | +| [TiFlash 存算分离架构与 S3 支持](/tiflash/tiflash-disaggregated-and-s3.md) | E | E | E | N | N | N | N | N | N | N | N | [^1]: TiDB 误将 latin1 处理为 utf8 的子集。见 [TiDB #18955](https://github.com/pingcap/tidb/issues/18955)。 diff --git a/br/backup-and-restore-use-cases.md b/br/backup-and-restore-use-cases.md index 422549487649..b949cc4de939 100644 --- a/br/backup-and-restore-use-cases.md +++ b/br/backup-and-restore-use-cases.md @@ -17,7 +17,7 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-use-cases/','/docs-cn/dev/referenc ## 部署 TiDB 集群和 br 命令行工具 -使用 PITR 功能,需要部署 v6.2.0 或以上版本的 TiDB 集群,并且更新 br 命令行工具到与 TiDB 集群相同的版本,本文假设使用的是 v7.2.0 版本。 +使用 PITR 功能,需要部署 v6.2.0 或以上版本的 TiDB 集群,并且更新 br 命令行工具到与 TiDB 集群相同的版本,本文假设使用的是 v7.3.0 版本。 下表介绍了在 TiDB 集群中使用日志备份功能的推荐配置。 @@ -44,13 +44,13 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-use-cases/','/docs-cn/dev/referenc - 安装: ```shell - tiup install br:v7.2.0 + tiup install br:v7.3.0 ``` - 升级: ```shell - tiup update br:v7.2.0 + tiup update br:v7.3.0 ``` ## 配置备份存储 (Amazon S3) diff --git a/clinic/clinic-introduction.md b/clinic/clinic-introduction.md index febd3abe42e2..01fb338fc131 100644 --- a/clinic/clinic-introduction.md +++ b/clinic/clinic-introduction.md @@ -56,7 +56,7 @@ PingCAP Clinic 服务提供以下两个组件进行集群诊断: > **注意:** > -> - Clinic Server 诊断服务在 2022 年 7 月 15 日至 2023 年 7 月 14 日期间提供免费服务。后续如需收取相关费用,PingCAP Clinic 运营团队将在 2023 年 7 月 14 日前通过邮件通知用户。 +> - Clinic Server 诊断服务在 2022 年 7 月 15 日至 2024 年 7 月 14 日期间提供免费服务。后续如需收取相关费用,PingCAP Clinic 运营团队将在 2024 年 7 月 14 日前通过邮件通知用户。 > - 如果需要调整使用限制,可以[联系 PingCAP 技术支持](/support.md)。 | 诊断服务类型| 使用限制 | diff --git a/develop/dev-guide-sample-application-python-mysqlclient.md b/develop/dev-guide-sample-application-python-mysqlclient.md index 6665889c6b4a..7504b8a7e8f8 100644 --- a/develop/dev-guide-sample-application-python-mysqlclient.md +++ b/develop/dev-guide-sample-application-python-mysqlclient.md @@ -1,282 +1,236 @@ --- -title: TiDB 和 mysqlclient 的简单 CRUD 应用程序 -summary: 给出一个 TiDB 和 mysqlclient 的简单 CRUD 应用程序示例。 +title: 使用 mysqlclient 连接到 TiDB +summary: 本文描述了 TiDB 和 mysqlclient 的连接步骤,并给出了简单示例代码片段。 --- -# TiDB 和 mysqlclient 的简单 CRUD 应用程序 +# 如何用 mysqlclient 连接到 TiDB -[mysqlclient](https://pypi.org/project/mysqlclient/) 为当前比较流行的开源 Python Driver 之一。 +TiDB 是一个兼容 MySQL 的数据库。[mysqlclient](https://pypi.org/project/mysqlclient/) 为当前流行的开源 Python Driver 之一。 本文档将展示如何使用 TiDB 和 mysqlclient 来构造一个简单的 CRUD 应用程序。 -> **注意:** -> -> 推荐使用 Python 3.10 及以上版本进行 TiDB 的应用程序的编写。 +## 前置需求 -## 第 1 步:启动你的 TiDB 集群 +- 推荐 [Python **3.10**](https://www.python.org/downloads/) 及以上版本。 +- mysqlclient **2.1.1** 版本。在运行本教程的过程中会进行安装和配置,如果遇到安装问题,请参考 [mysqlclient 官方文档](https://github.com/PyMySQL/mysqlclient#install)。 +- [Git](https://git-scm.com/downloads)。 +- TiDB 集群。如果你还没有 TiDB 集群,可以按照以下方式创建: + - (推荐方式)参考[创建 TiDB Serverless 集群](/develop/dev-guide-build-cluster-in-cloud.md#第-1-步创建-tidb-serverless-集群),创建你自己的 TiDB Cloud 集群。 + - 参考[部署本地测试 TiDB 集群](/quick-start-with-tidb.md#部署本地测试集群)或[部署正式 TiDB 集群](/production-deployment-using-tiup.md),创建本地集群。 -本节将介绍 TiDB 集群的启动方法。 +## 运行代码并连接到 TiDB -**使用 TiDB Serverless 集群** +本小节演示如何运行示例应用程序的代码,并连接到 TiDB。 -详细步骤,请参考:[创建 TiDB Serverless 集群](/develop/dev-guide-build-cluster-in-cloud.md#第-1-步创建-tidb-serverless-集群)。 +### 第 1 步:克隆示例代码仓库到本地 -**使用本地集群** - -详细步骤,请参考:[部署本地测试 TiDB 集群](/quick-start-with-tidb.md#部署本地测试集群)或[部署正式 TiDB 集群](/production-deployment-using-tiup.md)。 - -## 第 2 步:获取代码 - -```shell +```bash git clone https://github.com/pingcap-inc/tidb-example-python.git ``` -此处将以 mysqlclient **2.1.1** 版本进行说明。虽然 Python 的 Driver 相较其他语言,使用也极其方便。但因其不可屏蔽底层实现,需手动管控事务的特性,如果没有大量必须使用 SQL 的场景,仍然推荐使用 ORM 进行程序编写。这可以降低程序的耦合性。 +### 第 2 步:安装依赖 (包括 mysqlclient) -```python -import uuid -from typing import List +```bash +cd tidb-example-python; +pip install -r requirement.txt +``` -import MySQLdb -from MySQLdb import Connection -from MySQLdb.cursors import Cursor +### 第 3 步:配置连接信息 -def get_connection(autocommit: bool = True) -> MySQLdb.Connection: - return MySQLdb.connect( - host="127.0.0.1", - port=4000, - user="root", - password="", - database="test", - autocommit=autocommit - ) +根据不同的 TiDB 部署方式,使用不同的方法连接到 TiDB 集群。 + -def create_player(cursor: Cursor, player: tuple) -> None: - cursor.execute("INSERT INTO player (id, coins, goods) VALUES (%s, %s, %s)", player) +
+1. 在 TiDB Cloud Web Console 中,选择你的 TiDB Serverless 集群,进入 **Overview** 页面,点击右上角的 **Connect** 按钮。 -def get_player(cursor: Cursor, player_id: str) -> tuple: - cursor.execute("SELECT id, coins, goods FROM player WHERE id = %s", (player_id,)) - return cursor.fetchone() +2. 确认窗口中的配置和你的运行环境一致。 + - Endpoint 为 **Public** + - Connect With 选择 **General** + - Operating System 为你的运行环境。 -def get_players_with_limit(cursor: Cursor, limit: int) -> List[tuple]: - cursor.execute("SELECT id, coins, goods FROM player LIMIT %s", (limit,)) - return cursor.fetchall() + 如果你在 Windows Subsystem for Linux (WSL) 中运行,请切换为对应的 Linux 发行版。 +3. 点击 **Generate Password** 生成密码。 + + 如果你之前已经生成过密码,可以直接使用原密码,或点击 **Reset Password** 重新生成密码。 -def random_player(amount: int) -> List[tuple]: - players = [] - for _ in range(amount): - players.append((uuid.uuid4(), 10000, 10000)) +4. 运行以下命令,将 `.env.example` 复制并重命名为 `.env`: - return players + ```bash + cp .env.example .env + ``` +5. 复制并粘贴对应连接字符串至 `.env` 中。示例结果如下。 -def bulk_create_player(cursor: Cursor, players: List[tuple]) -> None: - cursor.executemany("INSERT INTO player (id, coins, goods) VALUES (%s, %s, %s)", players) + ```python + TIDB_HOST='{gateway-region}.aws.tidbcloud.com' + TIDB_PORT='4000' + TIDB_USER='{prefix}.root' + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + CA_PATH='' + ``` + 注意替换 `{}` 中的占位符为 **Connect** 窗口中获得的值。 + + TiDB Serverless 要求使用 secure connection,由于 mysqlclient 的 `ssl_mode` 默认为 `PREFERRED`,所以不需要你手动指定 `CA_PATH`,设置为空即可。但如果你有特殊原因需要手动指定 `CA_PATH`,可以参考 [TiDB Cloud 文档](https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-clusters#root-certificate-default-path)获取不同操作系统下证书的路径。 -def get_count(cursor: Cursor) -> None: - cursor.execute("SELECT count(*) FROM player") - return cursor.fetchone()[0] +6. 保存文件。 +
-def trade_check(cursor: Cursor, sell_id: str, buy_id: str, amount: int, price: int) -> bool: - get_player_with_lock_sql = "SELECT coins, goods FROM player WHERE id = %s FOR UPDATE" +
- # sell player goods check - cursor.execute(get_player_with_lock_sql, (sell_id,)) - _, sell_goods = cursor.fetchone() - if sell_goods < amount: - print(f'sell player {sell_id} goods not enough') - return False +1. 在 TiDB Cloud Web Console 中,选择你的 TiDB Dedicated 集群,进入 **Overview** 页面,点击右上角的 **Connect** 按钮。点击 **Allow Access from Anywhere** 并点击 **Download TiDB cluster CA** 下载证书。 - # buy player coins check - cursor.execute(get_player_with_lock_sql, (buy_id,)) - buy_coins, _ = cursor.fetchone() - if buy_coins < price: - print(f'buy player {buy_id} coins not enough') - return False + + 更多配置细节,可参考 [TiDB Dedicated 标准连接教程](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。 -def trade_update(cursor: Cursor, sell_id: str, buy_id: str, amount: int, price: int) -> None: - update_player_sql = "UPDATE player set goods = goods + %s, coins = coins + %s WHERE id = %s" + - # deduct the goods of seller, and raise his/her the coins - cursor.execute(update_player_sql, (-amount, price, sell_id)) - # deduct the coins of buyer, and raise his/her the goods - cursor.execute(update_player_sql, (amount, -price, buy_id)) +2. 运行以下命令,将 `.env.example` 复制并重命名为 `.env`: + ```bash + cp .env.example .env + ``` -def trade(connection: Connection, sell_id: str, buy_id: str, amount: int, price: int) -> None: - with connection.cursor() as cursor: - if trade_check(cursor, sell_id, buy_id, amount, price) is False: - connection.rollback() - return +3. 复制并粘贴对应的连接字符串至 `.env` 中。示例结果如下: - try: - trade_update(cursor, sell_id, buy_id, amount, price) - except Exception as err: - connection.rollback() - print(f'something went wrong: {err}') - else: - connection.commit() - print("trade success") + ```python + TIDB_HOST='{host}.clusters.tidb-cloud.com' + TIDB_PORT='4000' + TIDB_USER='{username}' + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + CA_PATH='{your-downloaded-ca-path}' + ``` + 注意替换 `{}` 中的占位符为 **Connect** 窗口中获得的值,并配置前面步骤中下载好的证书路径。 -def simple_example() -> None: - with get_connection(autocommit=True) as conn: - with conn.cursor() as cur: - # create a player, who has a coin and a goods. - create_player(cur, ("test", 1, 1)) +4. 保存文件。 - # get this player, and print it. - test_player = get_player(cur, "test") - print(f'id:{test_player[0]}, coins:{test_player[1]}, goods:{test_player[2]}') +
- # create players with bulk inserts. - # insert 1919 players totally, with 114 players per batch. - # each player has a random UUID - player_list = random_player(1919) - for idx in range(0, len(player_list), 114): - bulk_create_player(cur, player_list[idx:idx + 114]) +
- # print the number of players - count = get_count(cur) - print(f'number of players: {count}') +1. 运行以下命令,将 `.env.example` 复制并重命名为 `.env`: - # print 3 players. - three_players = get_players_with_limit(cur, 3) - for player in three_players: - print(f'id:{player[0]}, coins:{player[1]}, goods:{player[2]}') + ```bash + cp .env.example .env + ``` +2. 复制并粘贴对应 TiDB 的连接字符串至 `.env` 中。示例结果如下。 -def trade_example() -> None: - with get_connection(autocommit=False) as conn: - with conn.cursor() as cur: - # create two players - # player 1: id is "1", has only 100 coins. - # player 2: id is "2", has 114514 coins, and 20 goods. - create_player(cur, ("1", 100, 0)) - create_player(cur, ("2", 114514, 20)) - conn.commit() + ```python + TIDB_HOST='{tidb_server_host}' + TIDB_PORT='4000' + TIDB_USER='root' + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + ``` - # player 1 wants to buy 10 goods from player 2. - # it will cost 500 coins, but player 1 cannot afford it. - # so this trade will fail, and nobody will lose their coins or goods - trade(conn, sell_id="2", buy_id="1", amount=10, price=500) + 注意替换 `{}` 中的占位符为你的 TiDB 对应的值,并删除 `CA_PATH` 这行。如果你在本机运行 TiDB,默认 Host 地址为 `127.0.0.1`,密码为空。 - # then player 1 has to reduce the incoming quantity to 2. - # this trade will be successful - trade(conn, sell_id="2", buy_id="1", amount=2, price=100) +3. 保存文件。 - # let's take a look for player 1 and player 2 currently - with conn.cursor() as cur: - _, player1_coin, player1_goods = get_player(cur, "1") - print(f'id:1, coins:{player1_coin}, goods:{player1_goods}') - _, player2_coin, player2_goods = get_player(cur, "2") - print(f'id:2, coins:{player2_coin}, goods:{player2_goods}') - - -simple_example() -trade_example() -``` +
-Driver 有着更低的封装程度,因此我们可以在程序内见到大量的 SQL。程序内查询到的 `Player`,与 ORM 不同,因为没有数据对象的存在,`Player` 将以元组 (tuple) 进行表示。 +
-关于 mysqlclient 的更多使用方法,你可以参考 [mysqlclient 官方文档](https://mysqlclient.readthedocs.io/)。 +### 第 4 步:运行代码并查看结果 -## 第 3 步:运行代码 +1. 运行下述命令,执行示例代码: -本节将逐步介绍代码的运行方法。 + ```python + python3 mysqlclient_example.py + ``` -### 第 3 步第 1 部分:表初始化 +2. 查看[示例输出](https://github.com/pingcap-inc/tidb-example-python/blob/main/Expected-Output.md#mysqlclient),并与你的程序输出进行比较。结果近似即为连接成功。 -本示例需手动初始化表,若你使用本地集群,可直接运行: +## 重点代码片段 - +你可参考以下关键代码片段,完成自己的应用开发。 -
+### 连接到 TiDB -```shell -mysql --host 127.0.0.1 --port 4000 -u root < player_init.sql +```python +def get_mysqlclient_connection(autocommit:bool=True) -> MySQLdb.Connection: + db_conf = { + "host": ${tidb_host}, + "port": ${tidb_port}, + "user": ${tidb_user}, + "password": ${tidb_password}, + "database": ${tidb_db_name}, + "autocommit": autocommit + } + + if ${ca_path}: + db_conf["ssl_mode"] = "VERIFY_IDENTITY" + db_conf["ssl"] = {"ca": ${ca_path}} + + return MySQLdb.connect(**db_conf) ``` -
+在使用该函数时,你需要将 `${tidb_host}`、`${tidb_port}`、`${tidb_user}`、`${tidb_password}`、`${tidb_db_name}` 等替换为你的 TiDB 集群的实际值。 -
+### 插入数据 -```shell -mycli --host 127.0.0.1 --port 4000 -u root --no-warn < player_init.sql +```python +with get_mysqlclient_connection(autocommit=True) as conn: + with conn.cursor() as cur: + player = ("1", 1, 1) + cursor.execute("INSERT INTO player (id, coins, goods) VALUES (%s, %s, %s)", player) ``` -
- -
- -若不使用本地集群,或未安装命令行客户端,请用喜欢的方式(如 Navicat、DBeaver 等 GUI 工具)直接登录集群,并运行 `player_init.sql` 文件内的 SQL 语句。 - -### 第 3 步第 2 部分:TiDB Cloud 更改参数 - -若你使用了 TiDB Serverless 集群,此处需使用系统本地的 CA 证书,并将证书路径记为 `` 以供后续指代。你可以参考 [Where is the CA root path on my system?](https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-tier-clusters#where-is-the-ca-root-path-on-my-system) 文档获取你所使用的操作系统的 CA 证书位置。 +更多信息参考[插入数据](/develop/dev-guide-insert-data.md)。 -若你使用 TiDB Serverless 集群,更改 `mysqlclient_example.py` 内 `get_connection` 函数: +### 查询数据 ```python -def get_connection(autocommit: bool = True) -> MySQLdb.Connection: - return MySQLdb.connect( - host="127.0.0.1", - port=4000, - user="root", - password="", - database="test", - autocommit=autocommit - ) +with get_mysqlclient_connection(autocommit=True) as conn: + with conn.cursor() as cur: + cur.execute("SELECT count(*) FROM player") + print(cur.fetchone()[0]) ``` -若你设定的密码为 `123456`,而且从 TiDB Serverless 集群面板中得到的连接信息为: +更多信息参考[查询数据](/develop/dev-guide-get-data-from-single-table.md)。 -- Endpoint: `xxx.tidbcloud.com` -- Port: `4000` -- User: `2aEp24QWEDLqRFs.root` - -那么此处应将 `get_connection` 更改为: +### 更新数据 ```python -def get_connection(autocommit: bool = True) -> MySQLdb.Connection: - return MySQLdb.connect( - host="xxx.tidbcloud.com", - port=4000, - user="2aEp24QWEDLqRFs.root", - password="123456", - database="test", - autocommit=autocommit, - ssl_mode="VERIFY_IDENTITY", - ssl={ - "ca": "" - } - ) +with get_mysqlclient_connection(autocommit=True) as conn: + with conn.cursor() as cur: + player_id, amount, price="1", 10, 500 + cursor.execute("UPDATE player SET goods = goods + %s, coins = coins + %s WHERE id = %s", (-amount, price, player_id)) ``` -### 第 3 步第 3 部分:运行 +更多信息参考[更新数据](/develop/dev-guide-update-data.md)。 -运行前请先安装依赖: +### 删除数据 -```bash -pip3 install -r requirement.txt +```python +with get_mysqlclient_connection(autocommit=True) as conn: + with conn.cursor() as cur: + player_id = "1" + cursor.execute("DELETE FROM player WHERE id = %s", (player_id,)) ``` -当以后需要多次运行脚本时,请在每次运行前先依照[表初始化](#第-3-步第-1-部分表初始化)一节再次进行表初始化。 +更多信息参考[删除数据](/develop/dev-guide-delete-data.md)。 -```bash -python3 mysqlclient_example.py -``` +## 注意事项 + +- 完整代码及其运行方式,见 [tidb-example-python](https://github.com/pingcap-inc/tidb-example-python/blob/main/README-zh.md) GitHub 仓库。 +- Driver 封装程度较低,因此在程序内会见到大量的 SQL 语句。与 ORM 不同,因为没有数据对象的存在,`mysqlclient` 的查询对象以元组 (tuple) 进行表示。虽然 Python 的 Driver 相较其他语言的使用更方便,但因其不可屏蔽底层实现,需手动管控事务的特性,如果没有大量必须使用 SQL 的场景,仍然推荐使用 ORM 进行程序编写。这可以降低程序的耦合性。 +- 关于 mysqlclient 的更多使用方法,可以参考 [mysqlclient 官方文档](https://mysqlclient.readthedocs.io/)。 -## 第 4 步:预期输出 +## 下一步 -[mysqlclient 预期输出](https://github.com/pingcap-inc/tidb-example-python/blob/main/Expected-Output.md#mysqlclient) +- 你可以继续阅读开发者文档,以获取更多关于 TiDB 的开发者知识。例如:[插入数据](/develop/dev-guide-insert-data.md),[更新数据](/develop/dev-guide-update-data.md),[删除数据](/develop/dev-guide-delete-data.md),[单表读取](/develop/dev-guide-get-data-from-single-table.md),[事务](/develop/dev-guide-transaction-overview.md),[SQL 性能优化](/develop/dev-guide-optimize-sql-overview.md)等。 +- 如果你更倾向于参与课程进行学习,我们也提供专业的 [TiDB 开发者课程](https://cn.pingcap.com/courses-catalog/back-end-developer/?utm_source=docs-cn-dev-guide)支持,并在考试后提供相应的[资格认证](https://learn.pingcap.com/learner/certification-center)。 diff --git a/dm/maintain-dm-using-tiup.md b/dm/maintain-dm-using-tiup.md index 10ba08e4ea51..ecd12c85f9db 100644 --- a/dm/maintain-dm-using-tiup.md +++ b/dm/maintain-dm-using-tiup.md @@ -390,7 +390,7 @@ tiup dmctl --master-addr master1:8261 operate-source create /tmp/source1.yml 此时可以通过命令行参数 `--native-ssh` 启用系统自带命令行: -- 部署集群:`tiup dm deploy --native-ssh`,其中 `` 为集群名称,`` 为 DM 集群版本(例如 `v7.2.0`),`` 为拓扑文件路径 +- 部署集群:`tiup dm deploy --native-ssh`,其中 `` 为集群名称,`` 为 DM 集群版本(例如 `v7.3.0`),`` 为拓扑文件路径 - 启动集群:`tiup dm start --native-ssh` - 升级集群:`tiup dm upgrade ... --native-ssh` diff --git a/dm/quick-start-create-task.md b/dm/quick-start-create-task.md index 578de1ebb54e..087ab480698f 100644 --- a/dm/quick-start-create-task.md +++ b/dm/quick-start-create-task.md @@ -69,7 +69,7 @@ docker run --rm --name mysql-3307 -p 3307:3307 -e MYSQL_ALLOW_EMPTY_PASSWORD=tru {{< copyable "shell-regular" >}} ```bash -wget https://download.pingcap.org/tidb-community-server-v7.2.0-linux-amd64.tar.gz +wget https://download.pingcap.org/tidb-community-server-v7.3.0-linux-amd64.tar.gz tar -xzvf tidb-latest-linux-amd64.tar.gz mv tidb-latest-linux-amd64/bin/tidb-server ./ ./tidb-server -P 4000 --store mocktikv --log-file "./tidb.log" & diff --git a/information-schema/information-schema-tidb-servers-info.md b/information-schema/information-schema-tidb-servers-info.md index 2f2ca5e1ea67..f31512ce7321 100644 --- a/information-schema/information-schema-tidb-servers-info.md +++ b/information-schema/information-schema-tidb-servers-info.md @@ -46,7 +46,7 @@ SELECT * FROM TIDB_SERVERS_INFO\G PORT: 4000 STATUS_PORT: 10080 LEASE: 45s - VERSION: 5.7.25-TiDB-v7.2.0 + VERSION: 5.7.25-TiDB-v7.3.0 GIT_HASH: 635a4362235e8a3c0043542e629532e3c7bb2756 BINLOG_STATUS: Off LABELS: diff --git a/pd-control.md b/pd-control.md index 703dcc7eb0b5..252489db4402 100644 --- a/pd-control.md +++ b/pd-control.md @@ -28,7 +28,7 @@ PD Control 是 PD 的命令行工具,用于获取集群状态信息和调整 > **注意:** > -> 下载链接中的 `{version}` 为 TiDB 的版本号。例如,amd64 架构的 `v7.2.0` 版本的下载链接为 `https://download.pingcap.org/tidb-community-server-v7.2.0-linux-amd64.tar.gz`。 +> 下载链接中的 `{version}` 为 TiDB 的版本号。例如,amd64 架构的 `v7.3.0` 版本的下载链接为 `https://download.pingcap.org/tidb-community-server-v7.3.0-linux-amd64.tar.gz`。 ### 源码编译 diff --git a/post-installation-check.md b/post-installation-check.md index 9a6b58fac88d..8f480aa7a376 100644 --- a/post-installation-check.md +++ b/post-installation-check.md @@ -63,7 +63,7 @@ mysql -u root -h ${tidb_server_host_IP_address} -P 4000 ```sql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 -Server version: 5.7.25-TiDB-v7.2.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible +Server version: 5.7.25-TiDB-v7.3.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. diff --git a/production-deployment-using-tiup.md b/production-deployment-using-tiup.md index 6a59dd75b0fe..37e500233aa4 100644 --- a/production-deployment-using-tiup.md +++ b/production-deployment-using-tiup.md @@ -341,13 +341,13 @@ alertmanager_servers: {{< copyable "shell-regular" >}} ```shell - tiup cluster deploy tidb-test v7.2.0 ./topology.yaml --user root [-p] [-i /home/root/.ssh/gcp_rsa] + tiup cluster deploy tidb-test v7.3.0 ./topology.yaml --user root [-p] [-i /home/root/.ssh/gcp_rsa] ``` 以上部署示例中: - `tidb-test` 为部署的集群名称。 -- `v7.2.0` 为部署的集群版本,可以通过执行 `tiup list tidb` 来查看 TiUP 支持的最新可用版本。 +- `v7.3.0` 为部署的集群版本,可以通过执行 `tiup list tidb` 来查看 TiUP 支持的最新可用版本。 - 初始化配置文件为 `topology.yaml`。 - `--user root` 表示通过 root 用户登录到目标主机完成集群部署,该用户需要有 ssh 到目标机器的权限,并且在目标机器有 sudo 权限。也可以用其他有 ssh 和 sudo 权限的用户完成部署。 - [-i] 及 [-p] 为可选项,如果已经配置免密登录目标机,则不需填写。否则选择其一即可,[-i] 为可登录到目标机的 root 用户(或 --user 指定的其他用户)的私钥,也可使用 [-p] 交互式输入该用户的密码。 diff --git a/quick-start-with-tidb.md b/quick-start-with-tidb.md index dd3fca7bd8ad..9208ead17dd9 100644 --- a/quick-start-with-tidb.md +++ b/quick-start-with-tidb.md @@ -81,10 +81,10 @@ TiDB 是一个分布式系统。最基础的 TiDB 测试集群通常由 2 个 Ti {{< copyable "shell-regular" >}} ```shell - tiup playground v7.2.0 --db 2 --pd 3 --kv 3 + tiup playground v7.3.0 --db 2 --pd 3 --kv 3 ``` - 上述命令会在本地下载并启动某个版本的集群(例如 v7.2.0)。最新版本可以通过执行 `tiup list tidb` 来查看。运行结果将显示集群的访问方式: + 上述命令会在本地下载并启动某个版本的集群(例如 v7.3.0)。最新版本可以通过执行 `tiup list tidb` 来查看。运行结果将显示集群的访问方式: ```log CLUSTER START SUCCESSFULLY, Enjoy it ^-^ @@ -198,10 +198,10 @@ TiDB 是一个分布式系统。最基础的 TiDB 测试集群通常由 2 个 Ti {{< copyable "shell-regular" >}} ```shell - tiup playground v7.2.0 --db 2 --pd 3 --kv 3 + tiup playground v7.3.0 --db 2 --pd 3 --kv 3 ``` - 上述命令会在本地下载并启动某个版本的集群(例如 v7.2.0)。最新版本可以通过执行 `tiup list tidb` 来查看。运行结果将显示集群的访问方式: + 上述命令会在本地下载并启动某个版本的集群(例如 v7.3.0)。最新版本可以通过执行 `tiup list tidb` 来查看。运行结果将显示集群的访问方式: ```log CLUSTER START SUCCESSFULLY, Enjoy it ^-^ @@ -432,7 +432,7 @@ TiDB 是一个分布式系统。最基础的 TiDB 测试集群通常由 2 个 Ti ``` - 参数 `` 表示设置集群名称 - - 参数 `` 表示设置集群版本,例如 `v7.2.0`。可以通过 `tiup list tidb` 命令来查看当前支持部署的 TiDB 版本 + - 参数 `` 表示设置集群版本,例如 `v7.3.0`。可以通过 `tiup list tidb` 命令来查看当前支持部署的 TiDB 版本 - 参数 `-p` 表示在连接目标机器时使用密码登录 > **注意:** diff --git a/releases/release-7.2.0.md b/releases/release-7.2.0.md index aa049790268e..2c627eae9ba8 100644 --- a/releases/release-7.2.0.md +++ b/releases/release-7.2.0.md @@ -9,7 +9,7 @@ summary: 了解 TiDB 7.2.0 版本的新功能、兼容性变更、改进提升 TiDB 版本:7.2.0 -试用链接:[快速体验](https://docs.pingcap.com/zh/tidb/v7.2/quick-start-with-tidb) | [下载离线包](https://cn.pingcap.com/product-community/) +试用链接:[快速体验](https://docs.pingcap.com/zh/tidb/v7.2/quick-start-with-tidb) | [下载离线包](https://cn.pingcap.com/product-community/?version=v7.2.0-DMR#version-list) 在 7.2.0 版本中,你可以获得以下关键特性: @@ -325,4 +325,4 @@ TiDB 版本:7.2.0 - [L-maple](https://github.com/L-maple) - [nyurik](https://github.com/nyurik) - [SeigeC](https://github.com/SeigeC) -- [tangjingyu97](https://github.com/tangjingyu97) \ No newline at end of file +- [tangjingyu97](https://github.com/tangjingyu97) diff --git a/releases/release-7.3.0.md b/releases/release-7.3.0.md new file mode 100644 index 000000000000..803435943971 --- /dev/null +++ b/releases/release-7.3.0.md @@ -0,0 +1,335 @@ +--- +title: TiDB 7.3.0 Release Notes +summary: 了解 TiDB 7.3.0 版本的新功能、兼容性变更、改进提升,以及错误修复。 +--- + +# TiDB 7.3.0 Release Notes + +发版日期:2023 年 8 月 14 日 + +TiDB 版本:7.3.0 + +试用链接:[快速体验](https://docs.pingcap.com/zh/tidb/v7.3/quick-start-with-tidb) | [下载离线包](https://cn.pingcap.com/product-community/) + +v7.3.0 引入了以下主要功能。[功能详情](#功能详情)中列出的部分功能旨在增强 TiDB 和 TiFlash 的查询稳定性,不直接面向用户,因此未包含在下表中。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
分类功能描述
可扩展性与性能TiDB Lightning 支持 Partitioned Raft KV(实验特性)TiDB Lightning 的数据导入服务支持新的 Partitioned Raft KV 架构,为 Partitioned Raft KV 在 TiDB 后续版本中 GA 做好准备。 +
稳定性与高可用TiDB Lightning 引入冲突数据的自动检测和处理机制TiDB Lightning 物理导入模式支持新版本的冲突检测机制,支持在遇到数据冲突时替换 (replace) 或忽略 (ignore) 冲突数据的语义。TiDB Lightning 会自动处理冲突数据,同时提高了冲突处理的性能。
手动标记资源使用超出预期的查询(实验特性)查询耗费的时间有时会超出预期。通过资源组新增的 Runaway Queries 监控列表,你可以设置降低 Runaway Queries 的优先级或终止查询,从而更有效地管理查询。该功能允许算子在资源组级别通过匹配 SQL 文本、SQL digest 或执行计划标记查询,并对这些查询进行处理,从而更好地控制非预期的大型查询可能对集群产生的影响。
SQL添加更多优化器提示,加强对算子的控制,提升查询稳定性新增优化器提示:NO_INDEX_JOIN()NO_MERGE_JOIN()NO_INDEX_MERGE_JOIN()NO_HASH_JOIN()NO_INDEX_HASH_JOIN()
数据库管理与可观测性显示统计信息收集的进度支持使用 SHOW ANALYZE STATUS 语句或通过 mysql.analyze_jobs 系统表查看 ANALYZE 任务的进度。
+ +## 功能详情 + +### 性能 + +* TiFlash 支持副本选择策略 [#44106](https://github.com/pingcap/tidb/issues/44106) @[XuHuaiyu](https://github.com/XuHuaiyu) + + 在 v7.3.0 之前,当 TiFlash 进行数据扫描和 MPP 计算时,会尽可能使用其所有节点的副本,以提供最强大的性能。从 v7.3.0 起,TiFlash 引入副本选择策略,该策略由系统变量 [`tiflash_replica_read`](/system-variables.md#tiflash_replica_read-从-v730-版本开始引入) 控制,可以根据节点的[区域属性](/schedule-replicas-by-topology-labels.md#设置-tidb-的-labels可选)选择特定的副本,调度部分节点进行数据扫描及 MPP 计算。 + + 当集群部署在多个机房且每个机房都拥有完整的 TiFlash 数据副本时,你可以设置该策略只选择使用当前机房的 TiFlash 副本,即只在当前机房的 TiFlash 节点中进行数据扫描和 MPP 计算,从而避免大量跨机房的网络数据传输。 + + 更多信息,请参考[用户文档](/system-variables.md#tiflash_replica_read-从-v730-版本开始引入)。 + +* TiFlash 支持节点内的 Runtime Filter [#40220](https://github.com/pingcap/tidb/issues/40220) @[elsa0520](https://github.com/elsa0520) + + Runtime Filter 是在查询规划阶段生成的一种**动态取值谓词**。在表连接的过程中,这些动态谓词能够有效过滤掉不满足连接条件的行,减少扫描时间和网络开销,提升表连接的效率。自 v7.3.0 起,TiFlash 支持节点内的 Runtime Filter,提升了数据分析类查询的整体性能,在部分 TPC-DS 数据集的查询中可达到 10% ~ 50% 的性能提升。 + + 该功能在 v7.3.0 默认关闭。要启用此功能,需将变量 [`tidb_runtime_filter_mode`](/system-variables.md#tidb_runtime_filter_mode-从-v720-版本开始引入) 设置为 `LOCAL`。 + + 更多信息,请参考[用户文档](/runtime-filter.md)。 + +* TiFlash 支持执行公共表表达式 (CTE)(实验特性)[#43333](https://github.com/pingcap/tidb/issues/43333) @[winoros](https://github.com/winoros) + + 在 v7.3.0 版本之前,TiFlash 的 MPP 引擎默认无法执行包含 CTE 的查询,你需要通过系统变量 [`tidb_opt_force_inline_cte`](/system-variables.md#tidb_opt_force_inline_cte-从-v630-版本开始引入) 强制 inline CTE,达到让查询尽可能在 MPP 框架下执行的效果。在 v7.3.0 中,TiFlash MPP 引擎支持执行包含 CTE 的查询,无需强制 inline CTE 也可以尽可能地在 MPP 框架中执行查询。在 TPC-DS 基准测试中,与强制 inline 的执行方式相比,该功能可以将包含 CTE 的查询的总执行速度提升 20%。 + + 该功能为实验特性,默认关闭,由变量 [`tidb_opt_enable_mpp_shared_cte_execution`](/system-variables.md#tidb_opt_enable_mpp_shared_cte_execution-从-v720-版本开始引入) 控制。 + +### 稳定性 + +* 新增部分优化器提示 [#45520](https://github.com/pingcap/tidb/issues/45520) @[qw4990](https://github.com/qw4990) + + TiDB 在 v7.3.0 新增了几个优化器提示,用来控制表之间的连接方式,包括: + + - [`NO_MERGE_JOIN()`](/optimizer-hints.md#no_merge_joint1_name--tl_name-) 选择除 Merge Join 以外的连接方式。 + - [`NO_INDEX_JOIN()`](/optimizer-hints.md#no_index_joint1_name--tl_name-) 选择除 Index Nested Loop Join 以外的连接方式。 + - [`NO_INDEX_MERGE_JOIN()`](/optimizer-hints.md#no_index_merge_joint1_name--tl_name-) 选择除 Index Nested Loop Merge Join 以外的连接方式。 + - [`NO_HASH_JOIN()`](/optimizer-hints.md#no_hash_joint1_name--tl_name-) 选择哈希连接以外的连接方式。 + - [`NO_INDEX_HASH_JOIN()`](/optimizer-hints.md#no_index_hash_joint1_name--tl_name-) 选择除 [Index Nested Loop Hash Join](/optimizer-hints.md#inl_hash_join) 以外的连接方式。 + + 更多信息,请参考[用户文档](/optimizer-hints.md)。 + +* 手动标记资源使用超出预期的查询(实验特性)[#43691](https://github.com/pingcap/tidb/issues/43691) @[Connor1996](https://github.com/Connor1996) @[CabinfeverB](https://github.com/CabinfeverB) + + 在 v7.2.0 中,TiDB 自动管理资源使用超出预期的查询 (Runaway Query),即自动降级或取消运行时间超出预期的查询。在实际运行时,只依靠规则无法覆盖所有情况。因此,TiDB v7.3.0 新增手动标记查询的功能。利用新增的命令 [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md),你可以根据 SQL 的文本、SQL Digest 或执行计划标记查询,命中的查询可以被降级或取消。 + + 手动标记 Runaway Query 的功能为数据库中突发的性能问题提供了有效的干预手段。针对由查询引发的性能问题,在定位根本原因之前,该功能可以快速缓解其对整体性能的影响,从而提升系统服务质量。 + + 更多信息,请参考[用户文档](/tidb-resource-control.md#query-watch-语句说明)。 + +### SQL 功能 + +* List 和 List COLUMNS 分区表支持默认分区 [#20679](https://github.com/pingcap/tidb/issues/20679) @[mjonss](https://github.com/mjonss) @[bb7133](https://github.com/bb7133) + + 在 v7.3.0 以前,当使用 `INSERT` 语句向 List 或 List COLUMNS 分区表插入数据时,这些数据需要满足分区表指定的分区条件。如果要插入的数据不匹配任何分区条件,该语句将执行失败或忽略不符合分区条件的数据。 + + 在 v7.3.0 中,List 和 List COLUMNS 分区表支持默认分区功能。在创建默认分区后,如果要插入的数据不匹配任何分区条件,则数据将被写入默认分区。默认分区功能可以提升 List 分区和 List COLUMNS 分区的使用便捷性,避免不符合分区条件的数据导致 `INSERT` 语句执行失败或者数据被忽略。 + + 需要注意的是,该功能是 TiDB 对 MySQL 语法的扩展。创建默认分区后,该分区表的数据无法直接同步到 MySQL 中。 + + 更多信息,请参考[用户文档](/partitioned-table.md#list-分区)。 + +### 可观测性 + +* 显示统计信息收集的进度 [#44033](https://github.com/pingcap/tidb/issues/44033) @[hawkingrei](https://github.com/hawkingrei) + + 收集大表的统计信息经常会持续较长时间。在之前的版本中,无法了解统计信息收集的进度,进而无法预测完成时间。TiDB v7.3.0 新增显示统计信息收集进度的功能。你可以通过系统表 `mysql.analyze_jobs` 或者 `SHOW ANALYZE STATUS` 查看各个子任务的总体工作量、当前进度以及预计的完成时间。在大规模数据导入、SQL 性能优化等场景下,该功能有助于了解整体任务进度,提升用户体验。 + + 更多信息,请参考[用户文档](/sql-statements/sql-statement-show-analyze-status.md)。 + +* Plan Replayer 支持导出历史统计信息 [#45038](https://github.com/pingcap/tidb/issues/45038) @[time-and-fate](https://github.com/time-and-fate) + + 自 v7.3.0 起,通过新增的 [`dump with stats as of timestamp`](/sql-plan-replayer.md) 子句,你可以使用 Plan Replayer 导出指定 SQL 相关对象在指定时间点的统计信息。在执行计划问题的诊断过程中,通过对历史统计信息的准确抓取,能够更精确地分析出执行计划在问题发生的时间点是如何生成的,从而找到问题的根本原因,大大提升执行计划问题的诊断效率。 + + 更多信息,请参考[用户文档](/sql-plan-replayer.md)。 + +### 数据迁移 + +* TiDB Lightning 引入新版冲突数据检测和处理机制 [#41629](https://github.com/pingcap/tidb/issues/41629) @[lance6716](https://github.com/lance6716) + + 在之前的版本中,TiDB Lightning 的逻辑导入模式和物理导入模式各自使用独立的冲突检测和处理方式,其配置较为复杂且不易理解。另外,在物理导入模式下,无法通过替换 (`replace`) 或忽略 (`ignore`) 策略处理冲突的数据。从 v7.3.0 开始,TiDB Lightning 引入新版冲突检测和处理机制,逻辑导入模式和物理导入模式都使用相同的冲突检测和处理方式,即可以选择在遇到冲突数据时报错 (`error`)、替换 (`replace`) 或忽略 (`ignore`)。同时还支持设置冲突记录的上限,例如在处理指定数量冲突记录后任务中断退出,也可以记录哪些数据发生了冲突,以便后续排查。 + + 当导入数据存在大量冲突时,推荐使用新版冲突检测和处理机制,以获得更好的性能。在实验环境下,相比旧版,新版机制最高可将冲突检测和处理的性能提升 3 倍。该性能数据仅供参考,实际性能会受到环境配置、表结构、冲突数据的占比等因素影响。注意新版和旧版冲突处理机制不能同时使用。未来将废弃旧版冲突检测和处理机制。 + + 更多信息,请参考[用户文档](/tidb-lightning/tidb-lightning-physical-import-mode-usage.md#冲突数据检测)。 + +* TiDB Lightning 支持 Partitioned Raft KV(实验特性)[#14916](https://github.com/tikv/tikv/issues/14916) @[GMHDBJD](https://github.com/GMHDBJD) + + TiDB Lightning 支持 Partitioned Raft KV,该功能可以提升 TiDB Lightning 导入数据的性能。 + +* TiDB Lightning 引入新的参数 `enable-diagnose-log` 用于打印更多的诊断日志,方便定位问题 [#45497](https://github.com/pingcap/tidb/issues/45497) @[D3Hunter](https://github.com/D3Hunter) + + 默认情况下,该功能未启用,即只打印包含 `lightning/main` 的日志。开启该功能后,将打印所有包(包括 `client-go` 和 `tidb`)的日志,以帮助诊断与 `client-go` 和 `tidb` 相关的问题。 + + 更多信息,请参考[用户文档](/tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-全局配置)。 + +## 兼容性变更 + +> **注意:** +> +> 以下为从 v7.2.0 升级至当前版本 (v7.3.0) 所需兼容性变更信息。如果从 v7.1.0 或之前版本升级到当前版本,可能也需要考虑和查看中间版本 release notes 中提到的兼容性变更信息。 + +### 行为变更 + +* Backup & Restore (BR) + + - 全量恢复前增加了空集群检查,默认不支持恢复到非空集群。如果强制恢复,可以使用 `--filter` 指定对应表名。 + +* TiDB Lightning + + - 废弃 `tikv-importer.on-duplicate`,由 [`conflict.strategy`](/tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-任务配置) 替代。 + - TiDB Lightning 停止迁移任务之前能容忍的最大非严重 (non-fatal errors) 错误数的配置项 `max-error` 不再包含导入数据冲突记录的上限,由 [`conflict.threshold`](/tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-任务配置) 控制可容忍的最大冲突的记录数。 + +* TiCDC + + - 当 Kafka sink 使用 Avro 协议时,如果开启了 `force-replicate` 参数,创建 changefeed 会报错。 + - 由于 `delete-only-output-handle-key-columns` 和 `force-replicate` 参数不兼容,同时开启两个参数时,创建 changefeed 会报错。 + - 当使用 Open Protocol 作为输出协议时,`UPDATE` 类型的事件将仅输出变更的列。 + +### 系统变量 + +| 变量名 | 修改类型 | 描述 | +|---|----|------| +| [`tidb_opt_enable_mpp_shared_cte_execution`](/system-variables.md#tidb_opt_enable_mpp_shared_cte_execution-从-v720-版本开始引入) | 修改 | 该变量从 v7.3.0 开始生效,用于控制非递归的公共表表达式 (CTE) 是否可以在 TiFlash MPP 执行。 | +| [`tidb_lock_unchanged_keys`](/system-variables.md#tidb_lock_unchanged_keys-从-v711-和-v730-版本开始引入) | 新增 | 用于控制部分场景下,对于事务中涉及但并未修改值的 key 是否进行上锁。 | +| [`tidb_opt_enable_non_eval_scalar_subquery`](/system-variables.md#tidb_opt_enable_non_eval_scalar_subquery-从-v730-版本开始引入) | 新增 | 这个变量用于控制 `EXPLAIN` 语句是否禁止提前执行可以在优化阶段展开的常量子查询。 | +| [`tidb_skip_missing_partition_stats`](/system-variables.md#tidb_skip_missing_partition_stats-从-v730-版本开始引入) | 新增 | 这个变量用于控制当分区统计信息缺失时生成 GlobalStats 的行为。 | +| [`tiflash_replica_read`](/system-variables.md#tiflash_replica_read-从-v730-版本开始引入) | 新增 | 这个变量用于设置当查询需要使用 TiFlash 引擎时,TiFlash 副本的选择策略。 | + +### 配置文件参数 + +| 配置文件 | 配置项 | 修改类型 | 描述 | +| -------- | -------- | -------- | -------- | +| TiDB | [`enable-32bits-connection-id`](/tidb-configuration-file.md#enable-32bits-connection-id-从-v730-版本开始引入) | 新增 | 这个变量用于控制是否开启生成 32 位 connection ID 的功能。 | +| TiDB | [`in-mem-slow-query-recent-num`](/tidb-configuration-file.md#in-mem-slow-query-recent-num-从-v730-版本开始引入) | 新增 | 这个变量用于控制缓存在内存中的最近使用的 slow query 个数。 | +| TiDB | [`in-mem-slow-query-topn-num`](/tidb-configuration-file.md#in-mem-slow-query-topn-num-从-v730-版本开始引入) | 新增 | 这个变量用于控制缓存在内存中的最慢的 slow query 个数。 | +| TiKV | [`coprocessor.region-bucket-size`](/tikv-configuration-file.md#region-bucket-size-从-v610-版本开始引入) | 修改 | 为降低客户端超时的可能性,默认值从 `96MiB` 修改为 `50MiB`。 | +| TiKV | [`raft-engine.format-version`](/tikv-configuration-file.md#format-version-从-v630-版本开始引入) | 修改 | 当使用 Partitioned Raft KV (`storage.engine="partitioned-raft-kv"`) 时,会引入 Ribbon filter,因此将默认值从 `2` 修改为 `5`。 | +| TiKV | [`raftdb.max-total-wal-size`](/tikv-configuration-file.md#max-total-wal-size-1) | 修改 | 当使用 Partitioned Raft KV (`storage.engine="partitioned-raft-kv"`) 时,TiKV 会跳过写 WAL,因此默认值从 `"4GB"` 修改为 `1`,即禁用 WAL。 | +| TiKV | [rocksdb.\[defaultcf\|writecf\|lockcf\].compaction-guard-min-output-file-size](/tikv-configuration-file.md#compaction-guard-min-output-file-size) | 修改 | 为解决大数据写入情况下 compaction 速度跟不上写入速度的问题,默认值从 `"1MB"` 修改为 `"8MB"`。 | +| TiKV | [rocksdb.\[defaultcf\|writecf\|lockcf\].format-version](/tikv-configuration-file.md#format-version-从-v620-版本开始引入) | 修改 | 当使用 Partitioned Raft KV (`storage.engine="partitioned-raft-kv"`) 时,会引入 Ribbon filter,因此将默认值从 `2` 修改为 `5`。 | +| TiKV | [`rocksdb.lockcf.write-buffer-size`](/tikv-configuration-file.md#write-buffer-size) | 修改 | 当使用 Partitioned Raft KV (`storage.engine="partitioned-raft-kv"`) 时,为加快 lockcf 上 compaction 的速度,默认值从 `"32MB"` 修改为 `"4MB"`。 | +| TiKV | [`rocksdb.max-total-wal-size`](/tikv-configuration-file.md#max-total-wal-size) | 修改 | 当使用 Partitioned Raft KV (`storage.engine="partitioned-raft-kv"`) 时,TiKV 会跳过写 WAL,因此默认值从 `"4GB"` 修改为 `1`,即禁用 WAL。 | +| TiKV | [`rocksdb.stats-dump-period`](/tikv-configuration-file.md#stats-dump-period) | 修改 | 当使用 Partitioned Raft KV (`storage.engine="partitioned-raft-kv"`) 时,为关闭冗余日志的打印,默认值从 `"10m"` 修改为 `"0"`。| +| TiKV | [`rocksdb.write-buffer-limit`](/tikv-configuration-file.md#write-buffer-limit-从-v660-版本开始引入) | 修改 | 为减小 memtable 的内存开销,当 `storage.engine="raft-kv"` 时,默认值从本机内存的 25% 修改为 `0`,即不限制。当使用 Partitioned Raft KV (`storage.engine="partitioned-raft-kv"`) 时,默认值从本机内存的 25% 修改为本机内存的 20%。 | +| TiKV | [`storage.block-cache.capacity`](/tikv-configuration-file.md#capacity) | 修改 | 当使用 Partitioned Raft KV (`storage.engine="partitioned-raft-kv"`) 时,为弥补 memtable 的内存开销,将默认值从系统总内存大小的 45% 修改为系统总内存大小的 30%。 | +| TiFlash | [`storage.format_version`](/tiflash/tiflash-configuration.md) | 修改 | 引入新的 DTFile 储存文件格式 `format_version = 5`,该格式可以合并小文件从而减少物理文件数量。注意该格式目前为实验特性,默认未启用。 | +| TiDB Lightning | `tikv-importer.incremental-import` | 删除 | TiDB Lightning 并行导入参数。因为该参数名容易被误认为是增量导入的参数,因此更名为 `tikv-importer.parallel-import`。如果用户传入旧的参数名,会被自动转成新的参数名。| +|TiDB Lightning | `tikv-importer.on-duplicate` | 废弃 | TiDB Lightning 逻辑导入模式插入冲突数据时执行的操作。从 v7.3.0 起,该参数由 [`conflict.strategy`](/tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-任务配置) 取代。| +| TiDB Lightning | [`conflict.max-record-rows`](/tidb-lightning/tidb-lightning-configuration.md) | 新增 | TiDB Lightning 新版冲突检测与处理策略,用于记录在数据导入过程中遇到的冲突记录,并允许设置最大上限,默认值为 `100`。 | +| TiDB Lightning | [`conflict.strategy`](/tidb-lightning/tidb-lightning-configuration.md) | 新增 | TiDB Lightning 新版冲突检测与处理的策略,包含 `""`(不做冲突检测),`"error"`(遇到冲突数据即报错并停止导入),`"replace"`(遇到冲突记录替换已有的冲突记录),`"ignore"`(遇到冲突记录忽略需要插入的该条冲突记录)四种策略。默认值为 `""`,即不做冲突检测。 | +| TiDB Lightning | [`conflict.threshold`](/tidb-lightning/tidb-lightning-configuration.md) | 新增 |TiDB Lightning 新版冲突检测与处理策略允许的冲突上限,`conflict.strategy="error"` 时默认值为 `0`,当 `conflict.strategy="replace"` 或 `conflict.strategy="ignore"` 时默认值为 maxint。 | +| TiDB Lightning | [`enable-diagnose-logs`](/tidb-lightning/tidb-lightning-configuration.md) | 新增 | 是否开启诊断日志。默认为 `false`,即只输出和导入有关的日志,不会输出依赖的其他组件的日志。设置为 `true` 后,既输出和导入相关的日志,也输出依赖的其他组件的日志,并开启 GRPC debug,可用于问题诊断。 | +| TiDB Lightning | [`tikv-importer.parallel-import`](/tidb-lightning/tidb-lightning-configuration.md) | 新增 | TiDB Lightning 并行导入参数。用于替代原有的 `tikv-importer.incremental-import` 参数,因为原有参数会被误认为是增量导入的参数而误用。 | +| BR | `azblob.encryption-key` | 新增 |BR 为外部存储 Azure Blob Storage 提供加密密钥支持 | +| BR | `azblob.encryption-scope` | 新增 |BR 为外部存储 Azure Blob Storage 提供加密范围支持 | +| TiCDC | [`large-message-handle-option`](/ticdc/ticdc-sink-to-kafka.md#处理超过-kafka-topic-限制的消息) | 新增 | 默认为空,即消息大小超过 Kafka Topic 的限制后,同步任务失败。设置为 "handle-key-only" 时,如果消息超过大小,只发送 handle key 以减少消息的大小;如果依旧超过大小,则同步任务失败。 | +| TiCDC | [`sink.csv.binary-encoding-method`](/ticdc/ticdc-changefeed-config.md#ticdc-changefeed-配置文件说明) | 新增 | CSV 协议中二进制类型数据的编码方式,可选 `'base64'` 与 `'hex'`。默认值为 `'base64'`。 | + +### 系统表 + +- 新增系统表 `mysql.tidb_timers` 用来存储系统内部定时器的元信息。 + +## 废弃功能 + +* TiDB + + - 统计信息的[快速分析](/system-variables.md#tidb_enable_fast_analyze)(实验特性)计划在 v7.5.0 中废弃。 + - 统计信息的[增量收集](/statistics.md#增量收集)(实验特性)计划在 v7.5.0 中废弃。 + +## 改进提升 + ++ TiDB + + - 新增 [`tidb_opt_enable_non_eval_scalar_subquery`](/system-variables.md#tidb_opt_enable_non_eval_scalar_subquery-从-v730-版本开始引入) 系统变量用于控制 `EXPLAIN` 语句是否在优化阶段提前执行子查询 [#22076](https://github.com/pingcap/tidb/issues/22076) @[winoros](https://github.com/winoros) + - 在启用 [Global Kill](/tidb-configuration-file.md#enable-global-kill-从-v610-版本开始引入) 的情况下,可以通过 Control+C 终止当前会话 [#8854](https://github.com/pingcap/tidb/issues/8854) @[pingyu](https://github.com/pingyu) + - 支持锁函数 `IS_FREE_LOCK()` 和 `IS_USED_LOCK()` [#44493](https://github.com/pingcap/tidb/issues/44493) @[dveeden](https://github.com/dveeden) + - 优化与落盘相关的 chunk 读取的性能 [#45125](https://github.com/pingcap/tidb/issues/45125) @[YangKeao](https://github.com/YangKeao) + - 以 Optimizer Fix Controls 的方式改进了 Index Join 内表的高估问题 [#44855](https://github.com/pingcap/tidb/issues/44855) @[time-and-fate](https://github.com/time-and-fate) + ++ TiKV + + - 添加 `Max gap of safe-ts` 和 `Min safe ts region` 监控项以及 `tikv-ctl get_region_read_progress` 命令,用于更好地观测和诊断 resolved-ts 和 safe-ts 的状态 [#15082](https://github.com/tikv/tikv/issues/15082) @[ekexium](https://github.com/ekexium) + ++ PD + + - 未开启 Swagger server 时,PD 默认屏蔽 Swagger API [#6786](https://github.com/tikv/pd/issues/6786) @[bufferflies](https://github.com/bufferflies) + - 提升 etcd 的高可用性 [#6554](https://github.com/tikv/pd/issues/6554) [#6442](https://github.com/tikv/pd/issues/6442) @[lhy1024](https://github.com/lhy1024) + - 减少 `GetRegions` 请求的内存占用 [#6835](https://github.com/tikv/pd/issues/6835) @[lhy1024](https://github.com/lhy1024) + ++ TiFlash + + - 支持新的 DTFile 格式版本 [`storage.format_version = 5`](/tiflash/tiflash-configuration.md),可以合并小文件从而减少物理文件数量(实验特性) [#7595](https://github.com/pingcap/tiflash/issues/7595) @[hongyunyan](https://github.com/hongyunyan) + ++ Tools + + + Backup & Restore (BR) + + - 使用 BR 备份数据到 Azure Blob Storage 时,支持使用加密范围或加密密钥对数据进行服务端加密 [#45025](https://github.com/pingcap/tidb/issues/45025) @[Leavrth](https://github.com/Leavrth) + + + TiCDC + + - 优化了 Open Protocol 输出的消息大小,在发送 `UPDATE` 类型事件时仅输出被更新的列值 [#9336](https://github.com/pingcap/tiflow/issues/9336) @[3AceShowHand](https://github.com/3AceShowHand) + - Storage Sink 支持对 HEX 格式的数据进行十六进制编码输出,使其兼容 AWS DMS 的格式规范 [#9373](https://github.com/pingcap/tiflow/issues/9373) @[CharlesCheung96](https://github.com/CharlesCheung96) + - Kafka Sink 支持在消息过大时[只发送 Handle Key 数据](/ticdc/ticdc-sink-to-kafka.md#处理超过-kafka-topic-限制的消息),减少数据大小 [#9382](https://github.com/pingcap/tiflow/issues/9382) @[3AceShowHand](https://github.com/3AceShowHand) + +## 错误修复 + ++ TiDB + + - 修复当使用 MySQL 的 Cursor Fetch 协议时,结果集占用的内存超过 `tidb_mem_quota_query` 的限制导致 TiDB OOM 的问题。修复后,TiDB 会自动将结果集写入磁盘以释放内存资源 [#43233](https://github.com/pingcap/tidb/issues/43233) @[YangKeao](https://github.com/YangKeao) + - 修复数据争用导致 TiDB panic 的问题 [#45561](https://github.com/pingcap/tidb/issues/45561) @[genliqi](https://github.com/gengliqi) + - 修复带 `indexMerge` 的查询被 kill 时可能会卡住的问题 [#45279](https://github.com/pingcap/tidb/issues/45279) @[xzhangxian1008](https://github.com/xzhangxian1008) + - 修复当开启 `tidb_enable_parallel_apply` 时,MPP 模式下的查询结果出错的问题 [#45299](https://github.com/pingcap/tidb/issues/45299) @[windtalker](https://github.com/windtalker) + - 修复 resolve lock 在 PD 时间跳变的情况下可能卡住的问题 [#44822](https://github.com/pingcap/tidb/issues/44822) @[zyguan](https://github.com/zyguan) + - 修复 GC resolve lock 可能错过一些悲观锁的问题 [#45134](https://github.com/pingcap/tidb/issues/45134) @[MyonKeminta](https://github.com/MyonKeminta) + - 修复动态裁剪模式下使用了排序的查询返回结果错误的问题 [#45007](https://github.com/pingcap/tidb/issues/45007) @[Defined2014](https://github.com/Defined2014) + - 修复 `AUTO_INCREMENT` 与列的默认值 `DEFAULT` 可以指定在同一列上的问题 [#45136](https://github.com/pingcap/tidb/issues/45136) @[Defined2014](https://github.com/Defined2014) + - 修复某些情况下查询系统表 `INFORMATION_SCHEMA.TIKV_REGION_STATUS` 返回结果错误的问题 [#45531](https://github.com/pingcap/tidb/issues/45531) @[Defined2014](https://github.com/Defined2014) + - 修复某些情况下分区表分区裁剪不正确的问题 [#42273](https://github.com/pingcap/tidb/issues/42273) @[jiyfhust](https://github.com/jiyfhust) + - 修复 `TRUNCATE` 分区表的某个分区时,全局索引无法清除的问题 [#42435](https://github.com/pingcap/tidb/issues/42435) @[L-maple](https://github.com/L-maple) + - 修复在 TiDB 节点故障后其它 TiDB 节点没有接管 TTL 任务的问题 [#45022](https://github.com/pingcap/tidb/issues/45022) @[lcwangchao](https://github.com/lcwangchao) + - 修复 TTL 运行过程中内存泄漏的问题 [#45510](https://github.com/pingcap/tidb/issues/45510) @[lcwangchao](https://github.com/lcwangchao) + - 修复向分区表插入数据时某些报错信息不准确的问题 [#44966](https://github.com/pingcap/tidb/issues/44966) @[lilinghai](https://github.com/lilinghai) + - 修复 `INFORMATION_SCHEMA.TIFLASH_REPLICA` 表的读取权限有误的问题 [#7795](https://github.com/pingcap/tiflash/issues/7795) @[Lloyd-Pottiger](https://github.com/Lloyd-Pottiger) + - 修复使用错误分区表名时报错的问题 [#44967](https://github.com/pingcap/tidb/issues/44967) @[River2000i](https://github.com/River2000i) + - 修复某些情况下启用 `tidb_enable_dist_task` 时,创建索引卡住的问题 [#44440](https://github.com/pingcap/tidb/issues/44440) @[tangenta](https://github.com/tangenta) + - 修复通过 BR 恢复 `AUTO_ID_CACHE=1` 的表时,会遇到 `duplicate entry` 报错的问题 [#44716](https://github.com/pingcap/tidb/issues/44716) @[tiancaiamao](https://github.com/tiancaiamao) + - 修复执行 `TRUNCATE TABLE` 消耗的时间和 `ADMIN SHOW DDL JOBS` 显示的任务执行时间不一致的问题 [#44785](https://github.com/pingcap/tidb/issues/44785) @[tangenta](https://github.com/tangenta) + - 修复读取元数据时间超过一个 DDL lease 导致升级 TiDB 卡住的问题 [#45176](https://github.com/pingcap/tidb/issues/45176) @[zimulala](https://github.com/zimulala) + - 修复 `SELECT CAST(n AS CHAR)` 语句中的 `n` 为负数时,查询结果出错的问题 [#44786](https://github.com/pingcap/tidb/issues/44786) @[xhebox](https://github.com/xhebox) + - 修复开启 `tidb_opt_agg_push_down` 时查询可能返回错误结果的问题 [#44795](https://github.com/pingcap/tidb/issues/44795) @[AilinKid](https://github.com/AilinKid) + - 修复带有 `current_date()` 的查询使用 Plan Cache 导致结果错误的问题 [#45086](https://github.com/pingcap/tidb/issues/45086) @[qw4990](https://github.com/qw4990) + ++ TiKV + + - 修复在一些罕见的情况下,在 GC 的同时读取数据可能导致 TiKV panic 的问题 [#15109](https://github.com/tikv/tikv/issues/15109) @[MyonKeminta](https://github.com/MyonKeminta) + ++ PD + + - 修复重启 PD 可能导致 `default` 资源组被重新初始化的问题 [#6787](https://github.com/tikv/pd/issues/6787) @[glorv](https://github.com/glorv) + - 修复当 etcd 已经启动,但 client 尚未连接上 etcd 时,调用 client 会导致 PD panic 的问题 [#6860](https://github.com/tikv/pd/issues/6860) @[HuSharp](https://github.com/HuSharp) + - 修复 Region 的 `health-check` 输出可能与通过 ID 所查到的 Region 信息不一致的问题 [#6560](https://github.com/tikv/pd/issues/6560) @[JmPotato](https://github.com/JmPotato) + - 修复 `unsafe recovery` 中失败的 learner peer 在 `auto-detect` 模式中被忽略的问题 [#6690](https://github.com/tikv/pd/issues/6690) @[v01dstar](https://github.com/v01dstar) + - 修复 Placement Rules 选择了不满足规则的 TiFlash learner 的问题 [#6662](https://github.com/tikv/pd/issues/6662) @[rleungx](https://github.com/rleungx) + - 修复在 rule checker 选定 peer 时,unhealthy peer 无法被移除的问题 [#6559](https://github.com/tikv/pd/issues/6559) @[nolouch](https://github.com/nolouch) + ++ TiFlash + + - 修复由于死锁导致 TiFlash 无法成功同步分区表的问题 [#7758](https://github.com/pingcap/tiflash/issues/7758) @[hongyunyan](https://github.com/hongyunyan) + - 修复系统表 `INFORMATION_SCHEMA.TIFLASH_REPLICA` 包含用户没有访问权限的表的问题 [#7795](https://github.com/pingcap/tiflash/issues/7795) @[Lloyd-Pottiger](https://github.com/Lloyd-Pottiger) + - 修复当同一个 MPP Task 内有多个 HashAgg 算子时,可能导致 MPP Task 编译时间过长而严重影响查询性能的问题 [#7810](https://github.com/pingcap/tiflash/issues/7810) @[SeaRise](https://github.com/SeaRise) + ++ Tools + + + TiCDC + + - 修复由于 PD 短暂不可用而导致同步任务报错的问题 [#9294](https://github.com/pingcap/tiflow/issues/9294) @[asddongmen](https://github.com/asddongmen) + - 修复 TiCDC 部分节点发生网络隔离时可能引发的数据不一致问题 [#9344](https://github.com/pingcap/tiflow/issues/9344) @[CharlesCheung96](https://github.com/CharlesCheung96) + - 修复当 Kafka Sink 遇到错误时可能会无限阻塞同步任务推进的问题 [#9309](https://github.com/pingcap/tiflow/issues/9309) @[hicqu](https://github.com/hicqu) + - 修复在 TiCDC 节点状态发生改变时可能引发的 panic 问题 [#9354](https://github.com/pingcap/tiflow/issues/9354) @[sdojjy](https://github.com/sdojjy) + - 修复对默认 `ENUM` 值编码错误的问题 [#9259](https://github.com/pingcap/tiflow/issues/9259) @[3AceShowHand](https://github.com/3AceShowHand) + + + TiDB Lightning + + - 修复 TiDB Lightning 导入完成后执行 checksum 可能遇到 SSL 错误的问题 [#45462](https://github.com/pingcap/tidb/issues/45462) @[D3Hunter](https://github.com/D3Hunter) + - 修复逻辑导入模式下,导入期间下游删除表可能导致 TiDB Lightning 元信息未及时更新的问题 [#44614](https://github.com/pingcap/tidb/issues/44614) @[dsdashun](https://github.com/dsdashun) + +## 贡献者 + +感谢来自 TiDB 社区的贡献者们: + +- [charleszheng44](https://github.com/charleszheng44) +- [dhysum](https://github.com/dhysum) +- [haiyux](https://github.com/haiyux) +- [Jiang-Hua](https://github.com/Jiang-Hua) +- [Jille](https://github.com/Jille) +- [jiyfhust](https://github.com/jiyfhust) +- [krishnaduttPanchagnula](https://github.com/krishnaduttPanchagnula) +- [L-maple](https://github.com/L-maple) +- [pingandb](https://github.com/pingandb) +- [testwill](https://github.com/testwill) +- [tisonkun](https://github.com/tisonkun) +- [xuyifangreeneyes](https://github.com/xuyifangreeneyes) +- [yumchina](https://github.com/yumchina) diff --git a/releases/release-notes.md b/releases/release-notes.md index 1ae7272f3b00..bbb6fcc8456e 100644 --- a/releases/release-notes.md +++ b/releases/release-notes.md @@ -7,6 +7,10 @@ aliases: ['/docs-cn/dev/releases/release-notes/','/docs-cn/dev/releases/rn/'] TiDB 历史版本发布声明如下: +## 7.3 + +- [7.3.0-DMR](/releases/release-7.3.0.md): 2023-08-14 + ## 7.2 - [7.2.0-DMR](/releases/release-7.2.0.md): 2023-06-29 diff --git a/releases/release-timeline.md b/releases/release-timeline.md index b64782802671..64e0056632d1 100644 --- a/releases/release-timeline.md +++ b/releases/release-timeline.md @@ -9,6 +9,7 @@ summary: 了解 TiDB 的版本发布时间线。 | 版本 | 发布日期 | | :--- | :--- | +| [7.3.0-DMR](/releases/release-7.3.0.md) | 2023-08-14 | | [7.1.1](/releases/release-7.1.1.md) | 2023-07-24 | | [6.1.7](/releases/release-6.1.7.md) | 2023-07-12 | | [7.2.0-DMR](/releases/release-7.2.0.md) | 2023-06-29 | diff --git a/scale-tidb-using-tiup.md b/scale-tidb-using-tiup.md index 9d1d052813f2..ba39bd02b37b 100644 --- a/scale-tidb-using-tiup.md +++ b/scale-tidb-using-tiup.md @@ -280,7 +280,7 @@ Starting /root/.tiup/components/cluster/v1.12.3/cluster display TiDB Cluster: -TiDB Version: v7.2.0 +TiDB Version: v7.3.0 ID Role Host Ports Status Data Dir Deploy Dir diff --git a/sql-statements/sql-statement-alter-table.md b/sql-statements/sql-statement-alter-table.md index 37554e679324..b889c44670db 100644 --- a/sql-statements/sql-statement-alter-table.md +++ b/sql-statements/sql-statement-alter-table.md @@ -167,7 +167,7 @@ TiDB 中的 `ALTER TABLE` 语法主要存在以下限制: - 使用 `ALTER TABLE` 语句修改一个表的多个模式对象(如列、索引)时: - 不允许在多个更改中指定同一个模式对象。 - - TiDB 根据**执行前**的表结构检查合法性。例如 `ALTER TABLE t ADD COLUMN c1 INT, ADD COLUMN c2 INT AFTER c1;` 会报错,因为表结构中不存在名字为 `c1` 的表。 + - TiDB 根据**执行前**的表结构检查合法性。例如 `ALTER TABLE t ADD COLUMN c1 INT, ADD COLUMN c2 INT AFTER c1;` 会报错,因为表结构中不存在名字为 `c1` 的列。 - TiDB 的执行顺序是从左往右逐个执行更改,该行为在个别场景下和 MySQL 不兼容。 - 不支持主键列上 [Reorg-Data](/sql-statements/sql-statement-modify-column.md#reorg-data-change) 类型的变更。 - 不支持分区表上的列类型变更。 diff --git a/sql-statements/sql-statement-analyze-table.md b/sql-statements/sql-statement-analyze-table.md index 493e4882940d..9b112b71e045 100644 --- a/sql-statements/sql-statement-analyze-table.md +++ b/sql-statements/sql-statement-analyze-table.md @@ -95,10 +95,12 @@ EXPLAIN SELECT * FROM t1 WHERE c1 = 3; 2 rows in set (0.00 sec) ``` +当前的统计信息状态为 `pseudo`,表示统计信息不准确。 + {{< copyable "sql" >}} ```sql -analyze table t1; +ANALYZE TABLE t1; ``` ``` @@ -121,6 +123,8 @@ EXPLAIN SELECT * FROM t1 WHERE c1 = 3; 2 rows in set (0.00 sec) ``` +统计信息已经正确地更新和加载。 + ## MySQL 兼容性 * `ANALYZE TABLE` 在语法上与 MySQL 类似。但 `ANALYZE TABLE` 在 TiDB 上的执行时间可能长得多,因为它的内部运行方式不同。 diff --git a/system-variables.md b/system-variables.md index fe07f144eca1..27b5fc3155c2 100644 --- a/system-variables.md +++ b/system-variables.md @@ -4351,7 +4351,7 @@ Query OK, 0 rows affected, 1 warning (0.00 sec) - `closest_replicas` 表示仅使用与发起当前查询请求的 TiDB 节点相同区域的 TiFlash 副本进行分析计算。如果此区域的 TiFlash 副本未包含查询所需的全部数据,则查询将报错。 > **注意:** -> +> > - 如果 TiDB 节点未设置[区域属性](/schedule-replicas-by-topology-labels.md#设置-tidb-的-labels可选),并且 TiFlash 副本选择策略不是 `all_replicas` 时,TiFlash 引擎将忽略 TiFlash 副本选择策略,使用所有 TiFlash 副本进行 TiFlash 查询,并且返回警告 `The variable tiflash_replica_read is ignored`。 > - 如果 TiFlash 节点未设置[区域属性](/schedule-replicas-by-topology-labels.md#设置-tikv-和-tiflash-的-labels),则将其视为不属于任何区域的节点。 @@ -4491,7 +4491,7 @@ Query OK, 0 rows affected, 1 warning (0.00 sec) - 作用域:NONE - 默认值:`5.7.25-TiDB-(tidb version)` -- 这个变量的值是 MySQL 的版本和 TiDB 的版本,例如 '5.7.25-TiDB-v7.2.0'。 +- 这个变量的值是 MySQL 的版本和 TiDB 的版本,例如 '5.7.25-TiDB-v7.3.0'。 ### `version_comment` diff --git a/ticdc/deploy-ticdc.md b/ticdc/deploy-ticdc.md index cf86b34a0f3c..fee6026f5a60 100644 --- a/ticdc/deploy-ticdc.md +++ b/ticdc/deploy-ticdc.md @@ -95,7 +95,7 @@ tiup cluster upgrade --transfer-timeout 600 > **注意:** > -> 命令中的 `` 需要替换为集群名字,`` 需要替换为目标版本号,例如 v7.2.0。 +> 命令中的 `` 需要替换为集群名字,`` 需要替换为目标版本号,例如 v7.3.0。 ### 升级的注意事项 @@ -152,7 +152,7 @@ tiup cluster upgrade --transfer-timeout 600 ## 使用 TiCDC 命令行工具来查看集群状态 -执行以下命令来查看 TiCDC 集群运行状态,注意需要将 `v` 替换为 TiCDC 集群版本,例如 `v7.2.0`: +执行以下命令来查看 TiCDC 集群运行状态,注意需要将 `v` 替换为 TiCDC 集群版本,例如 `v7.3.0`: ```shell tiup ctl:v cdc capture list --server=http://10.0.10.25:8300 diff --git a/ticdc/ticdc-open-api-v2.md b/ticdc/ticdc-open-api-v2.md index a98cbda533f0..fee0b59ea782 100644 --- a/ticdc/ticdc-open-api-v2.md +++ b/ticdc/ticdc-open-api-v2.md @@ -90,7 +90,7 @@ curl -X GET http://127.0.0.1:8300/api/v2/status ```json { - "version": "v7.2.0", + "version": "v7.3.0", "git_hash": "10413bded1bdb2850aa6d7b94eb375102e9c44dc", "id": "d2912e63-3349-447c-90ba-72a4e04b5e9e", "pid": 1447, diff --git a/tidb-binlog/get-started-with-tidb-binlog.md b/tidb-binlog/get-started-with-tidb-binlog.md index 2e3da643f2ed..7ce8af95f10a 100644 --- a/tidb-binlog/get-started-with-tidb-binlog.md +++ b/tidb-binlog/get-started-with-tidb-binlog.md @@ -47,7 +47,7 @@ sudo yum install -y mariadb-server {{< copyable "shell-regular" >}} ```bash -curl -LO https://download.pingcap.org/tidb-community-server-v7.2.0-linux-amd64.tar.gz | tar xzf - && +curl -LO https://download.pingcap.org/tidb-community-server-v7.3.0-linux-amd64.tar.gz | tar xzf - && cd tidb-latest-linux-amd64 ``` diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index b8f81ec9d462..2b55147b27c6 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -841,6 +841,16 @@ TiDB 服务状态相关配置。 + 当查询大于这个值,就会当做是一个慢查询,输出到慢查询日志。 + 在 v6.1.0 之前,该功能通过配置项 `slow-threshold` 进行设置。 +### `in-mem-slow-query-topn-num` 从 v7.3.0 版本开始引入 + ++ 缓存在内存中的最慢的 slow query 个数。 ++ 默认值:30 + +### `in-mem-slow-query-recent-num` 从 v7.3.0 版本开始引入 + ++ 缓存在内存中的最近使用的 slow query 个数。 ++ 默认值:500 + ### `tidb_expensive_query_time_threshold` + 控制打印 expensive query 日志的阈值时间,默认值是 60 秒。expensive query 日志和慢日志的差别是,慢日志是在语句执行完后才打印,expensive query 日志可以把正在执行中且执行时间超过该阈值的语句及其相关信息打印出来。 diff --git a/tidb-monitoring-api.md b/tidb-monitoring-api.md index b4cfef34cc7c..38d86764602e 100644 --- a/tidb-monitoring-api.md +++ b/tidb-monitoring-api.md @@ -32,7 +32,7 @@ curl http://127.0.0.1:10080/status ``` { connections: 0, # 当前 TiDB Server 上的客户端连接数 - version: "5.7.25-TiDB-v7.2.0", # TiDB 版本号 + version: "5.7.25-TiDB-v7.3.0", # TiDB 版本号 git_hash: "7267747ae0ec624dffc3fdedb00f1ed36e10284b" # TiDB 当前代码的 Git Hash } ``` diff --git a/tiflash/create-tiflash-replicas.md b/tiflash/create-tiflash-replicas.md index 0610dd50c7ba..976f402a4298 100644 --- a/tiflash/create-tiflash-replicas.md +++ b/tiflash/create-tiflash-replicas.md @@ -139,10 +139,10 @@ SELECT TABLE_NAME FROM information_schema.tables where TABLE_SCHEMA = " tiup ctl:v pd -u http://:2379 store limit all engine tiflash 60 add-peer ``` - > 上述命令中,需要将 `v` 替换为该集群版本,例如 `v7.2.0`,`:2379` 替换为任一 PD 节点的地址。替换后样例为: + > 上述命令中,需要将 `v` 替换为该集群版本,例如 `v7.3.0`,`:2379` 替换为任一 PD 节点的地址。替换后样例为: > > ```shell - > tiup ctl:v7.2.0 pd -u http://192.168.1.4:2379 store limit all engine tiflash 60 add-peer + > tiup ctl:v7.3.0 pd -u http://192.168.1.4:2379 store limit all engine tiflash 60 add-peer > ``` 执行完毕后,几分钟内,你将观察到 TiFlash 节点的 CPU 及磁盘 IO 资源占用显著提升,TiFlash 将更快地创建副本。同时,TiKV 节点的 CPU 及磁盘 IO 资源占用也将有所上升。 diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index e321a1a2589e..5209819b340b 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -61,7 +61,7 @@ Flags: tiup cluster deploy [flags] ``` -该命令需要提供集群的名字、集群使用的 TiDB 版本(例如 `v7.2.0`),以及一个集群的拓扑文件。 +该命令需要提供集群的名字、集群使用的 TiDB 版本(例如 `v7.3.0`),以及一个集群的拓扑文件。 拓扑文件的编写可参考[示例](https://github.com/pingcap/tiup/blob/master/embed/examples/cluster/topology.example.yaml)。以一个最简单的拓扑为例,将下列文件保存为 `/tmp/topology.yaml`: @@ -118,12 +118,12 @@ tidb_servers: ... ``` -假如我们想要使用 TiDB 的 v7.2.0 版本,集群名字为 `prod-cluster`,则执行以下命令: +假如我们想要使用 TiDB 的 v7.3.0 版本,集群名字为 `prod-cluster`,则执行以下命令: {{< copyable "shell-regular" >}} ```shell -tiup cluster deploy -p prod-cluster v7.2.0 /tmp/topology.yaml +tiup cluster deploy -p prod-cluster v7.3.0 /tmp/topology.yaml ``` 执行过程中会再次确认拓扑结构并提示输入目标机器上的 root 密码(-p 表示使用密码): @@ -131,7 +131,7 @@ tiup cluster deploy -p prod-cluster v7.2.0 /tmp/topology.yaml ```bash Please confirm your topology: TiDB Cluster: prod-cluster -TiDB Version: v7.2.0 +TiDB Version: v7.3.0 Type Host Ports OS/Arch Directories ---- ---- ----- ------- ----------- pd 172.16.5.134 2379/2380 linux/x86_64 deploy/pd-2379,data/pd-2379 @@ -174,7 +174,7 @@ tiup cluster list Starting /root/.tiup/components/cluster/v1.12.3/cluster list Name User Version Path PrivateKey ---- ---- ------- ---- ---------- -prod-cluster tidb v7.2.0 /root/.tiup/storage/cluster/clusters/prod-cluster /root/.tiup/storage/cluster/clusters/prod-cluster/ssh/id_rsa +prod-cluster tidb v7.3.0 /root/.tiup/storage/cluster/clusters/prod-cluster /root/.tiup/storage/cluster/clusters/prod-cluster/ssh/id_rsa ``` ## 启动集群 @@ -202,7 +202,7 @@ tiup cluster display prod-cluster ``` Starting /root/.tiup/components/cluster/v1.12.3/cluster display prod-cluster TiDB Cluster: prod-cluster -TiDB Version: v7.2.0 +TiDB Version: v7.3.0 ID Role Host Ports OS/Arch Status Data Dir Deploy Dir -- ---- ---- ----- ------- ------ -------- ---------- 172.16.5.134:3000 grafana 172.16.5.134 3000 linux/x86_64 Up - deploy/grafana-3000 @@ -270,7 +270,7 @@ tiup cluster display prod-cluster ``` Starting /root/.tiup/components/cluster/v1.12.3/cluster display prod-cluster TiDB Cluster: prod-cluster -TiDB Version: v7.2.0 +TiDB Version: v7.3.0 ID Role Host Ports OS/Arch Status Data Dir Deploy Dir -- ---- ---- ----- ------- ------ -------- ---------- 172.16.5.134:3000 grafana 172.16.5.134 3000 linux/x86_64 Up - deploy/grafana-3000 @@ -370,12 +370,12 @@ Global Flags: -y, --yes 跳过所有的确认步骤 ``` -例如,把集群升级到 v7.2.0 的命令为: +例如,把集群升级到 v7.3.0 的命令为: {{< copyable "shell-regular" >}} ```bash -tiup cluster upgrade tidb-test v7.2.0 +tiup cluster upgrade tidb-test v7.3.0 ``` ## 更新配置 @@ -555,11 +555,11 @@ tiup cluster audit Starting component `cluster`: /home/tidb/.tiup/components/cluster/v1.12.3/cluster audit ID Time Command -- ---- ------- -4BLhr0 2023-06-29T23:55:09+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster deploy test v7.2.0 /tmp/topology.yaml -4BKWjF 2023-06-29T23:36:57+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster deploy test v7.2.0 /tmp/topology.yaml -4BKVwH 2023-06-29T23:02:08+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster deploy test v7.2.0 /tmp/topology.yaml -4BKKH1 2023-06-29T16:39:04+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster destroy test -4BKKDx 2023-06-29T16:36:57+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster deploy test v7.2.0 /tmp/topology.yaml +4BLhr0 2023-08-10T23:55:09+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster deploy test v7.3.0 /tmp/topology.yaml +4BKWjF 2023-08-10T23:36:57+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster deploy test v7.3.0 /tmp/topology.yaml +4BKVwH 2023-08-10T23:02:08+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster deploy test v7.3.0 /tmp/topology.yaml +4BKKH1 2023-08-10T16:39:04+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster destroy test +4BKKDx 2023-08-10T16:36:57+08:00 /home/tidb/.tiup/components/cluster/v1.12.3/cluster deploy test v7.3.0 /tmp/topology.yaml ``` 第一列为 audit-id,如果想看某个命令的执行日志,则传入这个 audit-id: @@ -673,7 +673,7 @@ tiup cluster check --cluster 此时可以通过命令行参数 `--ssh=system` 启用系统自带命令行: -- 部署集群:`tiup cluster deploy --ssh=system`,其中 `` 为集群名称,`` 为 TiDB 集群版本(例如 `v7.2.0`),`` 为拓扑文件路径 +- 部署集群:`tiup cluster deploy --ssh=system`,其中 `` 为集群名称,`` 为 TiDB 集群版本(例如 `v7.3.0`),`` 为拓扑文件路径 - 启动集群:`tiup cluster start --ssh=system` - 升级集群:`tiup cluster upgrade ... --ssh=system` diff --git a/tiup/tiup-component-cluster-deploy.md b/tiup/tiup-component-cluster-deploy.md index e2aa9029ee8b..a633c09db935 100644 --- a/tiup/tiup-component-cluster-deploy.md +++ b/tiup/tiup-component-cluster-deploy.md @@ -13,7 +13,7 @@ tiup cluster deploy [flags] ``` - `` 表示新集群的名字,不能和现有集群同名 -- `` 为要部署的 TiDB 集群版本号,如 `v7.2.0` +- `` 为要部署的 TiDB 集群版本号,如 `v7.3.0` - `` 为事先编写好的[拓扑文件](/tiup/tiup-cluster-topology-reference.md) ## 选项 diff --git a/tiup/tiup-component-cluster-patch.md b/tiup/tiup-component-cluster-patch.md index b1b467052a33..9c2b20d3f2c8 100644 --- a/tiup/tiup-component-cluster-patch.md +++ b/tiup/tiup-component-cluster-patch.md @@ -28,7 +28,7 @@ tiup cluster patch [flags] 1. 确定以下变量的值: - `${component}`:需要替换的组件名(例如 `tidb`、`tikv`、`pd`)。 - - `${version}`:组件的版本(例如 `v7.2.0`、`v6.5.2`)。 + - `${version}`:组件的版本(例如 `v7.3.0`、`v6.5.3`)。 - `${os}`:操作系统 (`linux`)。 - `${arch}`:组件运行的平台 (`amd64`、`arm64`)。 2. 下载当前的组件包: diff --git a/tiup/tiup-component-cluster-upgrade.md b/tiup/tiup-component-cluster-upgrade.md index 71b3d54fc82d..5fad868210c0 100644 --- a/tiup/tiup-component-cluster-upgrade.md +++ b/tiup/tiup-component-cluster-upgrade.md @@ -13,7 +13,7 @@ tiup cluster upgrade [flags] ``` - `` 为要操作的集群名字,如果忘记集群名字可通过[集群列表](/tiup/tiup-component-cluster-list.md)查看。 -- `` 为要升级到的目标版本,例如 `v7.2.0`。目前仅允许升级到比当前集群更高的版本,不允许升级到比当前集群更低的版本,即不允许降级。同时也不允许升级成 nightly 版本。 +- `` 为要升级到的目标版本,例如 `v7.3.0`。目前仅允许升级到比当前集群更高的版本,不允许升级到比当前集群更低的版本,即不允许降级。同时也不允许升级成 nightly 版本。 ## 选项 @@ -24,7 +24,7 @@ tiup cluster upgrade [flags] - 该选项默认关闭,默认值为 `false`。在命令中添加该选项,并传入 `true` 值或不传值,均可开启此功能。 > **注意:** -> +> > 对正在提供服务的集群强制升级可能导致集群服务不可用。对于未启动的集群,升级成功后会自动启动集群。 ### --transfer-timeout(uint,默认 600) diff --git a/tiup/tiup-component-dm-upgrade.md b/tiup/tiup-component-dm-upgrade.md index 523a66a41b34..18d74b9d3819 100644 --- a/tiup/tiup-component-dm-upgrade.md +++ b/tiup/tiup-component-dm-upgrade.md @@ -13,7 +13,7 @@ tiup dm upgrade [flags] ``` - `` 为要操作的集群名字,如果忘记集群名字可查看[集群列表](/tiup/tiup-component-dm-list.md)。 -- `` 为要升级到的目标版本,例如 `v7.2.0`。目前仅允许升级到比当前集群更高的版本,不允许升级到比当前集群更低的版本,即不允许降级。同时也不允许升级成 nightly 版本。 +- `` 为要升级到的目标版本,例如 `v7.3.0`。目前仅允许升级到比当前集群更高的版本,不允许升级到比当前集群更低的版本,即不允许降级。同时也不允许升级成 nightly 版本。 ## 选项 diff --git a/tiup/tiup-component-management.md b/tiup/tiup-component-management.md index aa4f0819d1af..89a9a0d1d40a 100644 --- a/tiup/tiup-component-management.md +++ b/tiup/tiup-component-management.md @@ -69,12 +69,12 @@ tiup install tidb tiup install tidb:nightly ``` -示例三:使用 TiUP 安装 v7.2.0 版本的 TiKV +示例三:使用 TiUP 安装 v7.3.0 版本的 TiKV {{< copyable "shell-regular" >}} ```shell -tiup install tikv:v7.2.0 +tiup install tikv:v7.3.0 ``` ## 升级组件 @@ -127,12 +127,12 @@ Flags: 如果想要多次启动同一个组件并复用之前的工作目录,就可以在启动时用 `--tag` 指定相同的名字。指定 tag 后,在实例终止时就*不会自动删除*工作目录,方便下次启动时复用。 -示例一:运行 v7.2.0 版本的 TiDB +示例一:运行 v7.3.0 版本的 TiDB {{< copyable "shell-regular" >}} ```shell -tiup tidb:v7.2.0 +tiup tidb:v7.3.0 ``` 示例二:指定 tag 运行 TiKV @@ -218,12 +218,12 @@ component 为要卸载的组件名称,version 为要卸载的版本,这两 - 若省略版本,加 `--all` 表示卸载该组件所有版本 - 若版本和组件都省略,则加 `--all` 表示卸载所有组件及其所有版本 -示例一:卸载 v7.2.0 版本的 TiDB +示例一:卸载 v7.3.0 版本的 TiDB {{< copyable "shell-regular" >}} ```shell -tiup uninstall tidb:v7.2.0 +tiup uninstall tidb:v7.3.0 ``` 示例二:卸载所有版本的 TiKV diff --git a/tiup/tiup-mirror.md b/tiup/tiup-mirror.md index f9bc57152ca8..256552a8bf8a 100644 --- a/tiup/tiup-mirror.md +++ b/tiup/tiup-mirror.md @@ -86,9 +86,9 @@ tiup mirror clone [global-version] [flags] 如果只想克隆某个组件的某一个版本而不是所有版本,则使用 `--=` 来限定,例如: - - 只想克隆 TiDB 的 v7.2.0 版本,则执行 `tiup mirror clone --tidb v7.2.0` - - 只想克隆 TiDB 的 v7.2.0 版本,以及 TiKV 的所有版本,则执行 `tiup mirror clone --tidb v7.2.0 --tikv all` - - 克隆一个集群的所有组件的 v7.2.0 版本,则执行 `tiup mirror clone v7.2.0` + - 只想克隆 TiDB 的 v7.3.0 版本,则执行 `tiup mirror clone --tidb v7.3.0` + - 只想克隆 TiDB 的 v7.3.0 版本,以及 TiKV 的所有版本,则执行 `tiup mirror clone --tidb v7.3.0 --tikv all` + - 克隆一个集群的所有组件的 v7.3.0 版本,则执行 `tiup mirror clone v7.3.0` 克隆完成后,签名密钥会自动设置。 diff --git a/tiup/tiup-playground.md b/tiup/tiup-playground.md index 2a124c647bcc..2e501b3b94f7 100644 --- a/tiup/tiup-playground.md +++ b/tiup/tiup-playground.md @@ -19,7 +19,7 @@ tiup playground ${version} [flags] - 因为该命令没有指定 playground 的版本,TiUP 会先查找已安装的 playground 的最新版本,假设已安装的 playground 最新版为 v1.12.3,则该命令相当于 tiup playground:v1.12.3 - 如果 playground 从未安装过任何版本的 TiDB/TiKV/PD 组件,TiUP 会先安装这些组件的最新稳定版,然后再启动运行这些组件的实例 -- 因为该命令没有指定 TiDB/PD/TiKV 各组件的版本,默认情况下,它会使用各组件的最新发布版本,假设当前为 v7.2.0,则该命令相当于 tiup playground:1.12.3 v7.2.0 +- 因为该命令没有指定 TiDB/PD/TiKV 各组件的版本,默认情况下,它会使用各组件的最新发布版本,假设当前为 v7.3.0,则该命令相当于 tiup playground:1.12.3 v7.3.0 - 因为该命令也没有指定各组件的个数,默认情况下,它会启动由 1 个 TiDB、1 个 TiKV、1 个 PD 和 1 个 TiFlash 实例构成的最小化集群 - 在依次启动完各个 TiDB 组件后,playground 会提醒集群启动成功,并告诉你一些有用的信息,譬如如何通过 MySQL 客户端连接集群、如何访问 [TiDB Dashboard](/dashboard/dashboard-intro.md) 等 diff --git a/upgrade-tidb-using-tiup.md b/upgrade-tidb-using-tiup.md index 8e7db5616fcc..a580867ca9c0 100644 --- a/upgrade-tidb-using-tiup.md +++ b/upgrade-tidb-using-tiup.md @@ -7,10 +7,10 @@ aliases: ['/docs-cn/dev/upgrade-tidb-using-tiup/','/docs-cn/dev/how-to/upgrade/u 本文档适用于以下升级路径: -- 使用 TiUP 从 TiDB 4.0 版本升级至 TiDB 7.2。 -- 使用 TiUP 从 TiDB 5.0-5.4 版本升级至 TiDB 7.2。 -- 使用 TiUP 从 TiDB 6.0-6.6 版本升级至 TiDB 7.2。 -- 使用 TiUP 从 TiDB 7.0-7.1 版本升级至 TiDB 7.2。 +- 使用 TiUP 从 TiDB 4.0 版本升级至 TiDB 7.3。 +- 使用 TiUP 从 TiDB 5.0-5.4 版本升级至 TiDB 7.3。 +- 使用 TiUP 从 TiDB 6.0-6.6 版本升级至 TiDB 7.3。 +- 使用 TiUP 从 TiDB 7.0-7.2 版本升级至 TiDB 7.3。 > **警告:** > @@ -22,18 +22,18 @@ aliases: ['/docs-cn/dev/upgrade-tidb-using-tiup/','/docs-cn/dev/how-to/upgrade/u > **注意:** > -> 如果原集群是 3.0 或 3.1 或更早的版本,不支持直接升级到 v7.2.0 及后续修订版本。你需要先从早期版本升级到 4.0 后,再从 4.0 升级到 v7.2.0 及后续修订版本。 -> 配置参数 [`server-version`](/tidb-configuration-file.md#server-version) 的值会被 TiDB 节点用于验证当前 TiDB 的版本。因此在进行 TiDB 集群升级前,请将 `server-version` 的值设置为空或者当前 TiDB 真实的版本值,避免出现非预期行为。 +> - 如果原集群是 3.0 或 3.1 或更早的版本,不支持直接升级到 v7.3.0 及后续修订版本。你需要先从早期版本升级到 4.0 后,再从 4.0 升级到 v7.3.0 及后续修订版本。 +> - 配置参数 [`server-version`](/tidb-configuration-file.md#server-version) 的值会被 TiDB 节点用于验证当前 TiDB 的版本。因此在进行 TiDB 集群升级前,请将 `server-version` 的值设置为空或者当前 TiDB 真实的版本值,避免出现非预期行为。 ## 1. 升级兼容性说明 - TiDB 目前暂不支持版本降级或升级后回退。 -- 使用 TiDB Ansible 管理的 4.0 版本集群,需要先按照 [4.0 版本文档的说明](https://docs.pingcap.com/zh/tidb/v4.0/upgrade-tidb-using-tiup)将集群导入到 TiUP (`tiup cluster`) 管理后,再按本文档说明升级到 v7.2.0 版本。 -- 若要将 v3.0 之前的版本升级至 v7.2.0 版本: +- 使用 TiDB Ansible 管理的 4.0 版本集群,需要先按照 [4.0 版本文档的说明](https://docs.pingcap.com/zh/tidb/v4.0/upgrade-tidb-using-tiup)将集群导入到 TiUP (`tiup cluster`) 管理后,再按本文档说明升级到 v7.3.0 版本。 +- 若要将 v3.0 之前的版本升级至 v7.3.0 版本: 1. 首先[通过 TiDB Ansible 升级到 3.0 版本](https://docs.pingcap.com/zh/tidb/v3.0/upgrade-tidb-using-ansible)。 2. 然后按照 [4.0 版本文档的说明](https://docs.pingcap.com/zh/tidb/v4.0/upgrade-tidb-using-tiup),使用 TiUP (`tiup cluster`) 将 TiDB Ansible 配置导入。 3. 将集群升级至 v4.0 版本。 - 4. 按本文档说明将集群升级到 v7.2.0 版本。 + 4. 按本文档说明将集群升级到 v7.3.0 版本。 - 支持 TiDB Binlog,TiCDC,TiFlash 等组件版本的升级。 - 将 v6.3.0 之前的 TiFlash 升级至 v6.3.0 及之后的版本时,需要特别注意:在 Linux AMD64 架构的硬件平台部署 TiFlash 时,CPU 必须支持 AVX2 指令集。而在 Linux ARM64 架构的硬件平台部署 TiFlash 时,CPU 必须支持 ARMv8 架构。具体请参考 [6.3.0 版本 Release Notes](/releases/release-6.3.0.md#其他) 中的描述。 - 具体不同版本的兼容性说明,请查看各个版本的 [Release Note](/releases/release-notes.md)。请根据各个版本的 Release Note 的兼容性更改调整集群的配置。 @@ -45,7 +45,7 @@ aliases: ['/docs-cn/dev/upgrade-tidb-using-tiup/','/docs-cn/dev/how-to/upgrade/u ### 2.1 查阅兼容性变更 -查阅 TiDB v7.2.0 release notes 中的[兼容性变更](/releases/release-7.2.0.md#兼容性变更)。如果有任何变更影响到了你的升级,请采取相应的措施。 +查阅 TiDB v7.3.0 release notes 中的[兼容性变更](/releases/release-7.3.0.md#兼容性变更)。如果有任何变更影响到了你的升级,请采取相应的措施。 ### 2.2 升级 TiUP 或更新 TiUP 离线镜像 @@ -122,7 +122,7 @@ tiup update cluster > 以下情况可跳过此步骤: > > - 原集群没有修改过配置参数,或通过 tiup cluster 修改过参数但不需要调整。 -> - 升级后对未修改过的配置项希望使用 `7.0.0` 默认参数。 +> - 升级后对未修改过的配置项希望使用 `7.3.0` 默认参数。 1. 进入拓扑文件的 `vi` 编辑模式: @@ -138,7 +138,7 @@ tiup update cluster > **注意:** > -> 升级到 v7.2.0 版本前,请确认已在 4.0 修改的参数在 v7.2.0 版本中是兼容的,可参考 [TiKV 配置文件描述](/tikv-configuration-file.md)。 +> 升级到 v7.3.0 版本前,请确认已在 4.0 修改的参数在 v7.3.0 版本中是兼容的,可参考 [TiKV 配置文件描述](/tikv-configuration-file.md)。 ### 2.4 检查当前集群的健康状况 @@ -175,12 +175,12 @@ tiup cluster check --cluster tiup cluster upgrade ``` -以升级到 v7.2.0 版本为例: +以升级到 v7.3.0 版本为例: {{< copyable "shell-regular" >}} ``` -tiup cluster upgrade v7.2.0 +tiup cluster upgrade v7.3.0 ``` > **注意:** @@ -204,7 +204,7 @@ tiup cluster upgrade v7.2.0 tiup cluster stop ``` -之后通过 `upgrade` 命令添加 `--offline` 参数来进行停机升级,其中 `` 为集群名,`` 为升级的目标版本,例如 `v7.2.0`。 +之后通过 `upgrade` 命令添加 `--offline` 参数来进行停机升级,其中 `` 为集群名,`` 为升级的目标版本,例如 `v7.3.0`。 {{< copyable "shell-regular" >}} @@ -233,7 +233,7 @@ tiup cluster display ``` Cluster type: tidb Cluster name: -Cluster version: v7.2.0 +Cluster version: v7.3.0 ``` ## 4. 升级 FAQ @@ -264,7 +264,7 @@ Cluster version: v7.2.0 ### 4.2 升级过程中 evict leader 等待时间过长,如何跳过该步骤快速升级 -可以指定 `--force`,升级时会跳过 `PD transfer leader` 和 `TiKV evict leader` 过程,直接重启并升级版本,对线上运行的集群性能影响较大。命令如下,其中 `` 为升级的目标版本,例如 `v7.2.0`: +可以指定 `--force`,升级时会跳过 `PD transfer leader` 和 `TiKV evict leader` 过程,直接重启并升级版本,对线上运行的集群性能影响较大。命令如下,其中 `` 为升级的目标版本,例如 `v7.3.0`: {{< copyable "shell-regular" >}} @@ -279,5 +279,5 @@ tiup cluster upgrade --force {{< copyable "" >}} ``` -tiup install ctl:v7.2.0 +tiup install ctl:v7.3.0 ```