[#1333] services/control: Allow to synchronize local trees

Do not check that a node indeed belongs to the container, because the
synchronization will fail in this case anyway.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-05-16 19:31:50 +03:00 committed by fyrchik
parent 0dc1a4e336
commit bfdd68dcb3
13 changed files with 836 additions and 180 deletions

View file

@ -40,6 +40,7 @@ import (
tsourse "github.com/nspcc-dev/neofs-node/pkg/services/object_manager/tombstone/source"
trustcontroller "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/controller"
truststorage "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/storage"
"github.com/nspcc-dev/neofs-node/pkg/services/tree"
"github.com/nspcc-dev/neofs-node/pkg/services/util/response"
"github.com/nspcc-dev/neofs-node/pkg/util"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
@ -111,6 +112,8 @@ type cfg struct {
cfgControlService cfgControlService
treeService *tree.Service
healthStatus *atomic.Int32
closers []func()

View file

@ -43,6 +43,7 @@ func initControlService(c *cfg) {
return err
}),
controlSvc.WithLocalStorage(c.cfgObject.cfgLocalStorage.localStorage),
controlSvc.WithTreeService(c.treeService),
)
lis, err := net.Listen("tcp", endpoint)

View file

@ -7,7 +7,7 @@ import (
)
func initTreeService(c *cfg) {
treeSvc := tree.New(
c.treeService = tree.New(
tree.WithContainerSource(c.cfgObject.cnrSource),
tree.WithNetmapSource(c.netMapSource),
tree.WithPrivateKey(&c.key.PrivateKey),
@ -15,12 +15,12 @@ func initTreeService(c *cfg) {
tree.WithStorage(c.cfgObject.cfgLocalStorage.localStorage))
for _, srv := range c.cfgGRPC.servers {
tree.RegisterTreeServiceServer(srv, treeSvc)
tree.RegisterTreeServiceServer(srv, c.treeService)
}
c.workers = append(c.workers, newWorkerFromFunc(func(ctx context.Context) {
treeSvc.Start(ctx)
c.treeService.Start(ctx)
}))
c.onShutdown(treeSvc.Shutdown)
c.onShutdown(c.treeService.Shutdown)
}