How to understand the relationship between the TiCDC time zone and the time zones of the upstream/downstream databases?

Upstream time zone TiCDC time zone Downstream time zone
Configuration method See Time Zone Support Configured using the --tz parameter when you start the TiCDC server Configured using the time-zone parameter in sink-uri
Description The time zone of the upstream TiDB, which affects DML operations of the timestamp type and DDL operations related to timestamp type columns. TiCDC assumes that the upstream TiDB’s time zone is the same as the TiCDC time zone configuration, and performs related operations on the timestamp column. The downstream MySQL processes the timestamp in the DML and DDL operations according to the downstream time zone setting.

Note:

Be careful when you set the time zone of the TiCDC server, because this time zone is used for converting the time type. Keep the upstream time zone, TiCDC time zone, and the downstream time zone consistent. The TiCDC server chooses its time zone in the following priority:

  • TiCDC first uses the time zone specified using --tz.
  • When --tz is not available, TiCDC tries to read the time zone set using the TZ environment variable.
  • When the TZ environment variable is not available, TiCDC uses the default time zone of the machine.