Fix: Allow filtering empty page enumerable premature reduce exit - #35
Open
dylan-chong wants to merge 3 commits into
Open
Conversation
Author
|
My god, this issue has plagued us for a few years now. I'm so happy it's fixed now 😭 😄 |
Author
|
@matehat is this something you could review+merge? |
Collaborator
|
Sorry for the delay, will review today! |
Author
|
Sorry for the bother, but would be great to get this merged |
|
Omg I would love for this to get merged. This has been bugging me for so long. Can't wait for code review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because of ALLOW FILTERING, it is possible for a Scylla query to return pages of rows which are often empty, followed by non empty pages. This causes CQEx's enumerable to fail to iterate past the empty page and therefore not stream all the results
I populate my table (partitioned by
id) where 5% (by random chance) of the events match the WHERE clause and 95% do notAs you can see there are many empty pages by there are still several events
I now try this using CQEx and find no events
I now run this again but with redbug
what is suspicious to me is the last call:
% cqerl:has_more_pages/1 -> truewhich returns true.This I guess indicates the Enumerable recursion exits before
cqerl:has_more_pagescan return false.This last line
% cqerl:next/1 -> empty_datasetindicates that we prematurely exit.Now it works! 🥳
This affects scylla 3.x and 4.x. Have not tried Cassandra
This issue will also affect the
defp findfunction as well