Skip to content

feat: support disable retry sync for canal #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions canal/canal.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ func (c *Canal) prepareSyncer() error {
ParseTime: c.cfg.ParseTime,
SemiSyncEnabled: c.cfg.SemiSyncEnabled,
MaxReconnectAttempts: c.cfg.MaxReconnectAttempts,
DisableRetrySync: c.cfg.DisableRetrySync,
TimestampStringLocation: c.cfg.TimestampStringLocation,
TLSConfig: c.cfg.TLSConfig,
}
Expand Down
7 changes: 5 additions & 2 deletions canal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ type Config struct {
// SemiSyncEnabled enables semi-sync or not.
SemiSyncEnabled bool `toml:"semi_sync_enabled"`

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

// whether disable re-sync for broken connection
DisableRetrySync bool `toml:"disable_retry_sync"`

// Set TLS config
TLSConfig *tls.Config
}
Expand Down