[#490] cmd/neofs-node: Do not send rebootstrap after node went offline

Control service turns storage node to online and offline modes. We can't
reuse `cfgNetmap.reBootstrapEnabled` because it represents configuration
value while control service manages state in runtime.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-04-21 16:26:04 +03:00 committed by Alex Vanin
parent de74fcc38f
commit e9b3488aab
2 changed files with 10 additions and 1 deletions

View file

@ -262,7 +262,8 @@ type cfgNetmap struct {
state *networkState
reBootstrapEnabled bool
reBootstrapInterval uint64 // in epochs
reBoostrapTurnedOff *atomic.Bool // managed by control service in runtime
reBootstrapInterval uint64 // in epochs
goOfflineEnabled bool // send `UpdateState(offline)` tx at shutdown
}
@ -377,6 +378,7 @@ func initCfg(path string) *cfg {
workerPool: netmapWorkerPool,
reBootstrapInterval: viperCfg.GetUint64(cfgReBootstrapInterval),
reBootstrapEnabled: viperCfg.GetBool(cfgReBootstrapEnabled),
reBoostrapTurnedOff: atomic.NewBool(false),
goOfflineEnabled: viperCfg.GetBool(cfgShutdownOfflineEnabled),
},
cfgNodeInfo: cfgNodeInfo{