Skip to content

Commit 550d774

Browse files
authored
feat: support disable retry sync for canal (#507)
1 parent 443bd09 commit 550d774

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

canal/canal.go

+1
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ func (c *Canal) prepareSyncer() error {
424424
ParseTime: c.cfg.ParseTime,
425425
SemiSyncEnabled: c.cfg.SemiSyncEnabled,
426426
MaxReconnectAttempts: c.cfg.MaxReconnectAttempts,
427+
DisableRetrySync: c.cfg.DisableRetrySync,
427428
TimestampStringLocation: c.cfg.TimestampStringLocation,
428429
TLSConfig: c.cfg.TLSConfig,
429430
}

canal/config.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,13 @@ type Config struct {
7777
// SemiSyncEnabled enables semi-sync or not.
7878
SemiSyncEnabled bool `toml:"semi_sync_enabled"`
7979

80-
// Set to change the maximum number of attempts to re-establish a broken
81-
// connection
80+
// maximum number of attempts to re-establish a broken connection, zero or negative number means infinite retry.
81+
// this configuration will not work if DisableRetrySync is true
8282
MaxReconnectAttempts int `toml:"max_reconnect_attempts"`
8383

84+
// whether disable re-sync for broken connection
85+
DisableRetrySync bool `toml:"disable_retry_sync"`
86+
8487
// Set TLS config
8588
TLSConfig *tls.Config
8689
}

0 commit comments

Comments
 (0)