[#409] node: Do not sent initial bootstrap under maintenance

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-05-29 18:33:52 +03:00
parent a7dab2a22b
commit 405e17b2ec

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)