forked from TrueCloudLab/frostfs-node
[#409] node: Do not sent initial bootstrap under maintenance
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
a7dab2a22b
commit
405e17b2ec
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue