mirror of
https://github.com/qdrant/qdrant.git
synced 2026-08-02 08:00:55 -05:00
`LocalShard::scroll_randomly` pre-allocated its result set with `HashSet::with_capacity(limit)`, where `limit` is the client-supplied request limit and is unbounded by default (`StrictModeConfig::max_query_limit` is `None` unless an operator sets it). A very large limit made the up-front allocation fail and abort the process (`handle_alloc_error`), which cannot be caught and returned as an error. The sample loop inserts at most `min(limit, total points available across segments)` points, so bound the pre-allocation to what is actually available. Capacity is unchanged for normal requests; only the pathological case is bounded. Same class as the search top-k fix (#4321 / #4328) and the in-flight edge fix (#9374). Adds a regression test.