-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Consider filter cardinality in write ratelimiter for update-by-filter requests #5729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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'] |
There was a problem hiding this comment.
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
lib/collection/src/operations/mod.rs
Outdated
@@ -180,6 +180,40 @@ impl CollectionUpdateOperations { | |||
Self::FieldIndexOperation(_) => (), | |||
} | |||
} | |||
|
|||
pub fn filter(&self) -> Option<&Filter> { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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 👍
* Consider filter-cardinality as cost in update ratelimiter * Use OperationEffectArea and improve rate limit error message * Clippy * Fix test
No description provided.