File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -83,9 +83,13 @@ type BinlogSyncerConfig struct {
83
83
// read timeout
84
84
ReadTimeout time.Duration
85
85
86
- // maximum number of attempts to re-establish a broken connection
86
+ // maximum number of attempts to re-establish a broken connection, zero or negative number means infinite retry.
87
+ // this configuration will not work if DisableRetrySync is true
87
88
MaxReconnectAttempts int
88
89
90
+ // whether disable re-sync for broken connection
91
+ DisableRetrySync bool
92
+
89
93
// Only works when MySQL/MariaDB variable binlog_checksum=CRC32.
90
94
// For MySQL, binlog_checksum was introduced since 5.6.2, but CRC32 was set as default value since 5.6.6 .
91
95
// https://dev.mysql.com/doc/refman/5.6/en/replication-options-binary-log.html#option_mysqld_binlog-checksum
@@ -645,6 +649,12 @@ func (b *BinlogSyncer) onStream(s *BinlogStreamer) {
645
649
return
646
650
}
647
651
652
+ if b .cfg .DisableRetrySync {
653
+ log .Warn ("retry sync is disabled" )
654
+ s .closeWithError (err )
655
+ return
656
+ }
657
+
648
658
for {
649
659
select {
650
660
case <- b .ctx .Done ():
You can’t perform that action at this time.
0 commit comments