Skip to content

Death by limit #1932

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

Closed
rafie opened this issue Apr 4, 2021 · 3 comments · Fixed by #1952
Closed

Death by limit #1932

rafie opened this issue Apr 4, 2021 · 3 comments · Fixed by #1952
Assignees

Comments

@rafie
Copy link
Contributor

rafie commented Apr 4, 2021

127.0.0.1:20000> FT.CREATE idx SCHEMA t TEXT
OK
127.0.0.1:20000> FT.AGGREGATE idx * LIMIT 100000000000000000 100000000000 SORTBY 1 @t
Error: Connection reset by peer

a.k.a MOD-1063

@ashtul ashtul assigned ashtul and unassigned ashtul Apr 4, 2021
@ashtul
Copy link
Contributor

ashtul commented Apr 4, 2021

Failure is due to result in heap allocation of a huge chunk of memory.
We can check if the offset is larger than the number of docs in the index and, in this case, return 0 results.

@oshadmi oshadmi self-assigned this Apr 4, 2021
@MeirShpilraien
Copy link
Collaborator

Why not limit it with MAXAGGREGATERESULTS?

@rafie
Copy link
Contributor Author

rafie commented Apr 4, 2021

@MeirShpilraien RPSorter_NewByFields is naturally linked to aggregation (via getArrangeRP), so MAXAGGREGATERESULTS is the natural choice. However, it is set by default to no limit, so it won't solve the death problem unless configured to a real limit.

rafie added a commit that referenced this issue Apr 16, 2021
rafie added a commit that referenced this issue Apr 18, 2021
* Fix death by limit

Fixes #1932

* Limit offset

Co-authored-by: ariel shtul <[email protected]>
rafie added a commit that referenced this issue Apr 21, 2021
* Fix death by limit

Fixes #1932

* Limit offset

Co-authored-by: ariel shtul <[email protected]>
(cherry picked from commit d6f649b)
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 a pull request may close this issue.

4 participants