diff --git a/media/ticdc/ticdc-changefeed-state-transfer.png b/media/ticdc/ticdc-changefeed-state-transfer.png new file mode 100644 index 0000000000000..08802299c1cce Binary files /dev/null and b/media/ticdc/ticdc-changefeed-state-transfer.png differ diff --git a/media/ticdc/ticdc-state-transfer.png b/media/ticdc/ticdc-state-transfer.png deleted file mode 100644 index 634048e1bf555..0000000000000 Binary files a/media/ticdc/ticdc-state-transfer.png and /dev/null differ diff --git a/ticdc/ticdc-changefeed-overview.md b/ticdc/ticdc-changefeed-overview.md index cc0e046e9a44d..07e630a34c7d2 100644 --- a/ticdc/ticdc-changefeed-overview.md +++ b/ticdc/ticdc-changefeed-overview.md @@ -11,26 +11,30 @@ A changefeed is a replication task in TiCDC, which replicates the data change lo The state of a replication task represents the running status of the replication task. During the running of TiCDC, replication tasks might fail with errors, be manually paused, resumed, or reach the specified `TargetTs`. These behaviors can lead to the change of the replication task state. This section describes the states of TiCDC replication tasks and the transfer relationships between states. -![TiCDC state transfer](/media/ticdc/ticdc-state-transfer.png) +![TiCDC state transfer](/media/ticdc/ticdc-changefeed-state-transfer.png) The states in the preceding state transfer diagram are described as follows: - `Normal`: The replication task runs normally and the checkpoint-ts proceeds normally. - `Stopped`: The replication task is stopped, because the user manually pauses the changefeed. The changefeed in this state blocks GC operations. -- `Error`: The replication task returns an error. The replication cannot continue due to some recoverable errors. The changefeed in this state keeps trying to resume until the state transfers to `Normal`. The changefeed in this state blocks GC operations. +- `Warning`: The replication task returns an error. The replication cannot continue due to some recoverable errors. The changefeed in this state keeps trying to resume until the state transfers to `Normal`. The maximum retry time is 30 minutes. If it exceeds this time, the changefeed enters a failed state. The changefeed in this state blocks GC operations. - `Finished`: The replication task is finished and has reached the preset `TargetTs`. The changefeed in this state does not block GC operations. -- `Failed`: The replication task fails. Due to some unrecoverable errors, the replication task cannot resume and cannot be recovered. TiCDC retains the data associated with the failed changefeed for 24 hours, preventing it from being garbage collected. +- `Failed`: The replication task fails. Due to some unrecoverable errors, the replication task cannot resume and cannot be recovered. To give you enough time to handle the failure, the changefeed in this state blocks GC operations. The duration of the blockage is specified by the `gc-ttl` parameter, with a default value of 24 hours. + +> **Note:** +> +> If the changefeed encounters errors with error codes `ErrGCTTLExceeded`, `ErrSnapshotLostByGC`, or `ErrStartTsBeforeGC`, it does not block GC operations. The numbers in the preceding state transfer diagram are described as follows. - ① Run the `changefeed pause` command. - ② Run the `changefeed resume` command to resume the replication task. -- ③ Recoverable errors occur during the `changefeed` operation, and the operation is resumed automatically. -- ④ Run the `changefeed resume` command to resume the replication task. -- ⑤ Unrecoverable errors occur during the `changefeed` operation. -- ⑥ `changefeed` has reached the preset `TargetTs`, and the replication is automatically stopped. -- ⑦ `changefeed` suspended longer than the duration specified by `gc-ttl`, and cannot be resumed. -- ⑧ `changefeed` experienced an unrecoverable error when trying to execute automatic recovery. +- ③ Recoverable errors occur during the `changefeed` operation, and the operation is retried automatically. +- ④ The changefeed automatic retry succeeds, and `checkpoint-ts` continues to advance. +- ⑤ The changefeed automatic retry exceeds 30 minutes and fails. The changefeed enters the failed state. At this time, the changefeed continues to block upstream GC for a duration specified by `gc-ttl`. +- ⑥ The changefeed encounters an unrecoverable error and directly enters the failed state. At this time, the changefeed continues to block upstream GC for a duration specified by `gc-ttl`. +- ⑦ The replication progress of the changefeed reaches the value set by `target-ts`, and the replication is completed. +- ⑧ The changefeed has been suspended for a duration longer than the value specified by `gc-ttl`, thus encountering GC advancement errors, and cannot be resumed. ## Operate changefeeds