Conversation
a55ed21 to
d6b6f9b
Compare
bb0f224 to
d7606ce
Compare
d7606ce to
3ff070e
Compare
internal/app/app.go
Outdated
| if lightMaintenance { | ||
| app.logger.Info("entering light maintenance mode") | ||
| if maintenance.ShouldLeave { | ||
| app.tryLeaveMaintenance() |
There was a problem hiding this comment.
is return not needed here (app.tryLeaveMaintenance())?
internal/app/app.go
Outdated
| return stateManager | ||
| } else { | ||
| app.logger.Errorf("failover was not approved: %v", err) | ||
| app.t.Clean(NodeFailedAt, master) |
There was a problem hiding this comment.
We don't have to do this(app.t.Clean(NodeFailedAt, master) in lightMaintenance, right?
internal/app/data.go
Outdated
|
|
||
| // Maintenance struct presence means that cluster under manual control | ||
| // Light mode allows everything except failover and switchover | ||
| const maintenanceModeLight = "light" |
There was a problem hiding this comment.
Let's make a separate type for this?
Like MasterTransition.
String() method should be simplified, and func args would be more strict
internal/app/app.go
Outdated
| if err != nil { | ||
| app.logger.Error(err.Error()) | ||
| if lightMaintenance { | ||
| app.logger.Infof("after-crash failover suppressed by light maintenance mode") |
There was a problem hiding this comment.
I guess, we don't need to write this msg every iteration.
Let's move it inside if?
internal/app/cli_maintenance.go
Outdated
| app.logger.Error(err.Error()) | ||
| } | ||
| if maintenance.MySyncPaused { | ||
| if maintenance.IsLightMode() || maintenance.MySyncPaused { |
There was a problem hiding this comment.
We may move this to method, like "MaintAcquired()", and use it below
internal/app/app.go
Outdated
| if err != nil { | ||
| app.logger.Error(err.Error()) | ||
| if lightMaintenance { | ||
| app.logger.Infof("failover suppressed by light maintenance mode") |
There was a problem hiding this comment.
We should move this log below, after "MASTER FAILURE"
So, we would know, that we were supposed to issuse failover, but it was suppressed by lightMaintenance
58aad56 to
e9cf3fb
Compare
Introduce light maintenance mode. In this mode, mysync nodes don't go into MaintenanceState.
All mysync actions are available except switchover and failover