clickhouse-sink-connector icon indicating copy to clipboard operation
clickhouse-sink-connector copied to clipboard

The lag is increasing if the tables are not updated.

Open aadant opened this issue 9 months ago • 0 comments

How to reproduce :

  • replicate a table only

in config.yml

table.include.list: "mydb.mytable"
  • do not write to the table on the source database side

  • monitor the lag

select * from altinity_sink_connector.show_replica_status\G

The lag increases if this table does not get written and the binary log position does not move. It should be synced periodically to show the binary log progress.

Workaround :

  • include a heartbeat table (see https://docs.percona.com/percona-toolkit/pt-heartbeat.html) example
CREATE TABLE pt_heartbeat_db.heartbeat (
  id int NOT NULL PRIMARY KEY,
  ts datetime NOT NULL
);

and

table.include.list: "mydb.mytable,pt_heartbeat_db.heartbeat"

Such an heartbeat table is strongly recommended in any replicated setup (MySQL, Postgres, ...)

Without a fix, a filtered replication setup without updates could cause replication to break if the binary log position saved in altinity_sink_connector.replica_source_info is not longer present on the source database.

aadant avatar May 17 '24 22:05 aadant