Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiCDC: add trouble shooting info about DDL failures #5449

Merged
merged 15 commits into from
Mar 10, 2021
Merged
25 changes: 25 additions & 0 deletions ticdc/troubleshoot-ticdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,28 @@ TiCDC 对大事务(大小超过 5 GB)提供部分支持,根据场景不同
```shell
cdc cli changefeed resume -c test-cf --pd=http://10.0.10.25:2379
```

## TiCDC 同步时,在下游执行 DDL 失败会有什么表现,如何恢复?
liuzix marked this conversation as resolved.
Show resolved Hide resolved

从 4.0.11 开始,如果 DDL 执行失败,changefeed 会自动停止,checkpoint-ts 为出错的 DDL 的 finish-ts 减一。如果希望让 TiCDC 再次重试在下游执行这条 DDL,可以使用 `cdc cli changefeed resume` 恢复同步任务。
liuzix marked this conversation as resolved.
Show resolved Hide resolved

{{< copyable "shell-regular" >}}

```shell
cdc cli changefeed resume -c test-cf --pd=http://10.0.10.25:2379
```

如果希望跳过这条 DDL,可以将 changefeed 的 start-ts 设为报错时的 checkpoint-ts + 1, 然后通过 `cdc cli changefeed resume` 恢复同步任务。假设报错时的 checkpoint-ts 为 `415241823337054209`, 可以如此操作来跳过这条 DDL.
liuzix marked this conversation as resolved.
Show resolved Hide resolved

{{< copyable "shell-regular" >}}

```shell
cdc cli changefeed update -c test-cf --pd=http://10.0.10.25:2379 --start-ts 415241823337054210

cdc cli changefeed resume -c test-cf --pd=http://10.0.10.25:2379
```

> **注意:**
>
> 以上步骤仅适用于 TiCDC 4.0.11 及以上(且不包括 5.0.0-rc)。
liuzix marked this conversation as resolved.
Show resolved Hide resolved
> 其余版本中,DDL 执行失败后 changefeed 的 checkpoint-ts 为 DDL 的 finish-ts. `cdc cli changefeed resume` 恢复同步任务后 DDL 不会重试,直接跳过执行该 DDL。
liuzix marked this conversation as resolved.
Show resolved Hide resolved