forked from TrueCloudLab/frostfs-node
[#1900] node: Fix loosing the "maintenance" status
In previous implementation node lost maintenance status after successful switching to it. For example, after some period of time node sent bootstrap requests with the "online" state instead of "maintenance". Make `startMaintenance` method to set maintenance status in the `networkState`. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
parent
db92e96e40
commit
98034005f1
3 changed files with 11 additions and 2 deletions
|
@ -84,7 +84,14 @@ func (s *networkState) setNodeInfo(ni *netmapSDK.NodeInfo) {
|
|||
}
|
||||
}
|
||||
|
||||
s.controlNetStatus.Store(ctrlNetSt)
|
||||
s.setControlNetmapStatus(ctrlNetSt)
|
||||
}
|
||||
|
||||
// sets the current node state to the given value. Subsequent cfg.bootstrap
|
||||
// calls will process this value to decide what status node should set in the
|
||||
// network.
|
||||
func (s *networkState) setControlNetmapStatus(st control.NetmapStatus) {
|
||||
s.controlNetStatus.Store(st)
|
||||
}
|
||||
|
||||
func (s *networkState) controlNetmapStatus() (res control.NetmapStatus) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue