forked from TrueCloudLab/frostfs-node
[#1900] node: Do not override maintenance state on bootstrap
In previous implementation node always sent bootstrap requests with "online" network state. This provoked switching to online of the nodes under maintenance. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
parent
f76516a883
commit
d96139b201
1 changed files with 15 additions and 1 deletions
|
@ -837,8 +837,22 @@ func (c *cfg) handleLocalNodeInfo(ni *netmap.NodeInfo) {
|
||||||
// bootstrap sets local node's netmap status to "online".
|
// bootstrap sets local node's netmap status to "online".
|
||||||
func (c *cfg) bootstrap() error {
|
func (c *cfg) bootstrap() error {
|
||||||
ni := c.cfgNodeInfo.localInfo
|
ni := c.cfgNodeInfo.localInfo
|
||||||
|
|
||||||
|
// switch to online except when under maintenance
|
||||||
|
if st := c.cfgNetmap.state.controlNetmapStatus(); st == control.NetmapStatus_MAINTENANCE {
|
||||||
|
ni.SetMaintenance()
|
||||||
|
|
||||||
|
c.log.Info("bootstrap with untouched node state",
|
||||||
|
zap.Stringer("state", st),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
ni.SetOnline()
|
ni.SetOnline()
|
||||||
|
|
||||||
|
c.log.Info("bootstrapping with online state",
|
||||||
|
zap.Stringer("previous", st),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
prm := nmClient.AddPeerPrm{}
|
prm := nmClient.AddPeerPrm{}
|
||||||
prm.SetNodeInfo(ni)
|
prm.SetNodeInfo(ni)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue