Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion latest_translation_commit.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"target": "release-8.5",
"sha": "aa63093b1a90c6d816373829ab86a485b41d8071"
"sha": "1a75af9f55e1488abdfb9d4c6ab8b2a58849f9db"
}
101 changes: 98 additions & 3 deletions pessimistic-transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,92 @@ TiDB 在悲观事务模式下支持以下两种隔离级别:

在事务提交流程中,悲观事务和乐观事务的逻辑相同。两者都采用两阶段提交(2PC)模式。悲观事务的关键适配在于 DML 执行。

![TiDB 悲观事务提交流程](/media/pessimistic-transaction-commit.png)
```mermaid
---
config:
themeCSS: |
/* workaround for https://github.com/mermaid-js/mermaid/issues/523 */
/* mark the two "Lock" arrows as red, by restyling the dashed arrows */
line.messageLine1 {
stroke: #d32f2f;
stroke-dasharray: none !important;
}
/* make sure the arrow heads inherit the stroke color (another bug in mermaid) */
#arrowhead path {
fill: context-stroke;
stroke: context-stroke;
}
---
sequenceDiagram
participant Client
participant TiDB
participant TiKV

Client->>TiDB: BEGIN
rect rgba(255, 0, 0, 0.08)
Client->>TiDB: DML
TiDB-->>TiKV: Lock
TiDB-->>TiKV: Lock
end
rect rgba(0, 0, 0, 0.04)
Client->>TiDB: COMMIT
TiDB->>TiKV: Prewrite
TiDB->>TiKV: Commit
end
```

悲观事务在 2PC 之前增加了 `Acquire Pessimistic Lock` 阶段,包括以下步骤:

1. (与乐观事务模式相同)TiDB 接收来自客户端的 `begin` 请求,此时的当前时间戳即为该事务的 start_ts。
2. 当 TiDB 服务器收到客户端的写入请求时,会向 TiKV 服务器发起悲观锁请求,锁信息会被持久化到 TiKV 服务器。
3. (与乐观事务模式相同)当客户端发出提交请求时,TiDB 开始执行类似乐观事务的两阶段提交。

![TiDB 中的悲观事务](/media/pessimistic-transaction-in-tidb.png)
```mermaid
---
title: Pessimistic Transaction in TiDB
---
sequenceDiagram
participant client
participant TiDB
participant PD
participant TiKV

client->>TiDB: begin
TiDB->>PD: get ts as start_ts
loop execute SQL
rect rgba(0, 0, 0, 0.04)
alt do read
TiDB->>TiKV: get data from TiKV with start_ts
TiDB->>client: return read result
else do write
rect rgba(255, 0, 0, 0.08)
loop if has write conflict
TiDB->>PD: get ts as for_update_ts
TiDB->>TiDB: write in cache
TiDB->>TiKV: acquire pessimistic locks parallelly
end
end
TiDB->>client: return write result
end
end
end
client->>TiDB: commit
opt start 2PC
rect rgba(0, 0, 0, 0.04)
par prewrite
TiDB->>TiKV: prewrite each key in cache with start_ts parallelly
end
end
rect rgba(0, 0, 0, 0.04)
par commit
TiDB->>PD: get ts as commit_ts
TiDB->>TiKV: commit primary_key with commit_ts first
TiDB->>client: success
TiDB->>TiKV: commit each secondary_key with commit_ts parallelly
end
end
end
```

## 管道化锁定流程

Expand All @@ -164,7 +241,25 @@ TiDB 在悲观事务模式下支持以下两种隔离级别:

如果你的应用逻辑依赖锁或等待锁机制,或者你希望在 TiKV 集群异常情况下尽可能保证事务提交成功率,应禁用管道化锁定功能。

![管道化悲观锁](/media/pessimistic-transaction-pipelining.png)
```mermaid
---
title: pipelined pessimistic lock
---
sequenceDiagram
participant Client
participant TiDB
participant TiKV1
participant TiKV2
participant TiKV3

loop
Client->>TiDB: DML
TiDB->>TiKV1: Acquire pessimistic locks
TiKV1->>TiDB: OK
TiKV1--)TiKV2: Log replication
TiKV1--)TiKV3: Log replication
end
```

此功能默认启用。若要禁用,可修改 TiKV 配置:

Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/data-service-integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ summary: 了解如何在 TiDB Cloud 控制台中将 TiDB Cloud Data App 与第

## 将 Data App 与 Dify 集成

你可以将 Data App 与 [Dify](https://docs.dify.ai/guides/tools) 集成,为你的应用程序增加智能功能,如向量距离计算、高级相似度搜索和向量分析。
你可以将 Data App 与 [Dify](https://dify.ai/) 集成,为你的应用程序增加智能功能,如向量距离计算、高级相似度搜索和向量分析。

要将 Data App 与 Dify 集成,请按照与 [GPTs 集成](#将-data-app-与-gpts-集成)相同的步骤操作。唯一的区别是在**集成**标签页上,你需要在**与 Dify 集成**区域点击**获取配置**。
4 changes: 2 additions & 2 deletions tidb-cloud/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ summary: 了解不同 TiDB Cloud 套餐的功能支持状态。
<tr>
<td>Top SQL</td>
<td style="text-align:center; font-size: 14px;">❌</td>
<td style="text-align:center; font-size: 14px;"></td>
<td style="text-align:center; font-size: 14px;"></td>
<td style="text-align:center; font-size: 14px;">✅ <br/><span style="font-size: 14px; white-space: nowrap;">(Top RU 公测中)</span></td>
<td style="text-align:center; font-size: 14px;">✅ <br/><span style="font-size: 14px; white-space: nowrap;">(Top RU 公测中)</span></td>
<td style="text-align:center;">✅</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/integrate-tidbcloud-with-airbyte.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ airbyte-server | --------------------------------------
![Set up connection](/media/tidb-cloud/integration-airbyte-connection.jpg)
7. 将 **Normalization & Transformation** 设置为 **Normalized tabular data** 以使用默认的标准化模式,或者你也可以为你的作业设置 dbt 文件。关于标准化的更多信息,请参考 [Transformations and Normalization](https://docs.airbyte.com/operator-guides/transformation-and-normalization/transformations-with-dbt)。
7. 将 **Normalization & Transformation** 设置为 **Normalized tabular data** 以使用默认的标准化模式,或者你也可以为你的作业设置 dbt 文件。
8. 点击 **Set up connection**。
9. 连接建立后,点击 **ENABLED** 激活同步任务。你也可以点击 **Sync now** 立即同步。
Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/integrate-tidbcloud-with-zapier.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ summary: 了解如何通过 Zapier 将 TiDB Cloud 连接到 5000+ 应用。

## 使用模板快速开始

[Zap Templates](https://platform.zapier.com/partners/zap-templates) 是为公开可用的 Zapier 集成预先选定应用和核心字段的现成集成或 Zap。
[Zap Templates](https://docs.zapier.com/integrations/publish/zap-templates) 是为公开可用的 Zapier 集成预先选定应用和核心字段的现成集成或 Zap。

本节将以 **Add new Github global events to TiDB rows** 模板为例,创建一个工作流。在该工作流中,每当你的 GitHub 账户产生新的全局事件(任何 [GitHub event](https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types) 发生在你或与你有关的任何仓库上),Zapier 会向你的 TiDB Cloud 集群添加一行新数据。

Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/monitor-alert-flashduty.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TiDB Cloud 为你提供了通过 Flashduty、[Slack](/tidb-cloud/monitor-alert-s

### 步骤 1. 生成 Flashduty webhook URL

1. 按照 [Flashduty Prometheus Integration](https://docs.flashcat.cloud/en/on-call/integration/alert-integration/alert-sources/prometheus#prometheus-integration-guide) 的说明生成 webhook URL。
1. 按照 [Flashduty Prometheus Integration](https://docs.flashcat.cloud/en/on-call/integration/alert-integration/alert-sources/prometheus) 的说明生成 webhook URL。
2. 保存生成的 webhook URL,以便在下一步中使用。

### 步骤 2. 从 TiDB Cloud 进行订阅
Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/releases/release-notes-2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ summary: 了解 2024 年 TiDB Cloud 的发布说明。

如果你的表包含 [向量数据类型](/ai/reference/vector-search-data-types.md),你可以自动生成一个向量检索端点,根据所选距离函数计算向量距离。

该功能可无缝集成到 [Dify](https://docs.dify.ai/guides/tools) 和 [GPTs](https://openai.com/blog/introducing-gpts) 等 AI 平台,为你的应用带来更复杂的自然语言处理和 AI 能力,助力智能解决方案。
该功能可无缝集成到 [Dify](https://dify.ai/) 和 [GPTs](https://openai.com/blog/introducing-gpts) 等 AI 平台,为你的应用带来更复杂的自然语言处理和 AI 能力,助力智能解决方案。

更多信息,参见 [自动生成端点](/tidb-cloud/data-service-manage-endpoint.md#generate-an-endpoint-automatically) 和 [将 Data App 集成到第三方工具](/tidb-cloud/data-service-integrations.md)。

Expand Down
14 changes: 14 additions & 0 deletions tidb-cloud/releases/tidb-cloud-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ aliases: ['/zh/tidbcloud/supported-tidb-versions','/zh/tidbcloud/release-notes']

本页面列出了 [TiDB Cloud](https://www.pingcap.com/tidb-cloud/) 在 2026 年的发布说明。

## 2026 年 5 月 19 日

**常规变更**

- **TiDB Cloud Essential**

- Top RU 现已在以下区域的 [TiDB Cloud Essential](/tidb-cloud/select-cluster-tier.md#essential) 中开启公开预览:

- 阿里云:`Mexico (na-south-1)`

此功能以分钟级粒度展示 RU 消耗最高的 SQL 语句,帮助你快速识别资源密集型查询以降低成本。

该功能正在分阶段推出。如需申请抢先体验,请联系 [support@pingcap.com](mailto:support@pingcap.com)。

## 2026 年 5 月 12 日

**常规变更**
Expand Down