[#1681] node: Block only Object service ops under maintenance
In previous implementation node blocked any operation of local object storage in maintenance mode. There is a need to perform some storage operations like data evacuation or restoration. Do not call block storage engine in maintenance mode. Make all Object service operations to return `apistatus.NodeUnderMaintenance` error from each local op. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
parent
082602b668
commit
713aea06fa
8 changed files with 86 additions and 31 deletions
|
@ -335,6 +335,28 @@ type cfg struct {
|
|||
|
||||
// current network map
|
||||
netMap atomicstd.Value // type netmap.NetMap
|
||||
|
||||
// is node under maintenance
|
||||
isMaintenance atomic.Bool
|
||||
}
|
||||
|
||||
// starts node's maintenance.
|
||||
func (c *cfg) startMaintenance() {
|
||||
c.isMaintenance.Store(true)
|
||||
c.log.Info("started local node's maintenance")
|
||||
}
|
||||
|
||||
// stops node's maintenance.
|
||||
func (c *cfg) stopMaintenance() {
|
||||
c.isMaintenance.Store(false)
|
||||
c.log.Info("stopped local node's maintenance")
|
||||
}
|
||||
|
||||
// IsMaintenance checks if storage node is under maintenance.
|
||||
//
|
||||
// Provides util.NodeState to Object service.
|
||||
func (c *cfg) IsMaintenance() bool {
|
||||
return c.isMaintenance.Load()
|
||||
}
|
||||
|
||||
// ReadCurrentNetMap reads network map which has been cached at the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue