2023-08-29 12:28:00.050 [Task-7-Reader-reader-mysql] INFO c.a.otter.canal.server.embedded.CanalServerWithEmbedded - getWithoutAck successfully, client
Id:1001 batchSize:2000 real size is 2 and result is [batchId:11245 , position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=xxx,slaveId=-1],postion=EntryPosition[included=false,journalName=mysql-bin.001061,position=2145,s
erverId=3010567333,gtid=,timestamp=1693312070000]],ack=LogPosition[identity=LogIdentity[sourceAddress=xxx,slaveId=-1],postion=EntryPosition[included=false,journalName=mysql-bin.001061,position=2318,serverId=3010567333,gtid=,timestamp=169331207
0000]],end=LogPosition[identity=LogIdentity[sourceAddress=xxx,slaveId=-1],postion=EntryPosit
ion[included=false,journalName=mysql-bin.001061,position=2318,serverId=3010567333,gtid=,timestamp=1693312070000]],endSeq=87125]]
2023-08-29 12:28:00.050 [Task-7-Reader-reader-mysql] INFO c.a.otter.canal.server.embedded.CanalServerWithEmbedded - getWithoutAck successfully, client Id:1001 batchSize:2000 real size is 2 and result is [batchId:11245 , position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=xxx,slaveId=-1],postion=EntryPosition[included=false,journalName=mysql-bin.001061,position=2145,s erverId=3010567333,gtid=,timestamp=1693312070000]],ack=LogPosition[identity=LogIdentity[sourceAddress=xxx,slaveId=-1],postion=EntryPosition[included=false,journalName=mysql-bin.001061,position=2318,serverId=3010567333,gtid=,timestamp=169331207 0000]],end=LogPosition[identity=LogIdentity[sourceAddress=xxx,slaveId=-1],postion=EntryPosit ion[included=false,journalName=mysql-bin.001061,position=2318,serverId=3010567333,gtid=,timestamp=1693312070000]],endSeq=87125]]
比如上面的Canal拉取日志: 拉取日志时间为: 2023-08-29 12:28:00 , 但是返回结果中binlog的timestamp: 1693312070000转成UTC时间是:2023-08-29 12:27:50, 比当前时间少了10秒, 这不是偶发而是一直保持10秒左右的差异,即使数据量很少的情况下,这个问题的影响是数据同步存在延迟, 造成这个现象可能原因是什么?
其中canal.server版本:
PS: 数据库主从延迟2ms左右,不是主从延迟的问题