Skip to content

Consider filter cardinality in write ratelimiter for update-by-filter requests#5729

Merged
generall merged 4 commits intodevfrom
rate_limiter_update_by_filter
Jan 8, 2025
Merged

Consider filter cardinality in write ratelimiter for update-by-filter requests#5729
generall merged 4 commits intodevfrom
rate_limiter_update_by_filter

Conversation

@JojiiOfficial
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread tests/openapi/test_strictmode.py Outdated
}
)
assert response.status_code == 429
assert "Rate limiting exceeded: Write rate limit exceeded, retry later" in response.json()['status']['error']
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that we are assigning different rate limits to different operations, this information should be represented in the response error. Something like operation require X units, but Y availble, otherwise it would be confusing to debug

Comment thread lib/collection/src/operations/mod.rs Outdated
}
}

pub fn filter(&self) -> Option<&Filter> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have this

impl EstimateOperationEffectArea for CollectionUpdateOperations {

Which might be both: a better fit (cause also includes points, which we need to count as individual updates as well), and require some upgrade, cause we might not want to clone Filter

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This operation effect area is only used in ProxyShard, but ProxyShard itself is not used anywhere, so, if needed, we can change some stuff in the signatures if needed

@JojiiOfficial JojiiOfficial requested a review from generall January 7, 2025 11:43
Copy link
Copy Markdown
Member

@agourlay agourlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup on the clones 👍

@generall generall merged commit 0391891 into dev Jan 8, 2025
@generall generall deleted the rate_limiter_update_by_filter branch January 8, 2025 17:12
timvisee pushed a commit that referenced this pull request Jan 16, 2025
* Consider filter-cardinality as cost in update ratelimiter

* Use OperationEffectArea and improve rate limit error message

* Clippy

* Fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants