Doc Menu

TiDB Binlog Glossary

This document lists the terms used in the logs, monitoring, configurations, and documentation of TiDB Binlog.

Binlog

In TiDB Binlog, binlogs refer to the binary log data from TiDB. They also refer to the binary log data that Drainer writes to Kafka or files. The former and the latter are in different formats. In addition, binlogs in TiDB and binlogs in MySQL are also in different formats.

Binlog event

The DML binlogs from TiDB have three types of event: INSERT, UPDATE, and DELETE. In the monitoring dashboard of Drainer, you can see the number of different events that correspond to the replication data.

Checkpoint

A checkpoint indicates the position from which a replication task is paused and resumed, or is stopped and restarted. It records the commit-ts that Drainer replicates to the downstream. When restarted, Drainer reads the checkpoint and starts replicating data from the corresponding commit-ts.

Safe mode

Safe mode refers to the mode that supports the idempotent import of DML when a primary key or unique index exists in the table schema in the incremental replication task.

In this mode, the INSERT statement is re-written as REPLACE, and the UPDATE statement is re-written as DELETE and REPLACE. Then the re-written statement is executed to the downstream. Safe mode is automatically enabled within 5 minutes after Drainer is started. You can manually enable the mode by modifying the safe-mode parameter in the configuration file, but this configuration is valid only when the downstream is MySQL or TiDB.