mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
修复:MASTER_HEARTBEAT_PERIOD 的计量单位是秒(可以包含3位小数表示毫秒),但不是纳秒。
This commit is contained in:
@@ -297,9 +297,15 @@ public class MysqlConnection implements ErosaConnection {
|
|||||||
logger.warn("update mariadb_slave_capability failed", e);
|
logger.warn("update mariadb_slave_capability failed", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
long periodNano = TimeUnit.SECONDS.toNanos(MASTER_HEARTBEAT_PERIOD_SECONDS);
|
/**
|
||||||
|
* MASTER_HEARTBEAT_PERIOD sets the interval in seconds between replication heartbeats.
|
||||||
|
* Whenever the master's binary log is updated with an event, the waiting period for the next heartbeat is reset.
|
||||||
|
* interval is a decimal value having the range 0 to 4294967 seconds and a resolution in milliseconds;
|
||||||
|
* the smallest nonzero value is 0.001. Heartbeats are sent by the master only if there are no unsent events
|
||||||
|
* in the binary log file for a period longer than interval.
|
||||||
|
*/
|
||||||
try {
|
try {
|
||||||
update("SET @master_heartbeat_period=" + periodNano);
|
update("SET @master_heartbeat_period=" + MASTER_HEARTBEAT_PERIOD_SECONDS);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn("update master_heartbeat_period failed", e);
|
logger.warn("update master_heartbeat_period failed", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user