Search code examples
mysqldatabase-replication

Is it possible to have a millisecond precision for the Timestamp in a BinLog for mysql replicator


I have a mysql Cluster with master slave replication. All the binlogs we are seeing has timestamp upto seconds in binlogs. Is it possible to track the time to milliseconds. So our CDC can handle cases with multiple instances in 1 seconds.


Solution

  • Binlog events do not store millisecond precision for the event timestamp. They store event timestamp as a 4-byte time_t in seconds.

    Cf. https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_replication_binlog_event.html