diff --git a/pkg/sink/codec/debezium/encoder.go b/pkg/sink/codec/debezium/encoder.go index 085a292ffd0..2ffdb1b6ba4 100644 --- a/pkg/sink/codec/debezium/encoder.go +++ b/pkg/sink/codec/debezium/encoder.go @@ -37,6 +37,9 @@ type BatchEncoder struct { // EncodeCheckpointEvent implements the RowEventEncoder interface func (d *BatchEncoder) EncodeCheckpointEvent(ts uint64) (*common.Message, error) { + if !d.config.EnableTiDBExtension { + return nil, nil + } keyMap := bytes.Buffer{} valueBuf := bytes.Buffer{} err := d.codec.EncodeCheckpointEvent(ts, &keyMap, &valueBuf)