Skip to content
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

add repl_mon chech in async mode #111

Merged
merged 1 commit into from
Jun 24, 2024
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
8 changes: 5 additions & 3 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,9 +758,11 @@ func (app *App) stateManager() appState {
app.logger.Errorf("failed to update active nodes in dcs: %v", err)
}

err = app.updateReplMonTS(master)
if err != nil {
app.logger.Errorf("failed to update repl_mon timestamp: %v", err)
if app.config.ReplMon {
err = app.updateReplMonTS(master)
if err != nil {
app.logger.Errorf("failed to update repl_mon timestamp: %v", err)
}
}

return stateManager
Expand Down
3 changes: 3 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,8 @@ func (cfg *Config) Validate() error {
if cfg.SemiSync && cfg.ASync {
return fmt.Errorf("can't run in both semisync and async mode")
}
if cfg.ASync && !cfg.ReplMon {
return fmt.Errorf("repl mon must be enabled to run mysync in async mode")
}
return nil
}
Loading