Skip to content

container: reduce the number of fetched iterator items#3558

Merged
cthulhu-rider merged 1 commit intomasterfrom
fix-2K-container-listing
Sep 4, 2025
Merged

container: reduce the number of fetched iterator items#3558
cthulhu-rider merged 1 commit intomasterfrom
fix-2K-container-listing

Conversation

@roman-khimov
Copy link
Member

An attempt to list 2K+ containers ended up this way:

error	handler/util.go:34	call method	{"status": 500, "request_id": "0cedec2b-935d-4575-a0c2-94ed4650c978", "method": "ListBuckets", "bucket": "", "object": "", "description": "something went wrong", "error": "list user containers via connection pool: status: code = 1024 message = json error: too big: size"}

We're trying to get 2K items from the iterator in a single call, each item is base64 of CID, so it's 42 bytes, but then it's wrapped into VM type/value struct like this:

{"value":"","type":"ByteString"}

which adds another 32 bytes. For 2K elements this yields 144K JSON (not including other data which is also present) which NeoGo refuses to return given that the maximum size is 128K (nspcc-dev/neo-go#3185). Fetching in smaller chunks should fix the problem (for other iterator-based methods as well).

An attempt to list 2K+ containers ended up this way:

    error	handler/util.go:34	call method	{"status": 500, "request_id": "0cedec2b-935d-4575-a0c2-94ed4650c978", "method": "ListBuckets", "bucket": "", "object": "", "description": "something went wrong", "error": "list user containers via connection pool: status: code = 1024 message = json error: too big: size"}

We're trying to get 2K items from the iterator in a single call, each item is
base64 of CID, so it's 42 bytes, but then it's wrapped into VM type/value
struct like this:

    {"value":"","type":"ByteString"}

which adds another 32 bytes. For 2K elements this yields 144K JSON (not
including other data which is also present) which NeoGo refuses to return
given that the maximum size is 128K (nspcc-dev/neo-go#3185).
Fetching in smaller chunks should fix the problem (for other iterator-based
methods as well).

Signed-off-by: Roman Khimov <roman@nspcc.ru>
@roman-khimov roman-khimov added this to the v0.49.0 milestone Sep 4, 2025
@roman-khimov roman-khimov added bug Something isn't working neofs-storage Storage node application issues U1 Critically important to resolve quickly S4 Routine I4 No visible changes labels Sep 4, 2025
@codecov
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.66%. Comparing base (a5ffd32) to head (7de00d5).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3558   +/-   ##
=======================================
  Coverage   25.65%   25.66%           
=======================================
  Files         661      661           
  Lines       49451    49451           
=======================================
+ Hits        12688    12691    +3     
+ Misses      35755    35752    -3     
  Partials     1008     1008           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cthulhu-rider cthulhu-rider merged commit 0ea1472 into master Sep 4, 2025
22 checks passed
@cthulhu-rider cthulhu-rider deleted the fix-2K-container-listing branch September 4, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working I4 No visible changes neofs-storage Storage node application issues S4 Routine U1 Critically important to resolve quickly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants