From 382ecae96a2da280549fe04c9ca6a2b15658b956 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 24 Mar 2023 11:57:35 +0300 Subject: [PATCH] [#172] Use ContainersOf() for container list fetching Previously we were limited by ~2048 containers because of neo-go VM limits. Signed-off-by: Evgenii Stratonikov --- cmd/frostfs-node/cache.go | 4 ++-- cmd/frostfs-node/tree.go | 2 +- pkg/innerring/processors/audit/scheduler.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/frostfs-node/cache.go b/cmd/frostfs-node/cache.go index 248c92ef01..eda691496b 100644 --- a/cmd/frostfs-node/cache.go +++ b/cmd/frostfs-node/cache.go @@ -242,7 +242,7 @@ func newCachedContainerLister(c *cntClient.Client, ttl time.Duration) ttlContain } } - list, err := c.List(id) + list, err := c.ContainersOf(id) if err != nil { return nil, err } @@ -260,7 +260,7 @@ func newCachedContainerLister(c *cntClient.Client, ttl time.Duration) ttlContain // the cache. func (s ttlContainerLister) List(id *user.ID) ([]cid.ID, error) { if id == nil { - return s.client.List(nil) + return s.client.ContainersOf(nil) } item, err := s.inner.get(id.EncodeToString()) diff --git a/cmd/frostfs-node/tree.go b/cmd/frostfs-node/tree.go index cee32a0b69..93a364471d 100644 --- a/cmd/frostfs-node/tree.go +++ b/cmd/frostfs-node/tree.go @@ -31,7 +31,7 @@ func (c cnrSource) Get(id cid.ID) (*container.Container, error) { } func (c cnrSource) List() ([]cid.ID, error) { - return c.cli.List(nil) + return c.cli.ContainersOf(nil) } func initTreeService(c *cfg) { diff --git a/pkg/innerring/processors/audit/scheduler.go b/pkg/innerring/processors/audit/scheduler.go index dd660d4e19..e1a521bad4 100644 --- a/pkg/innerring/processors/audit/scheduler.go +++ b/pkg/innerring/processors/audit/scheduler.go @@ -13,7 +13,7 @@ import ( var ErrInvalidIRNode = errors.New("node is not in the inner ring list") func (ap *Processor) selectContainersToAudit(epoch uint64) ([]cid.ID, error) { - containers, err := ap.containerClient.List(nil) + containers, err := ap.containerClient.ContainersOf(nil) if err != nil { return nil, fmt.Errorf("can't get list of containers to start audit: %w", err) }