From 405e17b2ec13d38a16a7f7c84fef611a445907e3 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 29 May 2023 18:33:52 +0300 Subject: [PATCH] [#409] node: Do not sent initial bootstrap under maintenance Signed-off-by: Evgenii Stratonikov --- cmd/frostfs-node/netmap.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/frostfs-node/netmap.go b/cmd/frostfs-node/netmap.go index 8bf7c664..62d7486f 100644 --- a/cmd/frostfs-node/netmap.go +++ b/cmd/frostfs-node/netmap.go @@ -253,6 +253,10 @@ func readSubnetCfg(c *cfg) { // Must be called after initNetmapService. func bootstrapNode(c *cfg) { if c.needBootstrap() { + if c.IsMaintenance() { + c.log.Info("the node is under maintenance, skip initial bootstrap") + return + } err := c.bootstrap() fatalOnErrDetails("bootstrap error", err) } @@ -294,6 +298,10 @@ func initNetmapState(c *cfg) { zap.String("state", stateWord), ) + if ni != nil && ni.IsMaintenance() { + c.isMaintenance.Store(true) + } + c.cfgNetmap.state.setCurrentEpoch(epoch) c.cfgNetmap.startEpoch = epoch c.handleLocalNodeInfo(ni)