Stay in maintenance mode unless other is requested manually #409

Merged
fyrchik merged 1 commit from fyrchik/frostfs-node:fix-maintenance-persistence into support/v0.36 2023-07-26 21:07:58 +00:00

View file

@ -253,6 +253,10 @@ func readSubnetCfg(c *cfg) {
// Must be called after initNetmapService. // Must be called after initNetmapService.
func bootstrapNode(c *cfg) { func bootstrapNode(c *cfg) {
if c.needBootstrap() { if c.needBootstrap() {
if c.IsMaintenance() {
c.log.Info("the node is under maintenance, skip initial bootstrap")
return
}
err := c.bootstrap() err := c.bootstrap()
fatalOnErrDetails("bootstrap error", err) fatalOnErrDetails("bootstrap error", err)
} }
@ -294,6 +298,10 @@ func initNetmapState(c *cfg) {
zap.String("state", stateWord), zap.String("state", stateWord),
) )
if ni != nil && ni.IsMaintenance() {
c.isMaintenance.Store(true)
}
c.cfgNetmap.state.setCurrentEpoch(epoch) c.cfgNetmap.state.setCurrentEpoch(epoch)
c.cfgNetmap.startEpoch = epoch c.cfgNetmap.startEpoch = epoch
c.handleLocalNodeInfo(ni) c.handleLocalNodeInfo(ni)