Skip to content

Commit f65ec96

Browse files
committed
Add master slave replication heartbeat configuration in binlog client
1 parent d07f233 commit f65ec96

File tree

1 file changed

+5
-0
lines changed
  • kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client

1 file changed

+5
-0
lines changed

kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/MySQLBinlogClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public synchronized InternalResultSet executeQuery(final String queryString) {
176176
*/
177177
public synchronized void subscribe(final String binlogFileName, final long binlogPosition) {
178178
initDumpConnectSession();
179+
configureHeartbeat();
179180
registerSlave();
180181
dumpBinlog(binlogFileName, binlogPosition, queryChecksumLength());
181182
log.info("subscribe binlog file: {}, position: {}", binlogFileName, binlogPosition);
@@ -187,6 +188,10 @@ private void initDumpConnectSession() {
187188
}
188189
}
189190

191+
private void configureHeartbeat() {
192+
execute("SET @master_heartbeat_period=15000000");
193+
}
194+
190195
private void registerSlave() {
191196
responseCallback = new DefaultPromise<>(eventLoopGroup.next());
192197
InetSocketAddress localAddress = (InetSocketAddress) channel.localAddress();

0 commit comments

Comments
 (0)