forked from TrueCloudLab/frostfs-node
[#1680] service/object: Fail all operations in maintenance mode
Storage node should not provide NeoFS Object API service when it is under maintenance. Declare `Common` service that unifies behavior of all object operations. The implementation pre-checks if node is under maintenance and returns `apistatus.NodeUnderMaintenance` if so. Use `Common` service as a first logical processor in object service pipeline. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
parent
05420173cc
commit
1406d096a2
7 changed files with 98 additions and 47 deletions
|
@ -10,7 +10,6 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
||||
internal "github.com/nspcc-dev/neofs-node/pkg/services/object/internal/client"
|
||||
internalclient "github.com/nspcc-dev/neofs-node/pkg/services/object/internal/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
||||
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
)
|
||||
|
@ -30,8 +29,6 @@ type clientWrapper struct {
|
|||
}
|
||||
|
||||
type storageEngineWrapper struct {
|
||||
state util.NodeState
|
||||
|
||||
engine *engine.StorageEngine
|
||||
}
|
||||
|
||||
|
@ -199,11 +196,6 @@ func (c *clientWrapper) get(exec *execCtx, key *ecdsa.PrivateKey) (*object.Objec
|
|||
}
|
||||
|
||||
func (e *storageEngineWrapper) get(exec *execCtx) (*object.Object, error) {
|
||||
if e.state != nil && e.state.IsMaintenance() {
|
||||
var st apistatus.NodeUnderMaintenance
|
||||
return nil, st
|
||||
}
|
||||
|
||||
if exec.headOnly() {
|
||||
var headPrm engine.HeadPrm
|
||||
headPrm.WithAddress(exec.address())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue