Skip to content

Commit

Permalink
add repl_mon chech in async mode (#111)
Browse files Browse the repository at this point in the history
Co-authored-by: suetin <[email protected]>
  • Loading branch information
moridin26 and suetin authored Jun 24, 2024
1 parent 5914154 commit eff3563
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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
}

0 comments on commit eff3563

Please sign in to comment.