Sign In Try Free

Changefeed Overview

A changefeed is a replication task in TiCDC, which replicates the data change logs of specified tables in a TiDB cluster to the designated downstream. You can run and manage multiple changefeeds in a TiCDC cluster.

Changefeed state transfer

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 specifiedTargetTs. 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

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.
  • 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 toNormal. 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 presetTargetTs. 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. 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 thegc-ttl参数,默认值为24小时s.

The numbers in the preceding state transfer diagram are described as follows.

  • ① Run thechangefeed pausecommand.
  • ② Run thechangefeed resumecommand to resume the replication task.
  • ③ Recoverable errors occur during thechangefeedoperation, and the operation is retried automatically.
  • ④ The changefeed automatic retry succeeds, andcheckpoint-tscontinues 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 bygc-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 bygc-ttl.
  • ⑦ The replication progress of the changefeed reaches the value set bytarget-ts, and the replication is completed.
  • ⑧ The changefeed has been suspended for a duration longer than the value specified bygc-ttl, thus encountering GC advancement errors, and cannot be resumed.

Operate changefeeds

You can manage a TiCDC cluster and its replication tasks using the command-line toolcdc cli. For details, seeManage TiCDC changefeeds.

You can also use the HTTP interface (the TiCDC OpenAPI feature) to manage a TiCDC cluster and its replication tasks. For details, seeTiCDC OpenAPI.

If your TiCDC is deployed using TiUP, you can startcdc cliby running thetiup ctl:v cdccommand. Replacevwith the TiCDC cluster version, such asv7.1.2. You can also runcdc clidirectly.

Download PDF Request docs changes Ask questions on Discord
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Was this page helpful?
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
©2023PingCAP. All Rights Reserved.