Skip to content

Add strict mode for max points count - #5967

Merged
agourlay merged 2 commits into
devfrom
strict-mode-max-point-count
Feb 12, 2025
Merged

agourlay merged 2 commits into
devfrom
strict-mode-max-point-count

Conversation

@agourlay

@agourlay agourlay commented Feb 11, 2025 •

Copy link
Copy Markdown
Member

New strict mode config for the max number of points per collection.

@agourlay
agourlay marked this pull request as ready for review February 11, 2025 12:29
Comment on lines +117 to +118
/// Estimated amount of points.
pub points_count: usize,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good to mention it is estimated

Comment thread docs/redoc/master/openapi.json Outdated
"nullable": true
},
"max_points_count": {
"description": "Max number of points in a collection",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we should mention that it is an estimated number here too

check_collection_payload_size_limit(payload_storage_size_limit_bytes, stats)?;
}

if let Some(points_count_limit) = point_limit {

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.

Would it make sense to include the number of points the current request might add? As far as I can see we're not doing that.

Imagine we set a point limit of 1. It looks like the first request is able to insert a 100 points in one operation, and only then we're limiting point count. Or am I wrong on that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You are right, it would be better to not assume each request is equivalent to adding one point.
I will see what I can do here 👍

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.

@agourlay I'd be fine with handling that in a separate PR, so we keep this one simple and clean.

I don't deem this super critical, but rather a nice to have.

@agourlay
agourlay merged commit 1a7e270 into dev Feb 12, 2025
@agourlay
agourlay deleted the strict-mode-max-point-count branch February 12, 2025 10:10
timvisee pushed a commit that referenced this pull request Feb 17, 2025
* Add strict mode for max points count

* clarify estimated nature
@timvisee timvisee mentioned this pull request Feb 17, 2025
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