Skip to content

Conversation

JojiiOfficial
Copy link
Contributor

No description provided.

)
assert response.status_code == 429
assert "Rate limiting exceeded: Write rate limit exceeded, retry later" in response.json()['status']['error']
Copy link
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

@@ -180,6 +180,40 @@ impl CollectionUpdateOperations {
Self::FieldIndexOperation(_) => (),
}
}

pub fn filter(&self) -> Option<&Filter> {
Copy link
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
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
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
17 checks passed
@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