mirror of
https://github.com/nspcc-dev/neofs-node.git
synced 2026-03-01 04:29:10 +00:00
SearchV2 DOS protection #1357
Labels
No labels
I1
I2
I3
I4
S0
S1
S2
S3
S4
U0
U1
U2
U3
U4
blocked
bug
config
dependencies
discussion
documentation
enhancement
enhancement
epic
feature
go
good first issue
help wanted
neofs-adm
neofs-cli
neofs-cli
neofs-cli
neofs-ir
neofs-lens
neofs-storage
neofs-storage
performance
question
security
task
test
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-node#1357
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roman-khimov on GitHub (Feb 24, 2025).
Is your feature request related to a problem? Please describe.
I'm always frustrated when I realize that specifically crafted SearchV2 requests can make the node spend a lot of CPU cycles for nothing. Normal requests that want to quickly find something are no longer a problem, but some other can be.
Describe the solution you'd like
Add an iteration limit to the SearchV2 implementation. If we're making like 10K iterations with no results we're done, internal error is returned. The parameter is node-specific with this 10K default.
Describe alternatives you've considered
Time limits, but they're harder to check.
Additional context
#3058
@carpawell commented on GitHub (Feb 24, 2025):
What "iterations" means here?
@roman-khimov commented on GitHub (Feb 24, 2025):
Keys evaluated as per primary index.
@carpawell commented on GitHub (Feb 24, 2025):
So your suggestion does not allow to find (10K+1)th element ever?
@roman-khimov commented on GitHub (Feb 24, 2025):
SV2 works with 1000 items returned along with the continuation token normally and this will still work for regular uses since there is just 1000 iterations per request. But if you have 6M objects in a container you can create a query for non-existing object and I don't want to scan 6M (or whatever per-node share of it) of entries to answer that.